add cms, add todo
[ssproject1617.git] / testcms-final-anon / system / admin / theme / posts / add.php
1
2 <h1>Add a Post</h1>
3
4 <?php echo Notifications::read(); ?>
5
6 <section class="content">
7 <nav class="tabs">
8 <ul>
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>
12 <li><a href="#comments">Comments</a></li>
13 </ul>
14 </nav>
15 <form method="post" action="<?php echo Url::current(); ?>" novalidate>
16 <div data-tab="post" class="tab">
17
18 <fieldset>
19 <p>
20 <label for="title">Title:</label>
21 <input id="title" name="title" value="<?php echo Input::post('title'); ?>">
22
23 <em>Your post&rsquo;s title.</em>
24 </p>
25
26 <p>
27 <label for="slug">Slug:</label>
28 <input id="slug" autocomplete="off" name="slug" value="<?php echo Input::post('slug'); ?>">
29
30 <em>The slug for your post (<code id="output">slug</code>).</em>
31 </p>
32
33 <p>
34 <label for="description">Description:</label>
35 <textarea id="description" name="description"><?php echo Input::post('description'); ?></textarea>
36
37 <em>A brief outline of what your post is about. Used in the post introduction, RSS feed, and <code>&lt;meta name="description" /&gt;</code>.</em>
38 </p>
39
40 <p>
41 <label for="html">Content:</label>
42 <textarea id="html" name="html"><?php echo Input::post('html'); ?></textarea>
43
44 <em>Your post's main content. Enjoys a healthy dose of valid HTML.</em>
45 </p>
46
47 <p>
48 <label>Status:</label>
49 <select id="status" name="status">
50 <?php foreach(array('draft', 'archived', 'published') as $status): ?>
51 <?php $selected = (Input::post('status') == $status) ? ' selected' : ''; ?>
52 <option value="<?php echo $status; ?>"<?php echo $selected; ?>>
53 <?php echo ucwords($status); ?>
54 </option>
55 <?php endforeach; ?>
56 </select>
57
58 <em>Statuses: live (published), pending (draft), or hidden (archived).</em>
59 </p>
60
61 <p>
62 <label for="comments">Allow Comments:</label>
63 <input id="comments" name="comments" type="checkbox" value="1"<?php if(Input::post('comments')) echo ' checked'; ?>>
64 <em>This will allow users to comment on your posts.</em>
65 </p>
66 </fieldset>
67
68 </div>
69 <div data-tab="customise" class="tab">
70
71 <fieldset>
72 <legend>Customise</legend>
73 <em>Here, you can customise your posts. This section is optional.</em>
74
75 <p>
76 <label for="css">Custom CSS:</label>
77 <textarea id="css" name="css"><?php echo Input::post('css'); ?></textarea>
78
79 <em>Custom CSS. Will be wrapped in a <code>&lt;style&gt;</code> block.</em>
80 </p>
81
82 <p>
83 <label for="js">Custom JS:</label>
84 <textarea id="js" name="js"><?php echo Input::post('js'); ?></textarea>
85
86 <em>Custom Javascript. Will be wrapped in a <code>&lt;script&gt;</code> block.</em>
87 </p>
88 </fieldset>
89
90 </div>
91 <div data-tab="fields" class="tab">
92
93 <fieldset>
94 <legend>Custom fields</legend>
95 <em>Create custom fields here.</em>
96
97 <div id="fields">
98 <!-- Re-Populate post data -->
99 <?php foreach(Input::post('field', array()) as $data => $value): ?>
100 <?php list($key, $label) = explode(':', $data); ?>
101 <p>
102 <label><?php echo $label; ?></label>
103 <input name="field[<?php echo $key; ?>:<?php echo $label; ?>]" value="<?php echo $value; ?>">
104 </p>
105 <?php endforeach; ?>
106 </div>
107 </fieldset>
108
109 <button id="create" type="button">Create a custom field</button>
110 </div>
111
112 <p class="buttons">
113 <button type="submit">Create</button>
114 <a href="<?php echo admin_url('posts'); ?>">Return to posts</a>
115 </p>
116 </form>
117
118 </section>
119
120 <script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"></script>
121 <script>window.MooTools || document.write('<script src="<?php echo theme_url('assets/js/mootools.js'); ?>"><\/script>');</script>
122 <script src="<?php echo theme_url('assets/js/helpers.js'); ?>"></script>
123 <script src="<?php echo theme_url('assets/js/popup.js'); ?>"></script>
124 <script src="<?php echo theme_url('assets/js/custom_fields.js'); ?>"></script>
125 <script src="<?php echo theme_url('assets/js/tabs.js'); ?>"></script>
126 <script>
127 (function() {
128 var slug = $('slug'), output = $('output');
129
130 // call the function to init the input text
131 formatSlug(slug, output);
132
133 // bind to input
134 slug.addEvent('keyup', function() {formatSlug(slug, output)});
135 }());
136 </script>