Don't show comment form when comments are disabled

This commit is contained in:
Stefan Ritter 2009-10-31 00:33:19 +01:00
parent a8f13c725e
commit 50f6f862f6
1 changed files with 17 additions and 15 deletions

View File

@ -485,21 +485,23 @@ else:
print ' <div class="comments">' print ' <div class="comments">'
# Form for adding comments # Form for adding comments
random_int_a = random.randint(1,9) if comments == "True":
random_int_b = random.randint(1,9) random_int_a = random.randint(1,9)
cquizv = random_int_a + random_int_b random_int_b = random.randint(1,9)
print ' <div class="submit_comment">' cquizv = random_int_a + random_int_b
print ' <form action="" method="post">' print ' <div class="submit_comment">'
print ' <input type="hidden" name="ctitle" value="' + title + '" />' print ' <form action="" method="post">'
print ' <input type="hidden" name="cquizv" value="' + str(cquizv) + '" />' print ' <input type="hidden" name="ctitle" value="' + title + '" />'
print ' <label class="submit_comment_name">name:</label><input class="submit_comment_name_input" type="text" id="cname" name="cname" />' print ' <input type="hidden" name="cquizv" value="' + str(cquizv) + '" />'
print ' <br /><label class="submit_comment_text">text:</label><textarea class="submit_comment_textarea" id="ctext" name="ctext"></textarea>' print ' <label class="submit_comment_name">name:</label><input class="submit_comment_name_input" type="text" id="cname" name="cname" />'
print ' <br /><label class="submit_comment_quiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input class="submit_comment_quiz_input" type="text" id="cquiz" name="cquiz" />' print ' <br /><label class="submit_comment_text">text:</label><textarea class="submit_comment_textarea" id="ctext" name="ctext"></textarea>'
print ' <br /><input class="submit_comment_button" type="submit" id="submit" value="post comment" />' print ' <br /><label class="submit_comment_quiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input class="submit_comment_quiz_input" type="text" id="cquiz" name="cquiz" />'
print ' </form>' print ' <br /><input class="submit_comment_button" type="submit" id="submit" value="post comment" />'
print ' </div>' print ' </form>'
print ' <div class="submit_border_bottom"></div>' print ' </div>'
print '' else:
print ' <div class="submit_border_bottom"></div>'
print ''
if comments == "True": if comments == "True":
comments_file = glob.glob(entries_dir + title + '.comments') comments_file = glob.glob(entries_dir + title + '.comments')