Mercurial > libervia-templates
comparison sat_templates/templates/bulma/input/field.html @ 413:0190a0d32909 default tip
Forum: Major redesign of forums:
Forums have been redesigned. They follow the new general design with 2 or 3 panels,
allowing to have directly a forum if one is found/set up, and a panel on the left to
search/discover other ones.
Categories have been rewritten to be usable with pubsub relationships, a XEP-0277 type
node is used for topics, and each item has a comments node for the threads.
The thread view is set in `forum/show_messages.html` template. It has a header with a
search box and a button to (un)subscribe.
Items are displayed with the same macros as for the blog items.
Below a room is set for editor, tags and attachments.
rel 463
| author | Goffi <goffi@goffi.org> |
|---|---|
| date | Fri, 05 Sep 2025 21:54:09 +0200 |
| parents | 58c4c1664421 |
| children |
comparison
equal
deleted
inserted
replaced
| 412:c1d33d7e4b96 | 413:0190a0d32909 |
|---|---|
| 1 {# macros to create form fields #} | 1 {# macros to create form fields #} |
| 2 | 2 |
| 3 {% macro field(type, name, label="", value=none, class="", control_class="", help="", required=false, icon_left=none, icon_right=none, in_group=false, attrs=none) %} | 3 {% macro field(type, name, label="", value=none, class="", control_class="", help="", required=false, icon_left=none, icon_right=none, in_group=false, attrs=none, delete_button=false) %} |
| 4 {# generic field | 4 {# generic field |
| 5 "class" keyword can be used to add classes | 5 "class" keyword can be used to add classes |
| 6 additional kwargs will be passed as attributes #} | 6 additional kwargs will be passed as attributes #} |
| 7 | 7 |
| 8 {% if not in_group %} | 8 {% if not in_group %} |
| 10 {% endif %} | 10 {% endif %} |
| 11 {% set cur_id = name|next_gidx %} | 11 {% set cur_id = name|next_gidx %} |
| 12 {% if label %} | 12 {% if label %} |
| 13 <label for="{{cur_id}}" class="label">{{label}}</label> | 13 <label for="{{cur_id}}" class="label">{{label}}</label> |
| 14 {% endif %} | 14 {% endif %} |
| 15 <div class="control{% if icon_left %} has-icons-left{% endif %}{% if icon_right %} has-icons-right{% endif %} {{control_class}}"> | 15 <div class="control{% if icon_left %} has-icons-left{% endif %}{% if icon_right or delete_button %} has-icons-right{% endif %} {{control_class}}"> |
| 16 <input id="{{cur_id}}" class="input" type="{{type}}" name="{{name}}" {{"required" if required}}{{{'value': value}|xmlattr}}{{(attrs or {})|xmlattr}}> | 16 <input id="{{cur_id}}" class="input" type="{{type}}" name="{{name}}" {{"required" if required}}{{{'value': value}|xmlattr}}{{(attrs or {})|xmlattr}}> |
| 17 {% if icon_left %} | 17 {% if icon_left %} |
| 18 <span class="icon is-left"> | 18 <span class="icon is-left"> |
| 19 {# we use <i> with font from CSS instead of SVG, because using directly SVG doesn't play way with Bulma's control #} | 19 {# we use <i> with font from CSS instead of SVG, because using directly SVG doesn't play way with Bulma's control #} |
| 20 <i class="icon-{{icon_left}}"></i> | 20 <i class="{{icon_left}}"></i> |
| 21 </span> | 21 </span> |
| 22 {% endif %} | 22 {% endif %} |
| 23 {% if icon_right %} | 23 {% if icon_right %} |
| 24 <span class="icon is-right"> | 24 <span class="icon is-right"> |
| 25 <i class="icon-{{icon_right}}"></i> | 25 <i class="{{icon_right}}"></i> |
| 26 </span> | |
| 27 {% endif %} | |
| 28 {% if delete_button %} | |
| 29 <span class="icon is-right action_delete"> | |
| 30 <a role="button" class="delete is-small" aria-label="Delete"></a> | |
| 26 </span> | 31 </span> |
| 27 {% endif %} | 32 {% endif %} |
| 28 </div> | 33 </div> |
| 29 {% if help %} | 34 {% if help %} |
| 30 <p class="help">{{help}}</p> | 35 <p class="help">{{help}}</p> |
| 75 | 80 |
| 76 {% macro text(name, label="", value=none, class="", control_class="", placeholder=none, help="", required=false, pattern=none, title=none, autocomplete=none, icon_left=none, icon_right=none, in_group=false) %} | 81 {% macro text(name, label="", value=none, class="", control_class="", placeholder=none, help="", required=false, pattern=none, title=none, autocomplete=none, icon_left=none, icon_right=none, in_group=false) %} |
| 77 {{ field("text", name=name, label=label, value=value, class=class, control_class=control_class, help=help, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'placeholder': placeholder, 'pattern': pattern, 'title': title, 'autocomplete': autocomplete}, in_group=in_group, caller=caller) }} | 82 {{ field("text", name=name, label=label, value=value, class=class, control_class=control_class, help=help, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'placeholder': placeholder, 'pattern': pattern, 'title': title, 'autocomplete': autocomplete}, in_group=in_group, caller=caller) }} |
| 78 {% endmacro %} | 83 {% endmacro %} |
| 79 | 84 |
| 80 {% macro search(name, label="", value=none, class="", control_class="", placeholder=none, help="", required=false, pattern=none, title=none, autocomplete=none, icon_left=none, icon_right=none, in_group=false) %} | 85 {% macro search(name, label="", value=none, class="", control_class="", placeholder=none, help="", required=false, pattern=none, title=none, autocomplete=none, icon_left=none, icon_right=none, in_group=false, delete_button=false) %} |
| 81 {{ field("search", name=name, label=label, value=value, class=class, control_class=control_class, help=help, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'placeholder': placeholder, 'pattern': pattern, 'title': title, 'autocomplete': autocomplete}, in_group=in_group, caller=caller) }} | 86 {{ field("search", name=name, label=label, value=value, class=class, control_class=control_class, help=help, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'placeholder': placeholder, 'pattern': pattern, 'title': title, 'autocomplete': autocomplete}, in_group=in_group, delete_button=delete_button, caller=caller) }} |
| 82 {% endmacro %} | 87 {% endmacro %} |
| 83 | 88 |
| 84 {% macro password(name, label="", value=none, required=false, minlength=none, icon_left=none, icon_right=none) %} | 89 {% macro password(name, label="", value=none, required=false, minlength=none, icon_left=none, icon_right=none) %} |
| 85 {{ field("password", name=name, label=label, value=value, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'minlength': minlength}) }} | 90 {{ field("password", name=name, label=label, value=value, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'minlength': minlength}) }} |
| 86 {% endmacro %} | 91 {% endmacro %} |
