Browse Source

add dashboard with links to all post types

pull/35/head
Aaron Parecki 5 years ago
parent
commit
704241a3a4
3 changed files with 28 additions and 3 deletions
  1. +10
    -0
      controllers/controllers.php
  2. +15
    -0
      views/dashboard.php
  3. +3
    -3
      views/partials/header.php

+ 10
- 0
controllers/controllers.php View File

@ -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();

+ 15
- 0
views/dashboard.php View File

@ -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>

+ 3
- 3
views/partials/header.php View File

@ -1,4 +1,4 @@
<div class="header">
<img src="/images/quill-logo.png" width="42" height="42">
Quill
</div>
<a href="/dashboard"><img src="/images/quill-logo.png" width="42" height="42"></a>
<a href="/dashboard">Quill</a>
</div>

Loading…
Cancel
Save