diff --git a/rophako/modules/blog/templates/blog/entry.inc.html b/rophako/modules/blog/templates/blog/entry.inc.html index 0afda7d..6f2dc04 100644 --- a/rophako/modules/blog/templates/blog/entry.inc.html +++ b/rophako/modules/blog/templates/blog/entry.inc.html @@ -81,6 +81,7 @@ {{ include_page("comment.partial_index", thread="blog-"+post["post_id"]|string, subject=post["subject"], + addable=post["comments"], ) | safe }} {% endif %} diff --git a/rophako/modules/comment/__init__.py b/rophako/modules/comment/__init__.py index 99808d2..fffeb2b 100644 --- a/rophako/modules/comment/__init__.py +++ b/rophako/modules/comment/__init__.py @@ -168,8 +168,13 @@ def unsubscribe(): return template("comment/unsubscribed.html") -def partial_index(thread, subject, header=True): - """Partial template for including the index view of a comment thread.""" +def partial_index(thread, subject, header=True, addable=True): + """Partial template for including the index view of a comment thread. + + * thread: unique name for the comment thread + * subject: subject name for the comment thread + * header: show the Comments h1 header + * addable: boolean, can new comments be added to the thread""" comments = Comment.get_comments(thread) @@ -199,6 +204,7 @@ def partial_index(thread, subject, header=True): g.info["header"] = header g.info["thread"] = thread g.info["subject"] = subject + g.info["commenting_disabled"] = not addable g.info["url"] = request.url g.info["comments"] = sorted_comments g.info["photo_url"] = Config.photo.root_public diff --git a/rophako/modules/comment/templates/comment/form.inc.html b/rophako/modules/comment/templates/comment/form.inc.html index d6c97f8..5ea82fe 100644 --- a/rophako/modules/comment/templates/comment/form.inc.html +++ b/rophako/modules/comment/templates/comment/form.inc.html @@ -1,66 +1,70 @@ {# Common template for leaving a comment/updating the comment preview. #} -
+ + + {% if preview %} + + + {% else %} + + {% endif %} + + +{% endif %}