Skip to content

Commit

Permalink
Added option to translate Sidebar Recent comment entries.
Browse files Browse the repository at this point in the history
Added "No comments" message to sidebar when there are no comments to be
shown on sidebar.
  • Loading branch information
mmartin committed Jan 3, 2011
1 parent 1c55299 commit 4b3ccb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ l_search = "Search"
l_search2 = "No matches"
# new in version 10
l_recent_comments = "Recent comments"
l_recent_comments_list = "%(author)s on %(post)s"


# import user settings
Expand Down Expand Up @@ -792,13 +793,15 @@ def renderHtml(entries, path, catelist, arclist, admin, page):
print "<h2>%s</h2>" % l_recent_comments
comlist = getCommentList()
if len(comlist) == 0:
"No comments"
print l_no_comments
else:
print "<ul>"
for com in comlist:
print "<li>%s on <a href=\"%s/%s#comment-%d\">%s</a>"\
% (com["authorlink"], baseurl,
quote_plus(com["file"][:-4]), com["num"], com["subject"])
link = "<a href=\"%s/%s#comment-%d\">%s</a>" % (baseurl,
quote_plus(com["file"][:-4]), com["num"], com["subject"])
line
print "<li>"
print l_recent_comments_list % {"author": com["authorlink"], "post": link}
print "</li>"
print "</ul>"

Expand Down
4 changes: 4 additions & 0 deletions kukkaisvoima_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@
# new in version 8
l_search = "Search"
l_search2 = "No matches"
# new in version 10
l_recent_comments = "Recent comments"
l_recent_comments_list = "%(author)s on %(post)s"

0 comments on commit 4b3ccb8

Please sign in to comment.