diff options
author | Aaron Parecki <aaron@parecki.com> | 2017-01-06 11:00:17 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2017-01-06 11:00:17 -0800 |
commit | bdff359178d6696d1934a3e350d6cd1b33282251 (patch) | |
tree | b1248b230161cfef705dce25995a48b0c9841f3e | |
parent | 787cb681305d093c471a81ccae1440e3eafd73cb (diff) |
support rich editor in logged-out mode
-rw-r--r-- | controllers/editor.php | 11 | ||||
-rw-r--r-- | views/editor.php | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/controllers/editor.php b/controllers/editor.php index 0f4380b..bfe70af 100644 --- a/controllers/editor.php +++ b/controllers/editor.php @@ -1,12 +1,11 @@ <?php $app->get('/editor', function() use($app) { - if($user=require_login($app)) { - $html = $app->render('editor.php', [ - 'user' => $user - ]); - $app->response()->body($html); - } + $user = require_login($app, false); + $html = $app->render('editor.php', [ + 'user' => $user + ]); + $app->response()->body($html); }); $app->post('/editor/publish', function() use($app) { diff --git a/views/editor.php b/views/editor.php index f1d2250..5ab9442 100644 --- a/views/editor.php +++ b/views/editor.php @@ -44,7 +44,9 @@ <div class="toolbar"> <div class="toolbar-left"> <span class="item"><a href="/"><img src="/editor-files/quill-logo-36.png" width="36" height="31" class="logo"></a></span> - <span class="item text"><b><?= display_url($this->user->url) ?></b></span> + <? if($this->user): ?> + <span class="item text"><b><?= display_url($this->user->url) ?></b></span> + <? endif; ?> <span class="item text"><span id="draft-status">Draft</span></span> </div> <div class="toolbar-right"> @@ -109,6 +111,7 @@ <div class="helptext">You need to sign in before you can publish! Don't worry, your draft will still be here when you finish signing in.</div> <input type="url" class="form-field-small" placeholder="yourdomain.com" id="signin-domain"> <button class="btn btn-small" id="signin-btn">Sign In</button> + <div class="helptext small"><a href="/docs">How does this work?</a></div> </div> </div> |