123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- {% extends "base.html" %}
- {% import "macro.html" as macro %}
- {% block title %} 文档 {% endblock %}
- {% block style %}
- {{ super() }}
- <link href="{{ url_for('static', filename='styles/docx/article.css') }}" rel="stylesheet">
- {% endblock %}
- {% block context %}
- <section id="base" class="container mt-3">
- {% if current_user.check_role("ReadBlog") %}
- {# 检查是否具有读取权限 #}
- <div class="row">
- <article class="col-12">
- <h1> {{ article.title }} <small> {{ article.subtitle }} <small> {{ article.update_time}} </small> </small> </h1>
- {% for archive in article.archive %}
- <span class="badge badge-info"> {{ archive.name }} </span>
- {% endfor %}
- <a href="{{ url_for('docx.article_down_page', blog_id=article.blog_id) }}"> 下载 </a>
- <hr>
- {{ article.context | safe }}
- </article>
- </div>
- {% endif %}
- {% if current_user.check_role("ReadComment") %}
- <div class="row">
- <article class="col-12">
- <h1 class="mt-3"> 评论 </h1>
- <section class="col-12 text-right">
- <form action="{{ url_for('docx.comment_page', blog=article.blog_id) }}" method="post">
- {{ form.hidden_tag() }}
- {{ form.context(class="form-control mb-2", rows="3") }}
- <div id="CommentModal" class="modal fade" role="dialog" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content text-left">
- <div class="modal-header">
- <h4 class="modal-title" id="CommentModalLabel"> 确认评论? </h4>
- </div>
- <div class="modal-body">
- <p> 是否确认评论?请注意网络用语文明。 </p>
- </div>
- <div class="modal-footer">
- {{ form.submit(class="btn btn-info", value="确认") }}
- <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <button type="button" class="btn btn-info mb-2" data-toggle="modal" data-target="#CommentModal"> 评论 </button>
- </form>
- </section>
- <hr>
- {% for comment in article.comment %}
- {% if show_delete %}
- <div id="DeleteModal{{comment.comment_id}}" class="modal fade" role="dialog" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content text-left">
- <div class="modal-header">
- <h4 class="modal-title"> 确认删除评论? </h4>
- </div>
- <div class="modal-body">
- <p> 是否确认删除评论? </p>
- </div>
- <div class="modal-footer">
- <a class="btn btn-danger"
- href="{{ url_for("docx.delete_comment_page", comment_id=comment.comment_id) }}"> 删除 </a>
- <button type="button" class="btn btn-secondary" data-dismiss="modal"> 取消 </button>
- </div>
- </div>
- </div>
- </div>
- {% endif %}
- <section class="col-12">
- <div class="comment">
- <p class="comment-title h5">
- {% if show_email %} {# 判断是否可读取用户信息 #}
- {{ comment.auth.email }}
- {% else %}
- {{ comment.auth.s_email }}
- {% endif %}
- {% if show_delete %}
- <a class="mb-2"
- data-toggle="modal" data-target="#DeleteModal{{comment.comment_id}}"> × </a>
- {% endif %}
- <br>
- <small> {{ comment.update_time }} </small>
- </p>
- <p> {{ comment.context.replace('\n', '<br>') | safe }} </p>
- </div>
- </section>
- {% endfor %}
- </article>
- </div>
- {% endif %}
- </section>
- {% endblock %}
|