comparison default/input/comment.html @ 51:102356338118

input(comment): new macro comment_or_login: this macro allow to comment if a session is started, else redirect to login/registration page
author Goffi <goffi@goffi.org>
date Fri, 27 Oct 2017 18:52:34 +0200
parents eb9a42fca6c8
children
comparison
equal deleted inserted replaced
50:d8729eb9edb5 51:102356338118
17 {{ head(service, node) }} 17 {{ head(service, node) }}
18 {{ field.textarea("body", placeholder=_("Your comment")) }} 18 {{ field.textarea("body", placeholder=_("Your comment")) }}
19 {{ submit() }} 19 {{ submit() }}
20 {% endcall %} 20 {% endcall %}
21 {% endmacro %} 21 {% endmacro %}
22
23 {% macro comment_or_login(service, node, action='') %}
24 {# show comment form a a message asking to log in
25 login is checked using profile #}
26 {% if profile %}
27 {{ comment(service, node, action) }}
28 {% else %}
29 <div class="log_request">
30 <p class="not_logged">{% trans %}You are not logged. You need to log in to comment.{% endtrans %}</p>
31 {% if login_url is defined %}
32 <p class="log_in_url">
33 {% trans link_start=('<a href="',login_url,'">')|join|safe, link_end='</a>'|safe %}
34 To log in {{link_start}}follow this link{{link_end}}
35 {% endtrans %}
36 </p>
37 {% endif %}
38 </div>
39 {% endif %}
40 {% endmacro %}