2
2
{% load crispy_forms_tags %}
3
3
{% block content %}
4
4
5
- < article class ="media content-section ">
5
+ < article class ="media content-section " >
6
+
6
7
< img crossorigin ="anonymous " class ="rounded-circle article-img " src ="{{object.author.profile.image.url}} ">
8
+
7
9
< div class ="media-body ">
8
10
< div class ="article-metadata ">
9
11
< a class ="mr-2 " href ="{% url 'user-posts' object.author.username %} "> {{ object.author }}</ a >
10
12
< small class ="text-muted "> {{ post.date_posted|date:"F d, Y" }}</ small >
13
+ < a href ="{% url 'blog-home' %} " class ="btn btn-secondary mb-5 "
14
+ style ="position:absolute;right:0;box-shadow: -2px 10px 12px rgba(0, 0, 0,1); " id ="back "> Back</ a >
11
15
{% if object.author == user %}
12
16
< div >
13
- < a class ="btn btn-secondary btn-sm mt-1 mb-1 " href ="{% url 'post-update' object.id %} "> Update</ a >
14
- < a class ="btn btn-danger btn-sm mt-1 mb-1 " href ="{% url 'post-delete' object.id %} "> Delete</ a >
17
+ < a class ="btn btn-secondary btn-sm mt-1 mb-1 " href ="{% url 'post-update' object.id %} "> Update</ a >
18
+ < a class ="btn btn-danger btn-sm mt-1 mb-1 " href ="{% url 'post-delete' object.id %} "> Delete</ a >
15
19
</ div >
16
20
{% endif %}
17
21
</ div >
22
+
18
23
< h2 class ="article-title " > {{object.title }}</ h2 >
19
24
{% if object.image %}
20
25
< img class ="post-img " src ="{{object.image.url}} ">
@@ -40,11 +45,11 @@ <h2 class="article-title" >{{object.title }}</h2>
40
45
41
46
{% endif %}
42
47
</ ul >
43
-
48
+
44
49
< br > < br >
45
- < a href ="{% url 'blog-home' %} " class ="btn btn-secondary mb-5 "> Back</ a >
46
50
47
- < h5 > Comments</ h5 > < br >
51
+ < hr >
52
+ < small > {{object.total_comment}} Comments</ small > < br >
48
53
< br >
49
54
< div >
50
55
{%for comment in post.comment_set.all %}
@@ -53,8 +58,8 @@ <h5>Comments</h5><br>
53
58
< p > {{comment.comment}}</ p > < hr >
54
59
{%endfor%}
55
60
</ div >
56
- < br >
57
- < div class ="content-section ">
61
+
62
+ < div class ="content-section " >
58
63
{%if user.is_authenticated%}
59
64
< form method ="POST ">
60
65
{%csrf_token%}
@@ -63,15 +68,18 @@ <h5>Comments</h5><br>
63
68
{{form|crispy}}
64
69
</ fieldset >
65
70
< div class ="form-group ">
66
- < button class ="btn btn-outline-info " type ="submit "> Post</ button >
71
+ < button class ="btn btn-outline-danger " type ="submit "> Post</ button >
67
72
</ div >
68
73
</ form >
69
74
{%else %}
70
75
Log In to comment
71
- </ div >
72
- {%endif%}
73
- </ div >
76
+
77
+ {%endif%}
78
+ </ div >
79
+
80
+
74
81
75
82
</ article >
76
83
84
+
77
85
{% endblock content %}
0 commit comments