diff options
author | Aaron Parecki <aaron@parecki.com> | 2016-02-10 18:41:28 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2016-02-10 18:41:28 -0800 |
commit | 704241a3a4f3480eb87260aef9fca8f1ce00e638 (patch) | |
tree | b8579b9cf746a32bf533ea15f0c2aa6e82659c47 | |
parent | 022f58d956faaf1a56b80ec25ee4fb06057bc117 (diff) |
add dashboard with links to all post types
-rw-r--r-- | controllers/controllers.php | 10 | ||||
-rw-r--r-- | views/dashboard.php | 15 | ||||
-rw-r--r-- | views/partials/header.php | 6 |
3 files changed, 28 insertions, 3 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php index 0b63699..ef619a6 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -41,6 +41,16 @@ function generate_login_token() { ), Config::$jwtSecret); } +$app->get('/dashboard', function() use($app) { + if($user=require_login($app)) { + $html = render('dashboard', array( + 'title' => 'Dashboard', + 'authorizing' => false + )); + $app->response()->body($html); + } +}); + $app->get('/new', function() use($app) { if($user=require_login($app)) { $params = $app->request()->params(); diff --git a/views/dashboard.php b/views/dashboard.php new file mode 100644 index 0000000..3c29f92 --- /dev/null +++ b/views/dashboard.php @@ -0,0 +1,15 @@ +<div class="narrow"> + <?= partial('partials/header') ?> + + <ul style="margin-top: 1em;"> + <li><a href="/editor">Editor</a></li> + <li><a href="/new">Note</a></li> + <li><a href="/bookmark">Bookmark</a></li> + <li><a href="/favorite">Favorite</a></li> + <li><a href="/repost">Repost</a></li> + <li><a href="/photo">Photo</a></li> + <li><a href="/itinerary">Itinerary</a></li> + <li><a href="/email">Email</a></li> + </ul> + +</div> diff --git a/views/partials/header.php b/views/partials/header.php index ef9f15a..4243557 100644 --- a/views/partials/header.php +++ b/views/partials/header.php @@ -1,4 +1,4 @@ <div class="header"> - <img src="/images/quill-logo.png" width="42" height="42"> - Quill -</div>
\ No newline at end of file + <a href="/dashboard"><img src="/images/quill-logo.png" width="42" height="42"></a> + <a href="/dashboard">Quill</a> +</div> |