add cms, add todo
[ssproject1617.git] / testcms-final-anon / system / admin / theme / posts / index.php
diff --git a/testcms-final-anon/system/admin/theme/posts/index.php b/testcms-final-anon/system/admin/theme/posts/index.php
new file mode 100644 (file)
index 0000000..074239f
--- /dev/null
@@ -0,0 +1,23 @@
+<h1>Posts <a href="<?php echo admin_url('posts/add'); ?>">Create a new post</a></h1>\r
+\r
+<?php echo Notifications::read(); ?>\r
+\r
+<section class="content">\r
+       <?php if($posts->length()): ?>\r
+       <ul class="list">\r
+           <?php foreach($posts as $article): ?>\r
+           <li>\r
+               <a href="<?php echo admin_url('posts/edit/' . $article->id); ?>">\r
+                   <strong><?php echo truncate($article->title, 4); ?></strong>\r
+                   <span>Created <time><?php echo date(Config::get('metadata.date_format'), $article->created); ?></time> \r
+                   by <?php echo $article->author; ?></span>\r
+                   \r
+                   <i class="status"><?php echo $article->status; ?></i>\r
+               </a>\r
+           </li>\r
+           <?php endforeach; ?>\r
+       </ul>\r
+       <?php else: ?>\r
+       <p>No posts just yet. Why not <a href="<?php echo admin_url('posts/add'); ?>">write a new one</a>?</p>\r
+       <?php endif; ?>\r
+</section>\r