您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

77 行
3.9 KiB

  1. {% extends 'base.html' %}
  2. {% from 'bootstrap/pagination.html' import render_pagination %}
  3. {% from 'bootstrap/form.html' import render_form, render_field %}
  4. {% block title %}{{ photo.author.name }}的照片{% endblock %}
  5. {% block content %}
  6. <div class="row">
  7. <div class="col-md-8">
  8. <div class="photo">
  9. <a href="{{ url_for('.get_image', filename=photo.filename) }}" target="_blank">
  10. <img class="img-fluid" src="{{ url_for('.get_image', filename=photo.filename_m) }}">
  11. </a>
  12. </div>
  13. <a class="btn btn-primary btn-sm text-white" data-toggle="modal" data-target="#share-modal">分享</a>
  14. {% if current_user == photo.author or current_user.can('MODERATE') %}
  15. <a class="btn btn-danger btn-sm text-white" data-toggle="modal" data-target="#confirm-delete"
  16. data-href="{{ url_for('.delete_photo', photo_id=photo.id) }}">删除</a>
  17. {% endif %}
  18. {% if current_user.is_authenticated and current_user != photo.author %}
  19. <form class="inline" method="post" action="{{ url_for('.report_photo', photo_id=photo.id) }}">
  20. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
  21. <button type="submit" class="btn btn-link btn-sm">汇报</button>
  22. </form>
  23. {% endif %}
  24. <p class="text-muted float-right small">
  25. <span class="oi oi-clock"></span> 上传 {{ moment(photo.timestamp).format('LL') }}
  26. </p>
  27. {% include 'main/_comment.html' %}
  28. </div>
  29. <div class="col-md-4">
  30. {% include 'main/_photo_sidebar.html' %}
  31. </div>
  32. </div>
  33. <!-- share modal -->
  34. <div class="modal fade" id="share-modal" tabindex="-1" role="dialog" aria-labelledby="shareModalLabel">
  35. <div class="modal-dialog" role="document">
  36. <div class="modal-content">
  37. <div class="modal-header">
  38. <h5 class="modal-title" id="shareModalLabel">链接</h5>
  39. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  40. <span aria-hidden="true">&times;</span>
  41. </button>
  42. </div>
  43. <div class="modal-body w-100">
  44. <input class="form-control" value="{{ url_for('.show_photo', photo_id=photo.id, _external=True) }}"
  45. readonly>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <!-- delete confirm modal -->
  51. {% if current_user.is_authenticated %}
  52. <div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel"
  53. aria-hidden="true">
  54. <div class="modal-dialog modal-sm">
  55. <div class="modal-content">
  56. <div class="modal-header">
  57. <h5 class="modal-title" id="confirmModalLabel">删除确认</h5>
  58. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  59. aria-hidden="true">&times;</span></button>
  60. </div>
  61. <div class="modal-body">
  62. <p>确定要删除该项目吗?</p>
  63. </div>
  64. <div class="modal-footer">
  65. <form class="delete-form" action="" method="post">
  66. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
  67. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  68. <button class="btn btn-danger btn-confirm" type="submit">删除</button>
  69. </form>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. {% endif %}
  75. {% endblock %}