# HG changeset patch # User Goffi # Date 1613824751 -3600 # Node ID 877f01720036f8593b2a6fd541dc5a0294191627 # Parent 60979d67eae7aab91a787ba88990c270b6a9e081 bulma (lists): creation, invitations, item deletion: - add interface to create lists from templates - show list specific icon when available in lists discovery - owned lists can be deleted from lists discovery - lists can now be created from templates - when edition is allowed, a delete button let now delete a list item from single item view - new button to launch invitation manager from list overview diff -r 60979d67eae7 -r 877f01720036 sat_templates/templates/bulma/list/create.html --- a/sat_templates/templates/bulma/list/create.html Sat Feb 20 13:37:25 2021 +0100 +++ b/sat_templates/templates/bulma/list/create.html Sat Feb 20 13:39:11 2021 +0100 @@ -1,37 +1,20 @@ {% extends 'base/base.html' %} {% import 'components/block.html' as block with context %} -{% import 'components/images.html' as images with context %} -{% import 'components/avatar.html' as avatar with context %} -{% import 'input/form.html' as form with context %} -{% import 'input/field.html' as field with context %} {% block body %} -{{ icon_defs('clipboard') }} +{{ icon_defs(*icons_names) }}
-
{% trans %} - Please select the list to use. + Please select the type of list that you want to create {% endtrans %}
- {% if lists_directory is defined %} -
- {{block.disco_icon_grid(lists_directory, 'clipboard')}} -
- {% endif %} -
-
- {% call form.form(class="form--single") %} - {{ field.text("jid", _("list jid"), required=true)}} - {{ field.submit(_("Access")) }} - {% endcall %} +
+ {% for tpl in lists_templates %} + {{ block.icon_item(tpl.icon, tpl.name, tpl.url) }} + {% endfor %} +
{% endblock body %} diff -r 60979d67eae7 -r 877f01720036 sat_templates/templates/bulma/list/create_from_template.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/list/create_from_template.html Sat Feb 20 13:39:11 2021 +0100 @@ -0,0 +1,34 @@ +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block body %} +{{ icon_defs(list_template.icon) }} +
+
+
+ {% trans list_type=list_template.name %} + You're about to create a new list ({{list_type}}). + {% endtrans %} +
+
+ {% call form.form(class="form--paper form__panel--vertical") %} + {{ field.text("name", _("name of the list"), required=true) }} +
+ +
+
+ {%- trans notrimmed -%} + Private lists are only visible by yourself (and people you invite later). + Public lists can be accessed by anybody. + {%- endtrans -%} +
+
+ {{ field.choices("access", (("private", _("private")), ("public", _("public"))), checked="private") }} +
+ {{ field.submit(_("Create list")) }} + {% endcall %} +
+{% endblock body %} diff -r 60979d67eae7 -r 877f01720036 sat_templates/templates/bulma/list/discover.html --- a/sat_templates/templates/bulma/list/discover.html Sat Feb 20 13:37:25 2021 +0100 +++ b/sat_templates/templates/bulma/list/discover.html Sat Feb 20 13:39:11 2021 +0100 @@ -7,7 +7,17 @@ {% block body %} {{ icon_defs('clipboard') }} +{% if icons_names is defined %} + {{ icon_defs(*icons_names) }} +{% endif %}
+
{% trans %} @@ -17,7 +27,18 @@
{% if lists_directory is defined %}
- {{block.disco_icon_grid(lists_directory, 'clipboard')}} + +
+ {% for list_data in lists_directory %} + {{ block.icon_item( + list_data.icon_name or "clipboard", + list_data.name, + list_data.url, + delete_icon=list_data.creator, + data=list_data) + }} + {% endfor %} +
{% endif %}
diff -r 60979d67eae7 -r 877f01720036 sat_templates/templates/bulma/list/item.html --- a/sat_templates/templates/bulma/list/item.html Sat Feb 20 13:37:25 2021 +0100 +++ b/sat_templates/templates/bulma/list/item.html Sat Feb 20 13:39:11 2021 +0100 @@ -22,7 +22,7 @@ {% endblock confirm_message %} {% block body %} -{{ icon_defs('pencil') }} +{{ icon_defs('pencil', 'trash-empty') }}
@@ -39,6 +39,15 @@ {{ item.widget_value['body'] }}
+ {% if comments is defined %} {{ blog.show_items(comments['items']|reverse, expanded=true) }} {% endif %} @@ -48,7 +57,7 @@
{% endif %}
- {% if url_list_item_edit is defined %} + {% if can_modify %}
{{ icon('pencil', cls='icon is-64x64') }} diff -r 60979d67eae7 -r 877f01720036 sat_templates/templates/bulma/list/overview.html --- a/sat_templates/templates/bulma/list/overview.html Sat Feb 20 13:37:25 2021 +0100 +++ b/sat_templates/templates/bulma/list/overview.html Sat Feb 20 13:39:11 2021 +0100 @@ -13,6 +13,17 @@
{{ component.action_button(url_list_new) }}
+ {% if owner %} +
+ {{ + component.action_button( + "#", + label=_("manage invitations"), + icon="group", + id="button_manage") + }} +
+ {% endif %}
diff -r 60979d67eae7 -r 877f01720036 sat_templates/templates/bulma/static/styles.css --- a/sat_templates/templates/bulma/static/styles.css Sat Feb 20 13:37:25 2021 +0100 +++ b/sat_templates/templates/bulma/static/styles.css Sat Feb 20 13:39:11 2021 +0100 @@ -22,6 +22,10 @@ white-space: pre-wrap; } +.has-whitespace-pre-line { + white-space: pre-line; +} + .is-avatar { height: 64px; width: 64px;