# HG changeset patch # User Goffi # Date 1509123154 -7200 # Node ID 1023563381187644198d15ad1c29830679579e8e # Parent d8729eb9edb5d2b326b2a38ce375023a6d5adbdd input(comment): new macro comment_or_login: this macro allow to comment if a session is started, else redirect to login/registration page diff -r d8729eb9edb5 -r 102356338118 default/input/comment.html --- a/default/input/comment.html Fri Oct 27 18:51:53 2017 +0200 +++ b/default/input/comment.html Fri Oct 27 18:52:34 2017 +0200 @@ -19,3 +19,22 @@ {{ submit() }} {% endcall %} {% endmacro %} + +{% macro comment_or_login(service, node, action='') %} + {# show comment form a a message asking to log in + login is checked using profile #} + {% if profile %} + {{ comment(service, node, action) }} + {% else %} +
+

{% trans %}You are not logged. You need to log in to comment.{% endtrans %}

+ {% if login_url is defined %} + + {% endif %} +
+ {% endif %} +{% endmacro %}