2 <h1
>Editing
&ldquo
;<?php
echo truncate($article->title
, 4); ?
>&rdquo
;</h1
>
4 <?php
echo Notifications
::read(); ?
>
6 <section
class="content">
9 <li
><a href
="#post">Post
</a
></li
>
10 <li
><a href
="#customise">Customise
</a
></li
>
11 <li
><a href
="#fields">Custom Fields
</a
></li
>
13 <a href
="#comments">Comments
14 <?php
if($pending > 0): ?
>
15 <span title
="You have <?php echo $pending; ?> comments"><?php
echo $pending; ?
></span
>
21 <form method
="post" action
="<?php echo Url::current(); ?>" novalidate
>
23 <div data
-tab
="post" class="tab">
27 <label
for="title">Title
:</label
>
28 <input id
="title" name
="title" value
="<?php echo Input::post('title', $article->title); ?>">
30 <em
>Your post
&rsquo
;s title
.</em
>
34 <label
for="slug">Slug
:</label
>
35 <input type
="url" id
="slug" autocomplete
="off" name
="slug" value
="<?php echo Input::post('slug', $article->slug); ?>">
37 <em
>The slug
for your
post (<code id
="output">slug
</code
>).</em
>
41 <label
for="description">Description
:</label
>
42 <textarea id
="description" name
="description"><?php
echo Input
::post('description', $article->description
); ?
></textarea
>
44 <em
>A brief outline of what your post is about
. Used in the post introduction
, RSS feed
, and <code
><
;meta name
="description" />
;</code
>.</em
>
48 <label
for="html">Content
:</label
>
49 <textarea id
="html" name
="html"><?php
echo Input
::post('html', $article->html
); ?
></textarea
>
51 <em
>Your post
's main content. Enjoys a healthy dose of valid HTML.</em>
55 <label>Status:</label>
56 <select id="status" name="status">
57 <?php foreach(array('draft
', 'archived
', 'published
') as $status): ?>
58 <?php $selected = (Input::post('status
', $article->status) == $status) ? ' selected
' : ''; ?>
59 <option value="<?php echo $status; ?>"<?php echo $selected; ?>>
60 <?php echo ucwords($status); ?>
65 <em>Statuses: live (published), pending (draft), or hidden (archived).</em>
69 <label for="comments">Allow Comments:</label>
70 <input id="comments" name="comments" type="checkbox" value="1"<?php if(Input::post('comments
', $article->comments)) echo ' checked
'; ?>>
71 <em>This will allow users to comment on your posts.</em>
76 <div data-tab="customise" class="tab">
79 <legend>Customise</legend>
80 <em>Here, you can customise your posts. This section is optional.</em>
83 <label for="css">Custom CSS:</label>
84 <textarea id="css" name="css"><?php echo Input::post('css
', $article->css); ?></textarea>
86 <em>Custom CSS. Will be wrapped in a <code><style></code> block.</em>
90 <label for="js">Custom JS:</label>
91 <textarea id="js" name="js"><?php echo Input::post('js
', $article->js); ?></textarea>
93 <em>Custom Javascript. Will be wrapped in a <code><script></code> block.</em>
98 <div data-tab="fields" class="tab">
101 <legend>Custom fields</legend>
102 <em>Create custom fields here.</em>
105 <!-- Re-Populate data -->
106 <?php foreach(parse_fields($article->custom_fields) as $key => $data): ?>
108 <label><?php echo $data['label
']; ?></label>
109 <input name="field[<?php echo $key; ?>:<?php echo $data['label
']; ?>]" value="<?php echo $data['value
']; ?>">
113 <!-- Re-Populate post data -->
114 <?php foreach(Input::post('field
', array()) as $data => $value): ?>
115 <?php list($key, $label) = explode(':', $data); ?>
117 <label><?php echo $label; ?></label>
118 <input name="field[<?php echo $key; ?>:<?php echo $label; ?>]" value="<?php echo $value; ?>">
124 <button id="create" type="button">Create a custom field</button>
128 <div data-tab="comments" class="tab">
131 <legend>Comments</legend>
132 <em>Here, you can moderate your comments.</em>
134 <?php if(count($comments)): ?>
136 <?php foreach($comments as $comment):?>
137 <li data-id="<?php echo $comment->id; ?>">
139 <p><strong><?php echo $comment->name; ?></strong>
140 <?php echo date(Config::get('metadata
.date_format
'), $comment->date); ?><br>
141 <em>Status: <span data-status="<?php echo $comment->id; ?>"><?php echo $comment->status; ?></span></em></p>
144 <p class="comment" data-text="<?php echo $comment->id; ?>"><?php echo $comment->text; ?></p>
147 <?php if($comment->status == 'pending
'): ?>
148 <li><a href="#publish">Publish</a></li>
150 <li><a href="#edit">Edit</a></li>
151 <li><a href="#delete">Delete</a></li>
157 <p>No comments yet.</p>
164 <button name="save" type="submit">Save</button>
165 <button name="delete" type="submit">Delete</button>
166 <a href="<?php echo admin_url('posts
'); ?>">Return to posts</a>
174 <em>Some useful links.</em>
176 <li><a href="<?php echo Url::make($page->slug . '/' . $article->slug); ?>">View this post on your site</a></li>
180 <script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"></script>
181 <script>window.MooTools || document.write('<script src
="<?php echo theme_url('assets/js/mootools.js'); ?>"><\
/script
>');</script>
182 <script src="<?php echo theme_url('assets
/js
/helpers
.js
'); ?>"></script>
183 <script src="<?php echo theme_url('assets
/js
/popup
.js
'); ?>"></script>
184 <script src="<?php echo theme_url('assets
/js
/custom_fields
.js
'); ?>"></script>
185 <script src="<?php echo theme_url('assets
/js
/comments
.js
'); ?>"></script>
186 <script src="<?php echo theme_url('assets
/js
/tabs
.js
'); ?>"></script>
189 var slug = $('slug
'), output = $('output
');
191 // call the function to init the input text
192 formatSlug(slug, output);
195 slug.addEvent('keyup
', function() {formatSlug(slug, output)});