File tree 4 files changed +21
-7
lines changed
4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 5
5
<ul >
6
6
<li > <strong > Project Name:</strong > Django Blog </li >
7
7
<li > <strong > Description:</strong > Simple blog app using Django</li >
8
- <li > <strong > Version:</strong > v1.0</li >
8
+ <li > <strong > Version:</strong > v1.0.1 </li >
9
9
<li > <strong > Author:</strong > xHacker404 </li >
10
10
<li > <strong > Demo:</strong > <a href =" http://xhacker404.pythonanywhere.com/ " target =" _self " >DjangoBlog </a ></li >
11
11
</ul >
Original file line number Diff line number Diff line change @@ -149,9 +149,11 @@ <h2>Tags</h2>
149
149
$ ( ".reply" ) . on ( "click" , function ( e ) {
150
150
151
151
var target = $ ( e . target ) ;
152
-
153
152
$ ( target ) . siblings ( ".reply-form" ) . show ( ) ;
154
- $ ( target ) . hide ( ) ;
153
+ if ( target . value ( ) == "Reply" ) {
154
+ $ ( target ) . hide ( ) ;
155
+ }
156
+
155
157
156
158
157
159
} ) ;
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ <h2 style="font-size: 20px">{{comment.author.user}}</h2>
102
102
< h2 style ="font-size:20px "> {{reply.author.user}}</ h2 >
103
103
< p > {{ reply.title}} </ p >
104
104
{% if forloop.last %}
105
+ {% if user.is_authenticated %}
105
106
< form action ="{% url 'blog:submit_reply'%} " method ="POST ">
106
107
{% csrf_token %}
107
108
@@ -113,12 +114,23 @@ <h2 style="font-size:20px">{{reply.author.user}}</h2>
113
114
< textarea class ="form-control " id ="comment-box " rows ="3 " name ="reply_content "> </ textarea >
114
115
115
116
</ div >
116
- {% if user.is_authenticated %}
117
117
< button type ="submit " class ="btn btn-primary "> Reply</ button >
118
- {% else %} <!-- have to work here -->
119
- < button type ="submit " class ="btn btn-primary " onclick ="login_alert() "> Reply</ button >
120
- {% endif %}
121
118
</ form >
119
+ {% else %}
120
+ < form action ="# " method ="POST ">
121
+ {% csrf_token %}
122
+
123
+ < div class ="form-group ">
124
+
125
+ < input type ="text " name ='reply_title '>
126
+ < textarea class ="form-control " id ="comment-box " rows ="3 " name ="reply_content "> </ textarea >
127
+
128
+ </ div >
129
+ < button type ="submit " class ="btn btn-primary " onclick ="login_alert() "> Reply</ button >
130
+
612B
</ form >
131
+
132
+ {% endif %}
133
+
122
134
{% endif %}
123
135
</ div >
124
136
You can’t perform that action at this time.
0 commit comments