Skip to content

Commit e4a1e03

Browse files
author
yangxueguang
committed
集成评论模板
1 parent c9d1d02 commit e4a1e03

File tree

9 files changed

+670
-355
lines changed

9 files changed

+670
-355
lines changed

blog/context_processors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ def sidebar(request):
66
category_list = Category.objects.filter(article__status='p').annotate(num_articles=Count('article')).filter(
77
num_articles__gt=0)
88
recent_articles = Article.objects.filter(status='p')[:5]
9-
9+
dates = Article.objects.datetimes('created_time', 'month', order='DESC')
1010
return {
1111
'category_list': category_list,
1212
'recent_articles': recent_articles,
13+
'dates': dates,
1314
}

blog/static/blog/css/comment.css

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#comment-form {
2+
margin: 50px 0 60px 0;
3+
padding: 0 30px;
4+
}
5+
6+
#comment-form textarea {
7+
width: 100%;
8+
height: 120px;
9+
font-size: 15px;
10+
margin-bottom: 10px;
11+
}
12+
13+
#comment-form input {
14+
background-color: #5bbf5a;
15+
border: none;
16+
padding: 5px 20px;
17+
color: #fff;
18+
float: right;
19+
}
20+
21+
.comment-panel {
22+
margin: 0 0 30px 70px;
23+
padding: 0 30px;
24+
font-size: 14px;
25+
position: relative;
26+
}
27+
28+
.comment-panel img {
29+
width: 60px;
30+
height: 60px;
31+
border-radius: 50%;
32+
margin-left: -70px;
33+
float: left;
34+
35+
}
36+
37+
.comment-panel .comment-content {
38+
margin: 20px 0;
39+
font-size: 1em;
40+
}
41+
42+
.comment-panel a {
43+
text-decoration: none;
44+
}
45+
46+
.comment-panel i {
47+
margin-right: 20px;
48+
text-decoration: none;
49+
}
50+
51+
.comment-panel time {
52+
float: right;
53+
}
54+
55+
.inner-panel {
56+
margin: 30px 0 30px 60px;
57+
display: none;
58+
}
59+
60+
.inner-panel img {
61+
height: 50px;
62+
width: 50px;
63+
margin-left: -60px;
64+
65+
}
66+
67+
.inner-panel a {
68+
float: right;
69+
}
70+
71+
.comment-panel form {
72+
margin: 20px 0 60px 0;
73+
display: none;
74+
}
75+
76+
.comment-panel textarea {
77+
height: 32px;
78+
width: 100%;
79+
font-size: 16px;
80+
margin-bottom: 15px;
81+
}
82+
83+
.comment-panel input[type='submit'] {
84+
background-color: #5bbf5a;
85+
border: none;
86+
padding: 5px 20px;
87+
color: #fff;
88+
float: right;
89+
}
90+
91+
.comment-panel input[type='button'] {
92+
background-color: #ccc;
93+
border: none;
94+
padding: 5px 20px;
95+
color: #fff;
96+
float: right;
97+
margin-left: 10px;
98+
}

0 commit comments

Comments
 (0)