Rewrite session Part 3

This commit is contained in:
Stefan Ritter 2009-05-18 21:08:37 +02:00
parent b1fc650b1b
commit 03a1d02ee3

View File

@ -285,10 +285,11 @@ else:
print ' </div>'
print ''
print ' <div class="entries">'
print ''
# Staticpage
if static_display != "":
content = open(staticpages_dir + static_display, "r")
print ' <div class="entry">'
print ' <div class="entry_title">' + re.sub('\d+?-', '', static_display) + '</div>'
print ' <div class="entry_content">'
print ' <p>'
@ -302,7 +303,6 @@ else:
print ' <div class="entry_border_right"></div>'
print ' <div class="entry_border_top"></div>'
print ' <div class="entry_border_bottom"></div>'
print ' </div>'
content.close()
# Entry
else:
@ -318,7 +318,6 @@ else:
if post_display == title or not post_display:
if allentries_display == "1" or entry_counter < entries_per_page:
content = open(entry, "r")
print ' <div class="entry">'
if permalinks:
print ' <div class="entry_title"><a href="?p=' + title + '" class="entry_title">' + title + '</a></div>'
else:
@ -333,8 +332,6 @@ else:
print ' <div class="entry_border_right"></div>'
print ' <div class="entry_border_top"></div>'
print ' <div class="entry_border_bottom"></div>'
print ' </div>'
print ''
# Comments...
# ... are shown when post_display and comments_file isn't false
@ -343,6 +340,9 @@ else:
if comments_file:
comments_file = glob.glob(entries_dir + title + '.comments')
comments_content = open(comments_file[0], "r")
print ''
print ' </div>'
print ''
print ' <div class="comments">'
for line in comments_content:
if line.split(".", 1)[0] == "-":
@ -354,7 +354,6 @@ else:
print ' <div class="comments_content">'
print ' ' + line.strip() + '<br />'
print ' </div>'
print ' </div>'
print ''
comments_content.close()
@ -370,6 +369,7 @@ else:
print ' <br /><label for="cquiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input type="text" id="cquiz" name="cquiz" />'
print ' <br /><input type="submit" id="submit" value="post comment" />'
print ' </form>'
print ''
if comments == "True":
comments_file = glob.glob(entries_dir + title + '.comments')
@ -377,6 +377,7 @@ else:
print ' <div class="entry_comments">'
print ' <a href="?p=' + title + '" class="entry_comments">no comments</a>'
print ' </div>'
print ''
elif comments_file and not post_display:
comments_content = open(comments_file[0], "r")
comments_counter = 0
@ -385,6 +386,7 @@ else:
print ' <div class="entry_comments">'
print ' <a href="?p=' + title + '" class="entry_comments">comments (' + str(comments_counter) + ')</a>'
print ' </div>'
print ''
comments_content.close()
content.close()
@ -393,6 +395,7 @@ else:
if not month_display and not post_display and not allentries_display and entry_counter == entries_per_page: # Display pagelist
print ' <div class="entry"><a href=?a=1>View all entries...</a></div>'
print ' </div>'
print ''
print ' </body>'
print '</html>'