Mercurial > libervia-templates
annotate default/input/comment.html @ 83:caab77328b1c
js (common): added a method to check if local or session storage is available
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 03 Jan 2018 01:12:16 +0100 |
parents | 102356338118 |
children |
rev | line source |
---|---|
37
eb9a42fca6c8
input/form: added csrf_token hidden field if it is defined, and import form with context to get this variable
Goffi <goffi@goffi.org>
parents:
28
diff
changeset
|
1 {% import 'input/form.html' as form with context %} |
28
4bf00291b895
input/comment: use new textarea field
Goffi <goffi@goffi.org>
parents:
20
diff
changeset
|
2 {% import 'input/field.html' as field %} |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
3 |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
4 {% macro head(service, node) %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
5 {# include data needed to identify the node to use for commenting #} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
6 <input type="hidden" name="type" value="comment"> |
7
f1c773126f23
input/comments: comments input macros, first draft
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 <input type="hidden" name="service" value="{{service}}"> |
f1c773126f23
input/comments: comments input macros, first draft
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 <input type="hidden" name="node" value="{{node}}"> |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
9 {% endmacro %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
10 |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
11 {% macro submit() %} |
20 | 12 <input type="submit" value="{{_("Send")}}"> |
7
f1c773126f23
input/comments: comments input macros, first draft
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 {% endmacro %} |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
14 |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
15 {% macro comment(service, node, action='') %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
16 {% call form.form(action=action) %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
17 {{ head(service, node) }} |
28
4bf00291b895
input/comment: use new textarea field
Goffi <goffi@goffi.org>
parents:
20
diff
changeset
|
18 {{ field.textarea("body", placeholder=_("Your comment")) }} |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
19 {{ submit() }} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
20 {% endcall %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
7
diff
changeset
|
21 {% endmacro %} |
51
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
22 |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
23 {% macro comment_or_login(service, node, action='') %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
24 {# show comment form a a message asking to log in |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
25 login is checked using profile #} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
26 {% if profile %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
27 {{ comment(service, node, action) }} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
28 {% else %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
29 <div class="log_request"> |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
30 <p class="not_logged">{% trans %}You are not logged. You need to log in to comment.{% endtrans %}</p> |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
31 {% if login_url is defined %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
32 <p class="log_in_url"> |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
33 {% trans link_start=('<a href="',login_url,'">')|join|safe, link_end='</a>'|safe %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
34 To log in {{link_start}}follow this link{{link_end}} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
35 {% endtrans %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
36 </p> |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
37 {% endif %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
38 </div> |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
39 {% endif %} |
102356338118
input(comment): new macro comment_or_login:
Goffi <goffi@goffi.org>
parents:
37
diff
changeset
|
40 {% endmacro %} |