-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.html
141 lines (141 loc) · 6.63 KB
/
post.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{% extends 'oierspace/blog/themes/pc/theme_argon/base.html' %}
{% block title %}{{ post.title }} - {{ blog.name }}{% endblock %}
{% block head %}
{% include 'oierspace/blog/themes/pc/markdown_latex_import.html' %}
{% endblock %}
{% block content %}
<article class="post post-full card bg-white shadow-sm border-0">
{% if post.configs.cover %}
<header class="post-header text-center post-header-with-thumbnail">
<img class="post-thumbnail lazyload lazyload-loaded" src="{{ post.configs.cover }}" alt="thumbnail"
style="opacity: 0;">
<div class="post-header-text-container">
<a class="post-title" href="{% url 'blog_post' post.slug %}">{{ post.title }}</a>
{% include 'oierspace/blog/themes/pc/theme_argon/component/post_meta.html' %}
</div>
</header>
{% else %}
<header class="post-header text-center">
<a class="post-title" href="{% url 'blog_post' post.slug %}">{{ post.title }}</a>
{% include 'oierspace/blog/themes/pc/theme_argon/component/post_meta.html' %}
</header>
{% endif %}
<div class="post-content" id="post_content">
<div id="post_content_md" class="markdown"></div>
<script>
document.getElementById('post_content_md').innerHTML = markdownit({html:true}).use(
texmath,
{
engine: katex,
delimiters: 'dollars',
}
).render("{{ post.content|escapejs }}");
hljs.highlightAll();
</script>
{% include 'oierspace/blog/themes/pc/theme_argon/component/markdown_css_important.html' %}
</div>
<div class="mt-2">
最后编辑于 {{ post.last_edit_time }}
{% if post.wbh_voted_up %}
<span class="badge bg-secondary text-primary align-bottom"><i class="fas fa-thumbs-up"></i> 站长赞了</span>
{% endif %}
<br>
<div id="vote" class="mt-1">
{% if user_vote == 1 %}
<a href="?vote=cancel"><i class="fas fa-thumbs-up"></i></a>
{% else %}
<a href="?vote=up"><i class="far fa-thumbs-up"></i></a>
{% endif %}
 {{ post.vote }} 
{% if user_vote == -1 %}
<a href="?vote=cancel"><i class="fas fa-thumbs-down"></i></a>
{% else %}
<a href="?vote=down"><i class="far fa-thumbs-down"></i></a>
{% endif %}
</div>
</div>
</article>
{% if comments %}
<div id="comments" class="comments-area card shadow-sm">
<div class="card-body">
<ol class="comment-list">
{% for comment in comments %}
<li class="comment-item" id="comment-{{ comment.pk }}">
<div class="comment-item-inner w-100" id="comment-inner-{{ comment.pk }}">
<div class="comment-item-title">
<div class="comment-name">
<div class="comment-author">
{{ comment.username_display }}
{% if comment.blogger_voted_up %}
<span class="badge bg-secondary text-primary align-bottom"><i class="fas fa-thumbs-up"></i> 博主赞了</span>
{% endif %}
{% if comment.wbh_voted_up %}
<span class="badge bg-secondary text-primary align-bottom"><i class="fas fa-thumbs-up"></i> 站长赞了</span>
{% endif %}
</div>
</div>
<div class="comment-info">
<div class="comment-time">
{% if comment.user == user or blog.owner == user %}
<a href="?delete={{ comment.pk }}">删除</a>
{% endif %}
 
{% if comment.user_vote == 1 %}
<a href="?vote=cancel&vote_target={{ comment.pk }}"><i class="fas fa-thumbs-up"></i></a>
{% else %}
<a href="?vote=up&vote_target={{ comment.pk }}"><i class="far fa-thumbs-up"></i></a>
{% endif %}
 {{ comment.vote }} 
{% if comment.user_vote == -1 %}
<a href="?vote=cancel&vote_target={{ comment.pk }}"><i class="fas fa-thumbs-down"></i></a>
{% else %}
<a href="?vote=down&vote_target={{ comment.pk }}"><i class="far fa-thumbs-down"></i></a>
{% endif %}
 
<span class="human-time">{{ comment.sending_time }}</span>
</div>
</div>
</div>
<div class="comment-item-text">
<p>{{ comment.content }}</p>
</div>
</div>
</li>
{% endfor %}
</ol>
</div>
</div>
{% endif %}
<div id="post_comment" class="card shadow-sm">
<div class="card-body">
{% if user.is_authenticated %}
<form method="post" action="#comments">
{% csrf_token %}
<div class="row">
<div class="col-md-12">
<textarea id="post_comment_content" class="form-control form-control-alternative" placeholder="评论"
name="comment" style="height: 80px;"></textarea>
</div>
</div>
<div class="row" style="margin-top: 5px; margin-bottom: 10px;">
<div class="col-md-12">
<button id="post_comment_send" class="btn btn-icon btn-primary comment-btn pull-right mr-0 w-100" type="submit">
<span class="btn-inner--icon hide-on-comment-editing"><i class="fa fa-send"></i></span>
<span class="btn-inner--text hide-on-comment-editing" style="margin-right: 0;">发送</span>
</button>
</div>
</div>
</form>
{% else %}
<div class="row" style="margin-top: 5px; margin-bottom: 10px;">
<div class="col-md-12">
<a id="post_comment_send" class="btn btn-icon btn-primary comment-btn pull-right mr-0 w-100"
href="https://oier.space/luogulogin/?r={{ blog.domain }}&loc=post/{{ post.slug }}">
登录以发送评论
</a>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock %}