draft.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {% extends 'management/_common/base.html' %}
  2. {% load page_tag %}
  3. {% block content %}
  4. <form style="padding: 0;" action="/management/draft" method="get">
  5. <div style="padding: 0" class="ui input">
  6. <input name="search_title" type="text" style="margin-right: 5px" placeholder="标题">
  7. <input name='search_content' type="text" style="margin-right: 5px" placeholder="内容">
  8. <select name="search_category" class="ui dropdown">
  9. {% for item in category %}
  10. <option value="{{ item.id }}">{{ item.name }}</option>
  11. {% endfor %}
  12. </select>
  13. <button style="margin-left: 5px" type="submit" class="ui button primary"><i class="search icon"></i>搜索</button>
  14. <a href="/management/draft" type="reset" class="ui button secondary"><i class="refresh icon"></i>重置</a>
  15. </div>
  16. </form>
  17. <table style="padding: 0" class="ui celled table">
  18. <thead>
  19. <tr>
  20. <th>封面</th>
  21. <th>标题</th>
  22. <th>分类</th>
  23. <th>创建时间</th>
  24. <th>置顶</th>
  25. <th>状态</th>
  26. <th>操作</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. {% for article in articles %}
  31. <tr>
  32. <td>{{ article.cover__file_net_path }}</td>
  33. <td><a href="/management/article/to_edit/{{ article.id }}">{{ article.title }}</a></td>
  34. <td>{{ article.category__name }}</td>
  35. <td>{{ article.created_time }}</td>
  36. <td>{{ article.is_top }}</td>
  37. <td>{% if article.status == 1 %}
  38. <strong style="color: green">发布</strong>
  39. {% elif article.status == 0 %}
  40. <strong style="color: orange">草稿</strong>
  41. {% endif %} </td>
  42. <td><a onclick="deleteConfirm({{ article.id }})" href="#" class="button" style="color: red">删除</a>
  43. </td>
  44. </tr>
  45. {% endfor %}
  46. </tbody>
  47. <tfoot>
  48. <tr>
  49. <th colspan="7">
  50. <div class="ui right floated pagination menu">
  51. {% if articles.number > 1 %}
  52. <a href="?page={{ articles.number|add:-1 }}" class="icon item">
  53. <i class="left chevron icon"></i>
  54. </a>
  55. {% else %}
  56. <a class="icon item">
  57. <i class="left chevron icon"></i>
  58. </a>
  59. {% endif %}
  60. {% for page in articles.paginator.page_range %}
  61. {% circle_page articles.number page %}
  62. {% endfor %}
  63. {% if articles.number < articles.paginator.num_pages %}
  64. <a href="?page={{ articles.number | add:1 }}" class="icon item">
  65. <i class="right chevron icon"></i>
  66. </a>
  67. {% else %}
  68. <a class="icon item">
  69. <i class="right chevron icon"></i>
  70. </a>
  71. {% endif %}
  72. </div>
  73. </th>
  74. </tr>
  75. </tfoot>
  76. </table>
  77. <div class="ui mini test modal">
  78. <div class="header">
  79. 警告
  80. </div>
  81. <div class="content">
  82. <p>确认删除该文章?</p>
  83. </div>
  84. <div class="actions">
  85. <div class="ui negative button">
  86. 取消
  87. </div>
  88. <a id="deleteBtn" href="" class="ui positive right labeled icon button">
  89. 确认
  90. <i class="checkmark icon"></i>
  91. </a>
  92. </div>
  93. </div>
  94. {% endblock %}
  95. {% block js %}
  96. <script>
  97. function deleteConfirm(id) {
  98. $('.mini.modal')
  99. .modal('show')
  100. $("#deleteBtn").attr('href', '/management/article/delete_article?id=' + id)
  101. }
  102. </script>
  103. {% endblock %}