Comments:

* Added a first form with a name and a text field
* Some little fixes
This commit is contained in:
Stefan Ritter 2009-03-08 18:07:16 +01:00
parent e111b192fb
commit 5d2010c6e1
2 changed files with 27 additions and 5 deletions

View File

@ -143,20 +143,28 @@ else: # Show regular entry
# Comments are shown when post_display and comments_file # Comments are shown when post_display and comments_file
comments_file = glob.glob(entries_dir + title + '.comments') comments_file = glob.glob(entries_dir + title + '.comments')
if comments_file and post_display: if comments_file and post_display:
print ' <br><hr>' print ' <br /><hr>'
comments_file = glob.glob(entries_dir + title + '.comments') comments_file = glob.glob(entries_dir + title + '.comments')
comments_content = open(comments_file[0], "r") comments_content = open(comments_file[0], "r")
for line in comments_content: for line in comments_content:
if line.split(".", 1)[0] == "-": if line.split(".", 1)[0] == "-":
print ' <br />' print ' <br />'
print ' <i>' + line.split(".", 1)[1] + '</i><small> wrote at ' print ' <b><i>' + line.split(".", 1)[1].strip() + '</i><small> wrote at '
elif line.split(".", 1)[0] == "+": elif line.split(".", 1)[0] == "+":
print ' ' + line.split(".", 1)[1] + ':</small><br />' print ' ' + line.split(".", 1)[1].strip() + ':</small></b><br />'
else: else:
line = line.split(".", 1)[1] line = line.split(".", 1)[1]
print ' &nbsp;&nbsp;' + line.strip() + '<br />' print ' &nbsp;&nbsp;' + line.strip() + '<br />'
comments_content.close() comments_content.close()
# Form for adding comments
print ' <br /><br /><br />'
print ' <form action=# method=get>'
print ' <label for="name">name:</label><input type="text" id="name" name="name">'
print ' <br /><label for="text">text:</label><textarea rows="5" id="text" name="text"></textarea>'
print ' <br /><input type="submit" id="submit" value="post comment">'
print ' </form>'
if comments == "True": if comments == "True":
comments_file = glob.glob(entries_dir + title + '.comments') comments_file = glob.glob(entries_dir + title + '.comments')
if not comments_file and not post_display: if not comments_file and not post_display:

View File

@ -84,4 +84,18 @@ a.comment:link, a.comment:hover, a.comment:active, a.comment:visited {
font-size: 10px; font-size: 10px;
} }
input, textarea {
font-family: Verdana;
font-size: 10px;
display: block;
width: 300px;
background: #333;
color: #FFF;
border: thin dotted;
}
input#submit {
width: 120px;
}
# vim: set tw=0 ts=4: # vim: set tw=0 ts=4: