8000 Issue #10 solved. · moktadirul-raju/DjangoBlog@88cb752 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88cb752

Browse files
committed
Issue #10 solved.
1 parent 94b4638 commit 88cb752

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed
Binary file not shown.

blog/context_processors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from blog.models import Post
22

3-
#Popularing dictionary for all_posts, tags, categories, post years
3+
#Populating dictionary for all_posts, tags, categories, post years
44
def post_widget(request):
55
all_posts = Post.objects.order_by('published_date')
66
years = []

db.sqlite3

0 Bytes
Binary file not shown.

templates/blog/base.html

+11-6
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,17 @@ <h2>Tags</h2>
144144
showCount: false,
145145
});
146146

147-
// $("#reply-form").hide();
148-
//
149-
// $("#reply").on("click", function(){
150-
// $("#reply-form").show();
151-
// $("#reply").hide();
152-
// });
147+
$(".reply-form").hide();
148+
149+
$(".reply").on("click", function(e){
150+
151+
var target = $( e.target );
152+
153+
$(target).siblings(".reply-form").show();
154+
$(target).hide();
155+
156+
157+
});
153158

154159

155160

templates/blog/single.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ <h2 style="font-size:20px">{{reply.author.user}}</h2>
128128

129129

130130
{% else %}
131-
<button id="reply" type="button" class="btn">Reply</button>
132-
<form id="reply-form" action="{% url 'blog:submit_reply'%}" method="POST">
131+
<button type="button" class="btn reply">Reply</button>
132+
<form class="reply-form" action="{% url 'blog:submit_reply'%}" method="POST">
133133
{% csrf_token %}
134134

135135
<div class="form-group">

0 commit comments

Comments
 (0)
0