From bdff359178d6696d1934a3e350d6cd1b33282251 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Fri, 6 Jan 2017 11:00:17 -0800 Subject: [PATCH] support rich editor in logged-out mode --- controllers/editor.php | 11 +++++------ 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 @@ 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 @@
- user->url) ?> + user): ?> + user->url) ?> + Draft
@@ -109,6 +111,7 @@
You need to sign in before you can publish! Don't worry, your draft will still be here when you finish signing in.
+