Browse Source

show logged-in user on editor

fixes #9
pull/64/head
Aaron Parecki 8 years ago
parent
commit
ab0c5f9bfa
No known key found for this signature in database GPG Key ID: 276C2817346D6056
  1. 4
      controllers/editor.php
  2. 2
      public/editor-files/style.css
  3. 18
      views/editor.php
  4. 2
      views/layout.php

4
controllers/editor.php

@ -2,7 +2,9 @@
$app->get('/editor', function() use($app) { $app->get('/editor', function() use($app) {
if($user=require_login($app)) { if($user=require_login($app)) {
$html = $app->render('editor.php');
$html = $app->render('editor.php', [
'user' => $user
]);
$app->response()->body($html); $app->response()->body($html);
} }
}); });

2
public/editor-files/style.css

@ -75,7 +75,7 @@ img { border: 0; }
.toolbar-left .logo { .toolbar-left .logo {
vertical-align: middle; vertical-align: middle;
} }
#draft-status {
.toolbar .item.text {
color: #aaa; color: #aaa;
font-family: sans-serif; font-family: sans-serif;
font-size: 16px; font-size: 16px;

18
views/editor.php

@ -3,8 +3,8 @@
<head> <head>
<title>Quill Editor</title> <title>Quill Editor</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="pingback" href="http://webmention.io/aaronpk/xmlrpc" />
<link rel="webmention" href="http://webmention.io/aaronpk/webmention" />
<link rel="pingback" href="https://webmention.io/aaronpk/xmlrpc" />
<link rel="webmention" href="https://webmention.io/aaronpk/webmention" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<!-- standard viewport tag to set the viewport to the device's width <!-- standard viewport tag to set the viewport to the device's width
@ -44,6 +44,7 @@
<div class="toolbar"> <div class="toolbar">
<div class="toolbar-left"> <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"><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>
<span class="item text"><span id="draft-status">Draft</span></span> <span class="item text"><span id="draft-status">Draft</span></span>
</div> </div>
<div class="toolbar-right"> <div class="toolbar-right">
@ -69,8 +70,10 @@
<div style="clear:right;"></div> <div style="clear:right;"></div>
<div class="helptext" id="publish-help"> <div class="helptext" id="publish-help">
<div>Clicking "Publish Now" will send a request to your Micropub endpoint.</div><br>
<div>The request will include two fields, "name" and "content", where the content will be the full HTML for this post.</div>
<div style="font-size:0.8em;">
Clicking "Publish Now" will send a request to your Micropub endpoint.<br><br>
The request will include two fields, "name" and "content", where the content will be the full HTML for this post.
</div>
</div> </div>
<div class="helptext hidden" id="publish-in-progress"> <div class="helptext hidden" id="publish-in-progress">
@ -78,7 +81,6 @@
</div> </div>
<div class="helptext hidden" id="publish-success"> <div class="helptext hidden" id="publish-success">
<div>It worked! The post is on your site!</div><br>
<div><a href="" id="publish-success-url">View your post</a></div> <div><a href="" id="publish-success-url">View your post</a></div>
</div> </div>
@ -100,12 +102,6 @@
<div id="content" class="editable"></div> <div id="content" class="editable"></div>
</div> </div>
<div id="new_version_available">
<div class="inner">
There is a new version available! Refresh to load the new version.
</div>
</div>
<script src="/editor-files/editor.js"></script> <script src="/editor-files/editor.js"></script>
</body> </body>

2
views/layout.php

@ -75,7 +75,7 @@
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<?php if(session('me')) { ?> <?php if(session('me')) { ?>
<li><a href="/settings"> <?= preg_replace(array('/https?:\/\//','/\/$/'),'',session('me')) ?></a></li>
<li><a href="/settings"> <?= display_url(session('me')) ?></a></li>
<li><a href="/signout">Sign Out</a></li> <li><a href="/signout">Sign Out</a></li>
<?php } else if(property_exists($this, 'authorizing')) { ?> <?php } else if(property_exists($this, 'authorizing')) { ?>
<li class="navbar-text"><?= $this->authorizing ?></li> <li class="navbar-text"><?= $this->authorizing ?></li>

Loading…
Cancel
Save