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

View File

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