You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
3.0 KiB

4 years ago
  1. {% extends 'admin/index.html' %}
  2. {% from 'bootstrap/pagination.html' import render_pagination %}
  3. {% block title %}管理评论{% endblock %}
  4. {% block content %}
  5. <nav aria-label="breadcrumb">
  6. <ol class="breadcrumb">
  7. {{ render_breadcrumb_item('admin.index', '控制板主页') }}
  8. {{ render_breadcrumb_item('admin.manage_comment', '管理评论') }}
  9. </ol>
  10. </nav>
  11. <div class="page-header">
  12. <h1>评论
  13. <small class="text-muted">{{ pagination.total }}</small>
  14. <span class="dropdown">
  15. <button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown"
  16. aria-haspopup="true" aria-expanded="false">
  17. Order by {{ order_rule }} <span class="oi oi-elevator"></span>
  18. </button>
  19. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  20. {% if order_rule == 'flag' %}
  21. <a class="dropdown-item" href="{{ url_for('.manage_comment', order='by_time') }}">按时间顺序</a>
  22. {% else %}
  23. <a class="dropdown-item" href="{{ url_for('.manage_comment', order='by_flag') }}">按标签顺序</a>
  24. {% endif %}
  25. </div>
  26. </span>
  27. </h1>
  28. </div>
  29. {% if comments %}
  30. <table class="table table-striped">
  31. <thead>
  32. <tr>
  33. <th>主体</th>
  34. <th>作者</th>
  35. <th>照片</th>
  36. <th>记录</th>
  37. <th>日期</th>
  38. <th>动作</th>
  39. </tr>
  40. </thead>
  41. {% for comment in comments %}
  42. <tr>
  43. <td>{{ comment.body }}</td>
  44. <td>
  45. <a href="{{ url_for('user.index', username=comment.author.username) }}">{{ comment.author.name }}</a>
  46. </td>
  47. <td>
  48. <a href="{{ url_for('main.show_photo', photo_id=comment.photo.id) }}">Photo {{ comment.photo.id }}</a>
  49. </td>
  50. <td>{{ comment.flag }}</td>
  51. <td>{{ moment(comment.timestamp).format('LL') }}</td>
  52. <td>
  53. <form class="inline" method="post"
  54. action="{{ url_for('main.delete_comment', comment_id=comment.id, next=request.full_path) }}">
  55. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
  56. <button type="submit" class="btn btn-danger btn-sm"
  57. onclick="return confirm('Are you sure?');">删除
  58. </button>
  59. </form>
  60. </td>
  61. </tr>
  62. {% endfor %}
  63. </table>
  64. <div class="page-footer">{{ render_pagination(pagination) }}</div>
  65. {% else %}
  66. <div class="tip"><h5>无评论</h5></div>
  67. {% endif %}
  68. {% endblock %}