|
|
@@ -4,23 +4,35 @@
|
|
|
文章详情:{{ article.title }}
|
|
|
{% endblock title %}
|
|
|
{% block content %}
|
|
|
- <div class="container">
|
|
|
+ <header class="masthead" id="masthead" style="background-image: url({{ article.avatar.url }}) !important;">
|
|
|
+ <div class="overlay"></div>
|
|
|
+ <div class="container">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-lg-12 col-md-10 mx-auto">
|
|
|
+ <div class="site-heading no-gutter" data-aos="fade-up" data-aos-delay="100">
|
|
|
+ <h1>{{ article.title }}</h1>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+ <div class="container" id="content">
|
|
|
<div class="row">
|
|
|
<div class="col-3 mt-4 sidebar" id="sidebar">
|
|
|
<div class="sidebar__inner">
|
|
|
- <h4><strong>目录</strong></h4>
|
|
|
+ <h4 data-aos="fade-up" data-aos-delay="100"><strong>目录</strong></h4>
|
|
|
<hr>
|
|
|
- <div>
|
|
|
+ <div data-aos="fade-up" data-aos-delay="140">
|
|
|
{{ toc|safe }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-9">
|
|
|
- <h1 class="mt-4 mb-4">
|
|
|
+ <h1 class="mt-4 mb-4" data-aos="fade-up" data-aos-delay="100">
|
|
|
{{ article.title }}
|
|
|
</h1>
|
|
|
|
|
|
- <div class="col-12 alert alert-success">
|
|
|
+ <div class="col-12 alert alert-success" data-aos="fade-up" data-aos-delay="120">
|
|
|
作者: {{ article.author }}
|
|
|
{% if user == article.author %}
|
|
|
· <a href="#" onclick="confirm_delete()">
|
|
|
@@ -30,9 +42,7 @@
|
|
|
编辑文章
|
|
|
</a>
|
|
|
{% endif %}
|
|
|
- <div>
|
|
|
- 浏览:{{ article.total_views }}
|
|
|
- </div>
|
|
|
+ 浏览:{{ article.total_views }}
|
|
|
<form style="display: none"
|
|
|
id="safa_delete"
|
|
|
action="{% url 'article:article_safe_delete' article.id %}"
|
|
|
@@ -44,23 +54,14 @@
|
|
|
</button>
|
|
|
</form>
|
|
|
</div>
|
|
|
- {% if article.avatar %}
|
|
|
- <div class="row mt-2">
|
|
|
- <img src="{{ article.avatar.url }}"
|
|
|
- alt="avatar"
|
|
|
- style="max-width: 100%; border-radius: 20px;"
|
|
|
- >
|
|
|
- </div>
|
|
|
- <hr/>
|
|
|
- {% endif %}
|
|
|
- <div class="col-12">
|
|
|
+ <div class="col-12" data-aos="fade-up" data-aos-delay="160">
|
|
|
<p>
|
|
|
{{ article.body|safe }}
|
|
|
</p>
|
|
|
</div>
|
|
|
- <hr>
|
|
|
+ <hr data-aos="fade-up" data-aos-delay="160">
|
|
|
{% if user.is_authenticated %}
|
|
|
- <div>
|
|
|
+ <div data-aos="fade-up" data-aos-delay="140">
|
|
|
<form action="{% url 'comment:post_comment' article.id %}" method="post">
|
|
|
{% csrf_token %}
|
|
|
<div class="form-group">
|
|
|
@@ -81,14 +82,14 @@
|
|
|
<br>
|
|
|
{% else %}
|
|
|
<br>
|
|
|
- <h5 class="row justify-content-center">
|
|
|
+ <h5 class="row justify-content-center" data-aos="fade-up" data-aos-delay="140">
|
|
|
请<a href="{% url 'userprofile:login' %}">登录</a>后回复
|
|
|
</h5>
|
|
|
<br>
|
|
|
{% endif %}
|
|
|
{% load mptt_tags %}
|
|
|
- <h4>共有{{ comments.count }}条评论</h4>
|
|
|
- <div class="row">
|
|
|
+ <h4 data-aos="fade-up" data-aos-delay="160">共有{{ comments.count }}条评论</h4>
|
|
|
+ <div class="row" data-aos="fade-up" data-aos-delay="180">
|
|
|
<!-- 遍历树形结构 -->
|
|
|
{% recursetree comments %}
|
|
|
<!-- 给 node 取个别名 comment -->
|
|
|
@@ -188,40 +189,6 @@
|
|
|
<link rel="stylesheet" href="{% static 'prism/prism.css' %}">
|
|
|
{% endblock content %}
|
|
|
{% block script %}
|
|
|
- <!--二级回复-->
|
|
|
- <script>
|
|
|
- // 加载 modal
|
|
|
- function load_modal(article_id, comment_id) {
|
|
|
- let modal_body = '#modal_body_' + comment_id;
|
|
|
- let modal_id = '#comment_' + comment_id;
|
|
|
-
|
|
|
- // 加载编辑器
|
|
|
- if ($(modal_body).children().length === 0) {
|
|
|
- let content = '<iframe src="/comment/post_comment/' +
|
|
|
- article_id +
|
|
|
- '/' +
|
|
|
- comment_id +
|
|
|
- '"' +
|
|
|
- ' frameborder="0" style="width: 100%; height: 100%;" id="iframe_' +
|
|
|
- comment_id +
|
|
|
- '"></iframe>';
|
|
|
- $(modal_body).append(content);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
- $(modal_id).modal('show');
|
|
|
- }
|
|
|
- </script>
|
|
|
-
|
|
|
- <!--侧边栏-->
|
|
|
- <script>
|
|
|
- $(".django-ckeditor-widget").removeAttr('style');
|
|
|
- </script>
|
|
|
<script src="{% static 'sticky_sidebar/jquery.sticky-sidebar.min.js' %}"></script>
|
|
|
- <script type="text/javascript">
|
|
|
- $('#sidebar').stickySidebar({
|
|
|
- topSpacing: 20,
|
|
|
- bottomSpacing: 20,
|
|
|
- });
|
|
|
- </script>
|
|
|
+ <script src="{% static 'article/detail.js' %}"></script>
|
|
|
{% endblock script %}
|