manage.view 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. @Title{Blog}@
  2. @CSS{
  3. td:last-child{
  4. white-space:nowrap;
  5. }
  6. }@
  7. @CSSSmall{
  8. @media(orientation:portrait){
  9. td:nth-child(3), th:nth-child(3){
  10. display:none;
  11. }
  12. }
  13. td:first-child, th:first-child{
  14. display:none;
  15. }
  16. table{
  17. width:100%;
  18. }
  19. td:last-child,th:last-child,td:nth-child(3), th:nth-child(3){
  20. width:1px;
  21. }
  22. }@
  23. @JavaScript{
  24. $(function(){
  25. $("button.jsNav").click(function(e){
  26. Navigate($(this).val());
  27. return false;
  28. });
  29. });
  30. }@
  31. @ButtonsRight{
  32. <button onclick="window.location.href='/blog/create'" title="Create">
  33. <img src="/images/add.svg" alt="Add" />
  34. </button>
  35. }@
  36. @Body{
  37. <form action="" method="post" id="manageForm">
  38. <input type="hidden" name="formSubmitted" value="yes" />
  39. <table>
  40. <tr>
  41. <th>ID</th>
  42. <th>Title</th>
  43. <th>Timestamp</th>
  44. <th>Actions</th>
  45. </tr>
  46. <?php foreach ($posts as $post){?>
  47. <tr>
  48. <td><?=$post->PostId?></td>
  49. <td><a href="/blog/viewdraft/<?=$post->PostUrl?>"><?=$post->PostTitle?></a></td>
  50. <td><?=$post->PostTimestamp?></td>
  51. <td>
  52. <button value="<?=$post->PostId?>" name="delete" title="Delete">
  53. <img src="/images/delete.svg" alt="Delete" />
  54. </button>
  55. <button value="/blog/edit/<?=$post->PostId?>" name="edit" title="Edit" class="jsNav">
  56. <img src="/images/edit.svg" alt="Edit" />
  57. </button>
  58. <?php if ($post->PostContent != $post->PostDraft) {?>
  59. <button value="<?=$post->PostId?>" name="publish" title="Publish">
  60. <img src="/images/send.svg" alt="Publish" />
  61. </button>
  62. <?php } else {?>
  63. <img src="/images/done.svg" alt="Done" title="Published" />
  64. <?php } ?>
  65. </td>
  66. </tr>
  67. <?php } ?>
  68. </table>
  69. </form>
  70. }@