# HG changeset patch # User Goffi # Date 1589839354 -7200 # Node ID 0e69b5843c2fd6ffae56d06373a884837aeefd8d # Parent 739c3e6999fa9e42a70c3a99bc8c26c37834c2a7 theme: bulma theme first draft: This theme uses the Bulma CSS framework, Brython to handle the menu on touch devices, and Sass to customize Bulma. CSS default fallbacks are disabled as Bulma uses its own naming conventions, and default fallbacks would lead to hard to debug conflicts. `common.js` has been slightly improved to handle custom classed in `tab_select` The theme is not complete yet, but it is functional. diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/_browser/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/_browser/__init__.py Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,7 @@ +from browser import bind, document + + +@bind("#main_menu_burger", "click") +def burger_click(ev): + document["main_menu"].classList.toggle('is-active') + document["main_menu_burger"].classList.toggle('is-active') diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/_browser/browser_meta.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/_browser/browser_meta.json Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,9 @@ +{ + "js": { + "package": { + "dependencies": { + "bulma": "latest" + } + } + } +} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/_browser/bulma_sat.scss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/_browser/bulma_sat.scss Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,6 @@ +@charset "utf-8"; +$primary: #82baff; +$body-background-color: #eaeaea; + +@import "node_modules/bulma/bulma.sass"; + diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/base/base.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/base/base.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,85 @@ + {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #} +{% set embedded = True %} +{% import 'components/common.html' as component with context %} +{{ script.include('common', '') }} {# common.js is, as its name states, a common script, so it's useful to import it here #} + + + + + + {# using SVG directly doesn't always play well with Bulma, so we also use the icon font #} + + + + {% if norobots %} + + {% endif %} + + {% block title %}{{C.APP_NAME}}{% endblock %} + + {% if css_content is defined %} + + {% if css_content_noscript is defined %} + + {% endif %} + {% else %} + {% for css_file in css_files %} + + {% endfor %} + {% if css_files_noscript %} + + {% endif %} + {% endif %} + + {% if links is defined %} + {% for link_data in links %} + + {% endfor %} + {% endif %} + + {% if xmpp_uri is defined %} + + {% endif %} + + {% if dynamic_style is defined %} + {# be extra careful about dynamic style, insure escaping if you use untrusted values ! #} + + {% endif %} + + {{ script.generate_scripts() }} + + {% for script in scripts %} + {{script.content}} + {% endfor %} + + {% block favicon %} + + {% endblock favicon %} + + + {% if atom_url is defined %} + {{ icon_defs('feed') }} + {% endif %} + {% if main_menu %} + {% block main_menu %} + {{ component.menu(main_menu, class="main_menu") }} + {% endblock main_menu %} + {% endif %} +
+ {% block body %} + {% endblock body %} +
+ + diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/blog/articles.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/blog/articles.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,40 @@ +{# blog_page indicate if blog is included in an other page or if it is the main one #} +{% if not embedded %}{% extends 'base/base.html' %}{% set blog_page = True %}{% endif %} +{% set single = items|length == 1 %} +{% set dates_format='relative' if single else 'short' %} +{% import 'components/avatar.html' as avatar with context %} +{% import 'blog/macros.html' as blog with context %} +{% import 'input/navigation.html' as navigation with context %} + +{%- block title scoped -%} + {%- if blog_page -%} + {%- if single -%} + {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} + {%- else -%} + {{C.APP_NAME}} + {# {{- super() -}} + FIXME: super() is failing if blog is embedded (i.e. base/base.html is not its direct parent) + not sure what's the best way to avoid that, so just using C.APP_NAME for now #} + {%- endif -%} + {%- endif -%} +{%- endblock title -%} + +{% block body %} +{% if items %} +
+
+
+ {{ blog.show_items(items, expanded=single) }} +
+
+
+{% else %} +
+
+ {% trans %}No articles found in this blog!{% endtrans %} +
+
+{% endif %} + +{{ navigation.prev_next(_("newer articles"), _("older articles")) }} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/blog/atom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/blog/atom.xml Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,47 @@ + + + {% if title is defined %} + {{title}} + {% elif target_profile is defined %} + {% trans name=target_profile%}{{name}}'s blog{% endtrans %} + {% else %} + {% trans app_name=C.APP_NAME%}{{app_name}} blog{% endtrans %} + {% endif %} + + + + {{xmpp_uri}} + {{updated|date_fmt('iso')}} + {% for item in items %} + + {% if item.title_xhtml %} + {{item.title_xhtml}} + {% else %} + {{item.title|default(item.content|truncate(80, True, '…'), True)}} + {% endif %} + + + {{item.uri}} + {{item.updated|date_fmt('iso')}} + {{item.published|date_fmt('iso')}} + + {{item.author}} + xmpp:{{item.author_jid}} + + {% for tag in item.tags %} + + {% endfor %} + {% if item.content_xhtml %} + +
+ {{item.content_xhtml}} +
+
+ {% else %} + + {{item.content_txt}} + + {% endif %} +
+ {% endfor %} +
diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/blog/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/blog/discover.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,47 @@ +{% extends 'base/base.html' %} +{% import 'components/block.html' as block %} +{% 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('blog') }} + +
+
+
+ {% trans %} + Please select the blog you want to consult + {% endtrans %} +
+
+
+ +
+ +
+ +
+

{% trans %}Or enter the jid of a blog writer{% endtrans %}

+ {% call form.form(class="form--single") %} + {{ field.text("jid", _("blog writer jid"), required=true)}} + {{ field.submit(_("Consult")) }} + {% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/blog/item.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/blog/item.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,67 @@ +{# display a blog item which can be expanded/retracted by clicking on it + + if the locale differs from item language, it will be totally reduced, and will need a click to be displayed + + @variable item(data_object.BlogItem): item to display + @variable identities(data_object.Identities): identities which can be used to display info on item author + @variable dates_format(unicode): format of the date to use (see date_fmt filter) +#} + +{% block item %} + +{% set item_level = (item_level or 0) + 1 %} + +{% if item.language and locale and locale.language != item.language %} + {# we may display items in different language in a specific way #} + {% set other_lang = " other_lang" if expanded else " other_lang state_init" %} +{% endif %} +
+ {% if identities is defined %} + {% if avatar is defined %} +
+ {{ avatar.avatar(item.author_jid) }} +
+ {% endif %} + {% endif %} +
+ {% set title = item.title_xhtml or item.title%} + {% if title %} +

{{title}}

+ {% endif %} +
+

+ {% set published = item.published|date_fmt(fmt=dates_format) %} + {{item.author}} {{published}} + {% if item.tags %} + + {% if tags_http_uri is defined %} + {% for tag in item.tags %} + {{tag}} + {% endfor %} + {% else %} + {% for tag in item.tags %} + {{tag}} + {% endfor %} + {% endif %} + + {% endif %} +

+

+ {{- item.content_xhtml or item.content|urlize or '' -}} +

+ {% for comments_items in item.comments_items_list %} + {% for item in comments_items %} + {% include 'blog/item.html' %} + {% endfor %} + {% if allow_commenting and item_level == 1 %} +
+ {{- textbox.comment(service=comments_items.service, node=comments_items.node) -}} +
+ {% endif %} + {% endfor %} + +
+
+
+ +{% endblock item %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/blog/macros.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/blog/macros.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,17 @@ +{% import 'input/textbox.html' as textbox with context %} + +{% macro show_items(items, comment=False, expanded=false, dates_fmt=none) %} + {# show items and comments items if present after each item, + then post form if allow_commenting is set + @param items(BlogItems): items to show + @param comment(bool): True items are comments + if False, a div with "main_article" class will be added + @param expanded(bool): initial state of items + #} + {% if dates_format is undefined %} + {% set dates_format = dates_fmt or 'short' %} + {% endif %} + {% for item in items %} + {% include 'blog/item.html' %} + {% endfor %} +{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/chat/chat.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/chat/chat.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,20 @@ +{{ script.include('chat') }} +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% block title %}{{ target_jid }} - {{ super() }}{% endblock %} +{% block body %} +
+
+ {% if subject is defined %} +
+ {{- subject|urlize(nofollow=true,target='_blank') -}} +
+ {% endif %} + {% for msg in messages %} + {% include 'chat/message.html' %} + {% endfor %} +
+ +
+{% endblock body %} + +{% block footer %}{% endblock footer %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/chat/message.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/chat/message.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,31 @@ +{% import 'components/avatar.html' as avatar with context %} + +
+ {%- if msg.type != C.MESS_TYPE_INFO %} + {%- set author = identities[msg.from_].nicknames[0] | default(msg.from_) -%} +
+ {{ avatar.avatar(msg.from_, "is-32x32") }} +
+ {% endif -%} +
+
+ {%- if msg.type != C.MESS_TYPE_INFO %} + + {% endif -%} +

+ {{- msg.html or (msg.text|urlize(nofollow=true, target="_blank")) -}} +

+
+
+
diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/chat/select.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/chat/select.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,43 @@ +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% 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 %} + +
+
+
+ {% trans %}Please select the chat room you want to enter{% endtrans %} +
+
+
+ +
+
+ {% for room in rooms %} + + {% endfor %} +
+
+ +
+

{% trans %}Or enter a room address{% endtrans %}

+ {% call form.form(class="form--single") %} + {{ field.text("jid", _("Room address (JID)"), required=true)}} + {{ field.submit(_("Join")) }} + {% endcall %} +
+ +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/components/avatar.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/components/avatar.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,13 @@ +{% macro avatar(jid, class="is-48x48") %} + {%- if identities is defined -%} + {% set identity = identities[jid] %} + {%- if identity.avatar_basename is defined %} +
+ +
+ {% else %} + {% set nick = identity.nicknames[0] if identity.nicknames else jid %} + {{nick|first|upper}} + {%- endif -%} + {%- endif -%} +{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/components/block.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/components/block.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,73 @@ +{% macro separator(label, align='center') %} +{# display a bloc separator + @param label(unicode): label to show + @param align(unicode): one of "left", "center", "right" +#} +
+ {% if align in ('center', 'right') %} +
+ {% endif %} +
+ {{label}} +
+ {% if align in ('center', 'left') %} +
+ {% endif %} +
+{% endmacro %} + +{% macro icon_item(icon_name, label, url, class="") %} + +{% endmacro %} + +{% macro disco_icon_grid(disco_entities, icon_name) %} +{# display discovered entities in a grid + @param disco_entities: entities which mush have a name and url key or attribute + @param icon_name: name of a defined icon +#} +
+ {% for disco_entity in disco_entities %} + {{ icon_item(icon_name, disco_entity.name, disco_entity.url) }} + {% endfor %} +
+{% endmacro %} + +{% macro interests_grid(interests, default_icon_name) %} +{# display list of interests + @param interests: list of interests + @param default_icon_name: name of a defined icon to use when no thumb_url is available +#} + +{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/components/common.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/components/common.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,40 @@ +{% import 'components/menu_labels.html' as ml with context %} +{# we need to use "with context" to disable cache, needed for i18n #} + +{% macro menu(menus, class='') %} + +{% endmacro %} + +{% macro action_button(url, label=_("create"), icon="plus-circled", class="is-primary is-rounded") %} +  {{label}} +{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/components/images.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/components/images.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,15 @@ +{% macro get_icon_client(ident, class='is-64x64') %} + {% if ident.client %} + {% if ident.client.pc %} + {{ icon('desktop', cls='image is-inline-block {}'.format(class)) }} + {% elif ident.client.phone %} + {{ icon('mobile', cls='image is-inline-block {}'.format(class)) }} + {% elif ident.client.web %} + {{ icon('globe', cls='image is-inline-block {}'.format(class)) }} + {% elif ident.client.console %} + {{ icon('terminal', cls='image is-inline-block {}'.format(class)) }} + {% else %} + {{ icon('desktop', cls='image is-inline-block {}'.format(class)) }} + {% endif %} + {% endif %} +{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/components/menu_labels.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/components/menu_labels.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,17 @@ +{# menu labels, map from menu names to labels #} +{% set label = { + 'login': _('Session') if profile else _('Log in'), + 'blog': _('Blog'), + 'forums': _('Forums'), + 'merge-requests': _('Merge requests'), + 'merge-request_new': _('Create new merge request'), + 'tickets': _('Tickets'), + 'tickets_list': _('List tickets'), + 'ticket_new': _('Create new ticket'), + 'chat': _('Chat'), + 'files': _('Files sharing'), + 'events': _('Events'), + 'event_new': _('Create an event'), + 'photos': _('Photos albums'), + 'app': _('Application'), +} %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/event/admin.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/event/admin.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,117 @@ +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} +{% import 'input/textbox.html' as textbox with context %} + +{% block body %} +
+ +

{% trans name=event.name %}{{name}} administration{% endtrans %}

+
+ {% if event.image is defined %} +
+ +
+ {% endif %} + {% if event.description is defined %} +
+

{{event.description}}

+
+ {% endif %} +
+ + + {% include 'event/counter.html' %} + +
+ + +
+ {% if invitees %} + + + + + + + + + + {% for name, data in invitees.items() %} + + + + {% if data.attend == 'no' %} + + {% else %} + + {% endif %} + + {% endfor %} + + + + + + + +
{% trans %}name{% endtrans %}{% trans %}coming?{% endtrans %}{% trans %}guests{% endtrans %}
{{name}}{{data.attend|default('')}} {{data.guests|default(0)}}
{% trans %}total expected{% endtrans %}{{invitees_guests|default('0')}}
+ {% else %} +

{% trans %}No invitee has answered yet{% endtrans %}

+ {% endif %} +
+ + +
+ {% call form.form(class="form--paper form__panel--vertical form__panel--center") %} + {{ textbox.head(event_service, event_node, 'event') }} + {{ field.meta('event_id', event_id) }} + {{ field.textarea("jids", + _("enter here a list of jid (one per line) to invite"), + ) + }} + {{ field.textarea("emails", + _("enter here a list of emails addresses (one per line) to invite"), + ) + }} + {{ field.submit(_("Invite people")) }} + {% endcall %} +
+ +
+ {% call form.form(class="form--paper form__panel--vertical form__panel--center") %} + {{ textbox.head(service, node, 'blog') }} + {{ field.text("title", + _("title"), + class="form__field--big") }} + {{ field.textarea("body", + _("body"), + ) + }} + {{ field.text("language", + _("language"), + class="form__field--tiny") }} + {{ field.checkbox("comments", + _("allow comments"), + checked=true) }} + {{ field.submit(_("send"), class="has-margin-top-1") }} + {% endcall %} +
+ +
+ {% if items is defined %} + {% include 'blog/articles.html' %} + {% endif %} +
+ +
+
+ +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/event/attendance.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/event/attendance.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,24 @@ +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + + +
+
+ {% trans %}Please indicate if you plan to attend the event:{% endtrans %} +
+
+{% call form.form() %} +{{ field.meta("type", "attendance") }} +{{ field.meta("service", event.invitees_service) }} +{{ field.meta("node", event.invitees_node) }} +
+ {{ field.choices("attend", (("yes", _("yes")), ("no", _("no")), ("maybe", _("maybe"))), checked=invitee.attend) }} +
+
+ {{ field.int("guests", label=_("How many people will come (including you)?"), init=invitee.get("guests", 1)) }} +
+
+ {{ field.submit() }} +
+{% endcall %} + diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/event/counter.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/event/counter.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,14 @@ +{% if days_left is defined %} + {% if days_left > 0 %} +
+ {% trans %} + {{days_left}} day left + {% pluralize %} + {{days_left}} days left + {% endtrans %} +
+ {% else %} +
{% trans %}the event is finished{% endtrans %}
+ {% endif %} + +{% endif %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/event/create.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/event/create.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,31 @@ +{# create a new event #} + +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block body %} +
+

+ {% trans %}Create an event{% endtrans %} +

+ {% call form.form(class="form--paper form__panel--vertical") %} + {{ field.text("name", _("name"), required=true) }} + {{ field.text("location", _("location"), required=true) }} + {{ field.textarea("body", + _("description of the event"), + required=true, + ) }} + {{ field.date("date", _("date of the event"), required=true) }} + {{ field.url("main_image", _("event image URL (https)"), + title=_("you can enter here the URL to a JPEG or PNG image to use as representation of your event"), + placeholder=_("JPEG or PNG image URL"), + pattern='http.*(jpg|jpeg|png)') }} + {{ field.url("bg_image", _("background image URL (https)"), + title=_("you can enter here the URL to a JPEG or PNG image to use repeating background"), + placeholder=_("JPEG or PNG image URL"), + pattern='http.*(jpg|jpeg|png)') }} + {{ field.submit(_("Create event")) }} + {% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/event/invitation.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/event/invitation.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,37 @@ +{% extends 'base/base.html' %} + +{% block body %} + +
+

+ {% trans %}Welcome {{name}}{% endtrans %} +

+
+ {% trans %}You have been invited to participate to an event{% endtrans %} +
+
+ {% if event.image is defined %} +
+ +
+ {% endif %} + {% if event.description is defined %} +
+

{{event.description}}

+
+ {% endif %} +
+ + + {% include 'event/counter.html' %} + + {% if days_left is defined and days_left > 0 %} + {% include 'event/attendance.html' %} + {% endif %} + + {% if items %} + {% include 'blog/articles.html' %} + {% endif %} +
+ +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/event/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/event/overview.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,41 @@ +{# overview of current events + + @variable item(xmlui_item): ticket to display + @variable comments(data_object.BlogItems): comments of the ticket + @variable comments_service(unicode): service for adding comments + @variable comments_node(unicode): node for adding comments +#} + +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'components/block.html' as block with context %} + +{% block body %} +{{ icon_defs('calendar') }} + +
+
+
+ {% trans %}There is not events discovery yet, this will come in the future.{% endtrans %} +
+
+ +
+ {{ component.action_button(url_event_new) }} +
+ + {% if events is defined %} +
+
+ {% trans nb_events=events|length%} + You have currently {{nb_events}} event in your personal list + {% pluralize %} + You have currently {{nb_events}} events in your personal list + {% endtrans %} +
+
+ + {{block.interests_grid(events, 'calendar')}} + + {% endif %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/file/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/file/discover.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,72 @@ +{% extends 'base/base.html' %} +{% import 'components/block.html' as block with context %} +{% import 'components/images.html' as images with context %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block body %} +{{ icon_defs('server', 'desktop', 'mobile', 'globe', 'terminal') }} +
+
+
+ {% trans %} + Please select the device you want to access + {% endtrans %} +
+
+
+
+ {% if disco_service_entities %} +
+ {{ block.separator(_("services")) }} +
+ {% for entity,ident in disco_service_entities.items() %} + {% if disco_service_entities|count == 1 %} + {% set icon_label=_("your server") %} + {% else %} + {% set icon_label=(ident.values()|first).values()|first|first %} + {% endif %} + {{ block.icon_item('server', icon_label, entities_url[entity]) }} + {% endfor %} +
+
+ {% endif %} + {% if disco_own_entities %} +
+ {{ block.separator(_("your devices")) }} +
+ {% for entity,ident in disco_own_entities.items() %} + {{ block.icon_item( + icon_from_client(ident.client), + (ident.values()|first).values()|first|first, + entities_url[entity], + ) + }} + {% endfor %} +
+
+ {% endif %} + {% if disco_roster_entities %} +
+ {{ block.separator(_("your contacts devices")) }} +
+ {% for entity,ident in disco_roster_entities.items() %} + {{ block.icon_item( + icon_from_client(ident.client), + entity.userhost(), + entities_url[entity]) + }} + {% endfor %} +
+
+ {% endif %} +
+ +
+

{% trans %}Or enter a full jid of a device{% endtrans %}

+ {% call form.form(class="form--single") %} + {{ field.text("jid", _("device full jid"), required=true)}} + {{ field.submit(_("Access")) }} + {% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/file/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/file/overview.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,64 @@ +{% extends 'base/base.html' %} + +{% block body %} +{{ icon_defs('level-up', 'doc','folder-open-empty', 'comment-empty') }} +
+ +
+{% if not files_data %} +
+
+ {% trans %}No files are shared in this directory!{% endtrans %} +
+
+{% endif%} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/forum/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/forum/overview.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,51 @@ +{% extends 'base/base.html' %} + +{% macro generate_forums(forums_data, level=0) %} + {% if level == 0 %} +
+ {% for forum in forums_data %} +
+

{{ forum.title }}

+ {% if 'short-desc' in forum %} +

{{ forum['short-desc'] }} + {% endif %} +

+ {% if 'sub-forums' in forum %} + {{ generate_forums(forum['sub-forums'], level=level+1) }} + {% endif %} + {% endfor %} +
+ {% else %} +
+ {% for forum in forums_data %} +
+ {% if 'http_url' in forum %} + + {% else %} + + {% endif %} +

{{ forum.title }}

+ {% if 'short-desc' in forum %} +

{{ forum['short-desc'] }}

+ {% endif %} +
+ {% if 'sub-forums' in forum %} + {{ generate_forums(forum['sub-forums'], level=level+1) }} + {% endif %} +
+ {% endfor %} +
+{% endif %} +{% endmacro %} + +{% block body %} +{% if not forums %} +
+
{% trans %}No forums found on this server!{% endtrans %}
+
+{% else %} +
+ {{ generate_forums(forums) }} +
+{% endif %} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/forum/view.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/forum/view.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,21 @@ +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% set dates_format='relative' if single else 'short' %} +{% import 'components/avatar.html' as avatar with context %} +{% import 'blog/macros.html' as blog with context %} +{% import 'input/textbox.html' as textbox with context %} +{% import 'input/navigation.html' as navigation with context %} + +{% block body %} + + +
+ {{ blog.show_items(items, expanded=true) }} +
+ +
+ {{- textbox.comment_or_login(service=service, node=node, placeholder=_("Enter your message here")) -}} +
+ + +{{ navigation.prev_next(_("newer articles"), _("older articles")) }} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/forum/view_topics.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/forum/view_topics.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,49 @@ +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'input/field.html' as field with context%} +{% import 'input/textbox.html' as textbox with context %} +{% import 'input/navigation.html' as navigation with context %} +{% import 'components/avatar.html' as avatar with context %} + +{% block body %} + + {% if not topics %} +
+
+ {% trans %}There is not message yet in this forum.{% endtrans %} + {% if profile %} + {% trans %}You can start a topic of interest by filling this form.{% endtrans %} + {% else %} + {% trans %}You can login to create a new topic.{% endtrans %} + {% endif %} +
+
+ {% endif %} + +
+
+ {% for topic in topics %} +
+
+ {{ avatar.avatar(topic.author) }} +
+ +
+ {% endfor %} +
+
+ {% if profile %} +
+ {% call textbox.textbox(service, node, placeholder=_("Your message"), submit_label=_("Create topic"), type="new_topic") %} + {{ field.text("title", placeholder=_("Your topic"), required=True) }} + {% endcall %} +
+ {% endif %} + + {{ navigation.prev_next(_("older topics"), _("newer topics")) }} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/input/field.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/input/field.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,119 @@ +{# macros to create form fields #} + +{% macro field(type, name, label="", help="", required=false, icon_left=none, icon_right=none) %} + {# generic field + "class" keyword can be used to add classes + additional kwargs will be passed as attributes #} + +
+ {% set cur_id = name|next_gidx %} + {% if label %} + + {% endif %} +
+ + {% if icon_left %} + + {# we use with font from CSS instead of SVG, because using directly SVG doesn't play way with Bulma's control #} + + + {% endif %} + {% if icon_right %} + + + + {% endif %} +
+ {% if help %} +

{{help}}

+ {% endif %} +
+{% endmacro %} + +{% macro select(name, options_list, selected=none, required=false, multiple=false) %} + {# selection of elements with + {% for value, label in options_list %} + + {% endfor %} + +{% endmacro %} + +{% macro choices(name, choices_list, checked=none) %} +
+ {% for choice, label in choices_list %} + + {% endfor %} +
+{% endmacro %} + +{% macro int(name, label="", init=0) %} + {{ field("number", name=name, label=label, value=init, step=1, min=0, **kwargs) }} +{% endmacro %} + +{% macro checkbox(name, label="", checked=false) %} + {% set cur_id = name|next_gidx %} + + +{% endmacro %} + +{% macro text(name, label="", placeholder="", required=false) %} + {{ field("text", name=name, label=label, required=required, placeholder=placeholder, **kwargs) }} +{% endmacro %} + +{% macro password(name, label="", required=false) %} + {{ field("password", name=name, label=label, required=required, **kwargs) }} +{% endmacro %} + +{% macro email(name, label="", required=false) %} + {{ field("email", name=name, label=label, required=required, **kwargs) }} +{% endmacro %} + +{% macro date(name, label="", required=false) %} + {{ field("date", name=name, label=label, required=required, **kwargs) }} +{% endmacro %} + +{% macro url(name, label="", required=false) %} + {{ field("url", name=name, label=label, required=required, **kwargs) }} +{% endmacro %} + +{% macro file(name, label="", required=false) %} + {{ field("file", name=name, label=label, required=required, **kwargs) }} +{% endmacro %} + +{% macro textarea(name, label="", rows=none, cols=50, placeholder='', help='', required=false) %} +
+ {% set cur_id = name|next_gidx %} + {% if label %} + + {% endif %} + + {% if help %} +

{{help}}

+ {% endif %} +
+{% endmacro %} + +{% macro meta(name, value) %} + +{% endmacro %} + +{% macro submit(text=_("Send"), id=none, class='') %} + {# submit button + + @param text(str): label of the button + @param id(none, str): id of the element + #} +
+ +
+{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/input/form.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/input/form.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,8 @@ +{% macro form(action='', class='') %} +
+ {% if csrf_token is defined %} + + {% endif %} + {{ caller() }} +
+{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/input/navigation.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/input/navigation.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,16 @@ +{% macro prev_next(prev_label=_("newer"), next_label=_("older")) %} +
+ +
+{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/input/textbox.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/input/textbox.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,79 @@ +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% macro head(service, node, type="textbox") %} + {# include data needed to identify the node to use for commenting #} + + + +{% endmacro %} + +{% macro textbox(service, node, action='', placeholder='', + submit_label=_("Send"), type="textbox", + class='', ta_class='') %} + {# generic content area for comments/blog posts/etc. + Only a body by default, but new elements can be + added by using this macro with call #} + {% set extra_content = caller() if caller is defined else '' %} + {% call form.form(action=action, class="textbox " + class) %} + {{ head(service, node, type) }} + {{ extra_content }} +
+ {% if identities is defined and own_jid is defined %} + {% if avatar is defined %} +
+ {{ avatar.avatar(own_jid.userhost()) }} +
+ {% endif %} + {% endif %} +
+ {{ field.textarea("body", placeholder=placeholder, required=True) }} + +
+
+ {# {{ field.textarea("body", placeholder=placeholder, required=True, + class=ta_class) }} + {{ submit(label=submit_label) }} #} + {% endcall %} +{% endmacro %} + +{% macro blog_text(service, node, action='', placeholder=_("Your comment")) %} + {{ textbox(service, node, action=action, placeholder=placeholder, type="comment") }} +{% endmacro %} + +{% macro comment(service, node, action='', placeholder=_("Your comment"), class='box--medium') %} + {{ textbox(service, node, action=action, placeholder=placeholder, type="comment", class=class) }} +{% endmacro %} + +{% macro comment_or_login(service, node, action='', placeholder=none) %} + {# show comment form a a message asking to log in + login is checked using profile #} + {% if profile %} + {% if placeholder is none %} + {{ comment(service, node, action) }} + {% else %} + {{ comment(service, node, action, placeholder=placeholder) }} + {% endif %} + {% else %} +
+
+
+

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

+ {% if login_url is defined %} + + {% endif %} +
+
+
+ {% endif %} +{% endmacro %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/input/xmlui.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/input/xmlui.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,276 @@ +{% import 'input/field.html' as field %} + +{# generate methods #} + +{% macro generate_container(cont, config) %} + {% if cont.type == 'vertical' %} + {{ vertical_container(cont, config) }} + {% elif cont.type == 'pairs' %} + {{ pairs_container(cont, config) }} + {% elif cont.type == 'label' %} + {{ label_container(cont, config) }} + {% endif %} +{% endmacro %} + +{% macro generate_widget(wid, config, id=none) %} + {% if wid.type == 'text' %} + {{ text_widget(wid, config, id=id) }} + {% elif wid.type == 'label' %} + {{ label_widget(wid, config) }} + {% elif wid.type == 'string' %} + {{ string_widget(wid, config, id=id) }} + {% elif wid.type == 'jid' %} + {# TODO: proper JID widget #} + {{ string_widget(wid, config, id=id) }} + {% elif wid.type == 'textbox' %} + {{ textbox_widget(wid, config, id=id) }} + {% elif wid.type == 'xhtmlbox' %} + {{ xhtmlbox_widget(wid, config, id=id) }} + {% elif wid.type == 'list' %} + {{ list_widget(wid, config, id=id) }} + {% endif %} +{% endmacro %} + +{% macro generate_children(cont, config) %} + {% for child in cont.children %} + {% if child.category == 'container' %} + {{ generate_container(child, config) }} + {% else %} + {{ generate_widget(child, config) }} + {% endif %} + {% endfor %} + +{% endmacro %} + +{% macro generate(xmlui, form=true, filters=none, attributes=none, ignore=none) %} +{# generate HTML from XMLUI + @param xmlui(template_xmlui.XMLUIPanel): xmlui to use + @param form(bool): if true will generate form elements + @param filters(dict,none): filters as expected by item_filter + @param attributes(dict,none): extra attributes to put on named widgets +#} + {% set config = { + 'form':form, + 'filters':filters or {}, + 'attrs': attributes or {}, + 'ignore': ignore or [], + } + %} + {{ generate_container(xmlui.main_cont, config) }} +{% endmacro %} + +{% macro generate_table(xmlui_items, fields, formatters, tr_class_fields, on_click) %} +{# generate a HTML table from requested widgets names + @param xmlui_items(iterable[unicode]): list of xmlui to show (one per row) + @param fields(tuple[unicode,unicode]): fields to show (name, label) + @param formatters(dict): dictionary of templates to format values: + field_name => template + if no formatter is set (or None is used) for a field, it will be used unmodified. + current xmlui items will be set as "item" key + @param tr_class_fields(iterable[unicode]): name of fields to use as class + class will be "{name}_{value}" where name is field name, and value field value + all lowercase/stripped + @param on_click(data_objects.OnClick): thing to do when clicking on a row +#} + {% if formatters is undefined %} + {% set formatters = {} %} + {% endif %} + {% if on_click is undefined %} + {% set on_click = {} %} + {% endif %} + + + + {% for name,label in fields %} + + {% endfor %} + + + + {% for xmlui in xmlui_items %} + {% set link=on_click.formatUrl(item=xmlui.widget_value) if on_click.url else none %} + + + {% for name,label in fields %} + + {% endfor %} + + {% endfor %} + +
{{ label }}
+ {% for value in xmlui.widgets[name].values %} + {{ value|adv_format(formatters.get(name),item=xmlui.widget_value) }} + {% endfor %} +
+{% endmacro %} + + + + +{% macro generate_list(xmlui_items, fields, formatters, item_class_fields, field_class_map, on_click) %} +{# generate a list of rendered XMLUI from requested widgets names + very similar to generate_table but generate a list instead of a tabme + @param xmlui_items(iterable[unicode]): list of xmlui to show + @param fields(tuple[unicode,unicode]): fields to show (name, label) + @param formatters(dict): dictionary of templates to format values: + field_name => template + if no formatter is set (or None is used) for a field, it will be used unmodified. + current xmlui items will be set as "item" key for the template + @param item_class_fields(iterable[unicode]): name of fields to use as class + class will be "{name}_{value}" where name is field name, and value field value + all lowercase/stripped + @param field_class_map(dict): dictionary of field name to classes to use + @param on_click(data_objects.OnClick): thing to do when clicking on a row +#} + {% if formatters is undefined %} + {% set formatters = {} %} + {% endif %} + {% if on_click is undefined %} + {% set on_click = {} %} + {% endif %} + {% if field_class_map is undefined %} + {% set field_class_map = {} %} + {% endif %} + {% for xmlui in xmlui_items %} + {% set link=on_click.formatUrl(item=xmlui.widget_value) if on_click.url else none %} + + {% endfor %} +{% endmacro %} + + + + + +{# containers #} + +{% macro vertical_container(cont, config) %} +
+ {{ generate_children(cont, config) }} +
+{% endmacro %} + +{% macro pairs_container(cont, config) %} + {# TODO: proper impelmentation (do the same as vertical container for now #} +
+ {{ generate_children(cont, config) }} +
+{% endmacro %} + +{% macro label_container(cont, config) %} +
+ {% for child in cont.children %} + {% if loop.index is odd %} + {# label #} + {% if child.for_name not in config.ignore %} +
+ {% if child.type == 'label' %} + {% set for_ = ('wid_' + (child.for_name or child.name or '_noname'))|next_gidx %} + {{ label_widget(child, config, for=for_) }} + {% endif %} + {% endif %} + {% else %} + {# widget #} + {% if child.name not in config.ignore %} + {% set id = ('wid_' + (child.name or '_noname'))|cur_gidx %} + {{ generate_widget(child, config, id=id) }} +
+ {% endif %} + {% endif %} + {% endfor %} +
+{% endmacro %} + + +{# widgets #} + +{% macro text_widget(wid, config, id=none) %} + {% if config.form %} + + {% else %} +

+ {{- wid|item_filter(config.filters)|default('\u00A0',true) -}} +

+ {% endif %} +{% endmacro%} + +{% macro label_widget(wid, config, for=none) %} + {% if config.form %} + + {% else %} + {{wid|item_filter(config.filters)}} + {% endif %} +{% endmacro%} + +{% macro string_widget(wid, config, id=none) %} + {% if config.form %} + + {% else %} +

+ {{- wid|item_filter(config.filters) -}} +

+ {% endif %} +{% endmacro%} + +{% macro textbox_widget(wid, config, id=none) %} + {% if config.form %} + + {% else %} +

+ {{- wid|item_filter(config.filters) -}} +

+ {% endif %} +{% endmacro%} + +{% macro xhtmlbox_widget(wid, config, id=none) %} + {% if config.form and not wid.read_only %} + + {% else %} +
+ {{- wid|item_filter(config.filters) -}} +
+ {% endif %} +{% endmacro%} + +{% macro list_widget(wid, config, id=none) %} + {% if config.form %} +
+ +
+ {% else %} +
+ {% for value,label in wid.items %} + + {{- label -}} + + {% endfor %} +
+ {% endif %} +{% endmacro%} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/login/logged.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/login/logged.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,29 @@ +{% set post_confirm_message=_("You have been logged correctly") %} +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block title %}{{C.APP_NAME}}{% endblock %} + +{% block confirm_message %} + {% trans %}You have been logged correctly{% endtrans %} +{% endblock confirm_message %} + +{% block body %} +
+
+
+ {% if guest_session %} +

{% trans %}You are logged as a guest{% endtrans %}

+ {% else %} +

{% trans name=''|safe + profile + ''|safe %}You are logged under the account {{name}} {% endtrans %}

+ {% endif %} +

{% trans session_started=''|safe + session_started|date_fmt('relative') + ''|safe %}You logged {{session_started}}{% endtrans %}

+
+
+ {% call form.form() %} + {{ field.meta('type', 'disconnect') }} + {{ field.submit(_("Disconnect")) }} + {% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/login/login.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/login/login.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,65 @@ +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block title %}{{C.APP_NAME}} login{% endblock %} + +{% block body %} +{{ icon_defs('group') }} +
+
+
+ +
+
+ {% block login_right_top %}{% endblock %} + {% if login_error is defined %} + {# error messages displayed in case of failing attempt to login #} +
+
+ {% block login_error_message %} + {% if login_error == S_C.PROFILE_AUTH_ERROR %} + {%- trans %}Your login and/or password is incorrect. Please try again.{% endtrans -%} + {% elif login_error == S_C.XMPP_AUTH_ERROR %} + {%- trans %}Your XMPP account failed to connect. Did you enter the good password? If you have changed your XMPP password since your last connection on Libervia, please use another SàT frontend to update your profile.{% endtrans -%} + {% elif login_error == S_C.NO_REPLY %} + {%- trans %}Did not received a reply (the timeout expired or the connection is broken).{% endtrans -%} + {% else %} + {%- trans %}An unknown error occurred, please contact your service administrator.{% endtrans -%} + {% endif %} + {% endblock login_error_message %} +
+
+ {% endif %} + +
+ {% block login_form %} + {% call form.form() %} + {{ field.meta('type', 'login') }} + {{ field.text("login", _("Login"), + required=true, + value=login, + icon_left="person", + )}} + {{ field.password("password", _("Password"), + required=not empty_password_allowed, + icon_left="key") }} + {{ field.submit(_("Log in")) }} + {% endcall %} + {% endblock login_form %} +
+
+
+
+{% if register_url is defined %} +
+ +
+{% endif %} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/login/register.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/login/register.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,54 @@ +{% extends 'login/login.html' %} + +{% block title %}{{C.APP_NAME}} register new account{% endblock %} + +{% block login_error_message %} +{% if login_error == S_C.ALREADY_EXISTS %} + {%- trans %}This login already exists, please choose another one.{% endtrans -%} +{% elif login_error == S_C.INVALID_CERTIFICATE %} + {%- trans %}The certificate of the server is invalid. Please contact your server administrator.{% endtrans -%} +{% elif login_error == S_C.INVALID_INPUT %} + {%- trans %}The data you entered are not valid.{% endtrans -%} +{% elif login_error == S_C.BAD_REQUEST %} + {%- trans %}Bad request, please contact your service administrator.{% endtrans -%} +{% else %} + {%- trans %}An unknown error occurred, please contact your service administrator.{% endtrans -%} +{% endif %} +{% endblock login_error_message %} + +{% block login_right_top %} +{% if login_url is defined %} + +{% endif %} +{% endblock login_right_top %} + +{% block login_form %} +{% call form.form(class='register') %} + {{ field.meta('type', 'register') }} + {{ field.text("login", _("Login"), + required=true, + pattern=S_C.REG_LOGIN_RE, + title=_("Login must be lower case, with only plain letters (a-z), numbers (0-9) or underscore(_)"), + value=login, + icon_left="person", + )}} + {{ field.email("email", _("Email"), + required=true, + value=email, + icon_left="mail-filled", + )}} + {{ field.password("password", _("Password"), + required=true, + minlength=S_C.PASSWORD_MIN_LENGTH, + value=password, + icon_left="key", + )}} + {{ field.submit(_("Register new account")) }} +{% endcall %} +{% endblock login_form %} + +{% block login_right_bottom %}{% endblock %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/merge-request/create.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/merge-request/create.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,13 @@ +{# creata a new ticket #} + +{% set category_menu = [('merge-requests', url_tickets_list)] %} +{% extends 'base/base.html' %} +{% block body %} +
+
+
+ {% trans %}It is not yet possible to create a merge request from inside Libervia, please use
jp merge-request set
for now. Merge requests welcome ;){% endtrans %} +
+
+
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/merge-request/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/merge-request/discover.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,30 @@ +{% 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('merge') }} +
+
+
+ {% trans %} + Please select a merge-requests handler + {% endtrans %} +
+
+ {% if mr_handlers is defined %} +
+ {{block.disco_icon_grid(mr_handlers, 'merge')}} +
+ {% endif %} +
+
+ {% call form.form(class="form--single") %} + {{ field.text("jid", _("handler jid"), required=true)}} + {{ field.submit(_("Access")) }} + {% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/merge-request/edit.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/merge-request/edit.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,29 @@ +{# edit an existing ticket #} + +{% set category_menu = [('merge-requests', url_tickets_list), + ('merge-request_new', url_tickets_new)] %} +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+

+ {% trans %}Note:{% endtrans %} + {% trans app_name=C.APP_NAME%}to modify content of the merge request, you'll have to use command line (with jp){% endtrans %} +

+
+
+{% call form.form() %} + {{ xmlui.generate(new_ticket_xmlui, + attributes = {'title': {'required': 'required', + 'placeholder': _("Short description of your issue/request")}, + 'body': {'required': 'required', + 'placeholder': _("Please describe your issue/request with as much details as possible. You can use Markdown syntax.")}, + 'labels': {'placeholder': _("You can enter one or several labels separated by commas")}, + })}} + {{ field.submit(_("Modify ticket")) }} +{% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/merge-request/item.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/merge-request/item.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,131 @@ +{# display a single ticket + + @variable item(xmlui_item): ticket to display + @variable comments(data_object.BlogItems): comments of the ticket + @variable comments_service(unicode): service for adding comments + @variable comments_node(unicode): node for adding comments +#} + +{% set category_menu = [('merge-requests', url_tickets_list), + ('merge-request_new', url_tickets_new)] %} +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'input/xmlui.html' as xmlui with context %} +{% import 'components/avatar.html' as avatar with context %} +{% import 'blog/macros.html' as blog with context %} +{% import 'input/textbox.html' as textbox with context %} + +{% block title %}{{item|adv_format('#{value.widget_value.id} {value.widget_value.title}') }}{% endblock %} + +{% block confirm_message %} + {% trans %}Your comment has been sent{% endtrans %} +{% endblock confirm_message %} + +{% block body %} +{{ icon_defs('pencil') }} +
+
+ + +
+
+
+
+ {% if identities is defined %} + {% if avatar is defined %} +
+ {{ avatar.avatar(item.widget_value['publisher'].bare) }} +
+ {% endif %} + {% endif %} +
+
+

{{item.widget_value['title']}}

+ {{ item.widget_value['body'] }} + +
+ {% if comments is defined %} + {{ blog.show_items(comments|reverse, expanded=true) }} + {% endif %} + {% if comments_node is defined %} +
+ {{- textbox.comment_or_login(service=comments_service, node=comments_node) -}} +
+ {% endif %} +
+ {% if url_ticket_edit is defined %} + + {% endif %} +
+
+
+ {{ + xmlui.generate( + item, + form=false, + filters={ + 'created': { + 'filters': ['date_fmt'], + 'filters_args':[{'fmt': 'short'}] + }, + 'updated': { + 'filters': ['date_fmt'], + 'filters_args':[{'fmt': 'short'}] + }, + 'body': { + 'filters': ['urlize'], + 'filters_args':[{ + 'nofollow': True, + 'rel': 'noopener noreferrer' + }] + } + }, + ignore=['publisher', 'title', 'body', 'comments_uri'], + ) + }} +
+
+
+ +
+ {% for patch in patches %} +
+
+

{{patch.commit_msg}}

+
+ +
+
+
+ {{- patch.diff|highlight('diff') -}} +
+
+ {% endfor %} +
+
+
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/photo/album.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/photo/album.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,44 @@ +{% extends 'base/base.html' %} +{% import 'components/avatar.html' as avatar with context %} +{% import 'input/textbox.html' as textbox with context %} +{% import 'blog/macros.html' as blog with context %} + +{% block body %} +{{ icon_defs('comment-empty') }} +
+ {% for file in files_data %} + {% if file.type == C.FILE_TYPE_FILE %} +
+
+
+ + {{file.name}} + +
+
+
+
+
+
+ {% if file.comments_url is defined %} + {% if file.comments_count %} + {{file.comments_count}}  + {% endif %} + {{ icon('comment-empty', cls='icon is-small') }} + {% endif %} +
+
+
+
+
+
+ {{ blog.show_items(file.comments, expanded=true, dates_fmt='relative') }} +
+ {{- textbox.comment_or_login(service=file.comments_service, node=file.comments_node) -}} +
+
+
+ {% endif %} + {% endfor %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/photo/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/photo/discover.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,32 @@ +{% extends 'base/base.html' %} +{% import 'components/block.html' as block with context %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block body %} +{{ icon_defs('file-image') }} +
+
+
+ {% trans %} + Photo discovery is not implemented yet, however you can enter a jid below to find its albums + {% endtrans %} +
+
+
+{% if interests is defined %} +

+ {% trans nb_interests=interests|length%} + You have currently {{nb_interests}} album in your personal list + {% pluralize %} + You have currently {{nb_interests}} albums in your personal list + {% endtrans %} +

+ + {{block.interests_grid(interests, 'file-image')}} +{% endif %} +{% call form.form(class="form--single") %} + {{ field.text("jid", _("device full jid"), required=true)}} + {{ field.submit(_("Access")) }} +{% endcall %} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/settings.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/settings.json Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,3 @@ +{ + "css_default_fallback": false +} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/static/highlight.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/static/highlight.css Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,1 @@ +../../default/static/highlight.css \ No newline at end of file diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/static/styles.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/static/styles.css Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,161 @@ +:root { + --photo-height: 280px; + --photo-height--poster: 500px; +} + +.has-whitespace-pre { + white-space: pre; +} + +.is-avatar { + height: 64px; + width: 64px; + border-radius: 50%; + border: 1px solid #bbb; + background-color: #eee; + overflow: hidden; +} + +.is-photo-thumbnail { + max-height: var(--photo-height); + max-width: 100%; +} + +.is-photo-thumbnail-container { + height: var(--photo-height); +} + +.has-items-centered { + align-items: center; + justify-content: center; +} + +.is-poster { + height: var(--photo-height--poster) !important; +} + +.is-poster>.is-photo-thumbnail { + max-height: var(--photo-height--poster) !important; +} + +.has-items-vcentered { + align-items: center; +} + + +.x-is-hoverable:hover { + background-color: #eee !important; +} + +.is-chat-message { + margin: 0.5rem 0 0 !important; + padding: 0 !important; + border: 0 !important; +} + +a.is-wrapping { + line-height: 0; +} + +.has-margin-top-1 { + margin-top: 1rem; +} + +.has-vmargin-1 { + margin: 0.5rem 0; +} + +.has-padding-1 { + padding: 0.25rem; +} + +.has-vpadding-1 { + padding: 0 0.25rem; +} + +.has-vpadding-6 { + padding: 0 1.5rem; +} + +.has-no-background { + box-shadow: none !important; + background-color: initial !important; +} + +.pagination-disabled { + background-color: white; + border-color: #dbdbdb; + color: #b5b5b5; + cursor: auto; +} + +.pagination-disabled:hover { + background-color: white; + border-color: #dbdbdb; + color: #b5b5b5; +} + +.has-text-shortenable { + overflow: hidden; + text-overflow: ellipsis; +} + + +.panel-drawer { + /* A panel which is hidden by default but can be + opened when it's clicked */ + max-height: 0; + opacity: 0; + overflow: hidden; + transition: max-height 0.5s, opacity 0.5s; +} + +.panel-drawer.state_clicked { + opacity: 1; +} + +/******** + * code * + ********/ + +.highlight { + overflow: auto; +} + +/********** + * blocks * + **********/ + +.block_separator { + font-size: 1.4em; + display: flex; + margin: 1rem 0; +} + +.block_separator__label { + display: inline-block; + margin: 0 0.2em; +} + +.block_separator__line { + height: 1px; + background: #ccc; + flex: 1; + margin-top: 0.7em; +} + +/******** + * tabs * + *******/ + +#tab_guests { + overflow: auto; +} + +.tab__page { + display: None; +} + +.tab__page.state_clicked { + display: block; +} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/static/styles_noscript.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/static/styles_noscript.css Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,9 @@ +/********** + * Panels * + **********/ + +/* drawer needs to be opened to have the content visible */ +.panel-drawer { + max-height: none; + opacity: 1; +} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/ticket/create.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/ticket/create.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,30 @@ +{# create a new ticket #} + +{% set category_menu = [('tickets_list', url_tickets_list)] %} +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+
+
+ {% trans app_name=C.APP_NAME%}This page allows you to report an issue or ask/suggest a new feature for {{app_name}}{% endtrans %} +
+
+ +
+ {% call form.form() %} + {{ xmlui.generate(new_ticket_xmlui, + attributes = {'title': {'required': 'required', + 'placeholder': _("Short description of your issue/request")}, + 'body': {'required': 'required', + 'placeholder': _("Please describe your issue/request with as much details as possible. You can use Markdown syntax.")}, + 'labels': {'placeholder': _("You can enter one or several labels separated by commas")}, + })}} + {{ field.submit(_("Create ticket"), class="has-margin-top-1") }} + {% endcall %} +
+
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/ticket/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/ticket/discover.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,30 @@ +{% 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') }} +
+
+
+ {% trans %} + Please select a tickets tracker + {% endtrans %} +
+
+ {% if tickets_trackers is defined %} +
+ {{block.disco_icon_grid(tickets_trackers, 'clipboard')}} +
+ {% endif %} +
+
+ {% call form.form(class="form--single") %} + {{ field.text("jid", _("tickets tracker jid"), required=true)}} + {{ field.submit(_("Access")) }} + {% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/ticket/edit.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/ticket/edit.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,22 @@ +{# edit an existing ticket #} + +{% set category_menu = [('tickets_list', url_tickets_list)] %} +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+{% call form.form() %} + {{ xmlui.generate(new_ticket_xmlui, + attributes = {'title': {'required': 'required', + 'placeholder': _("Short description of your issue/request")}, + 'body': {'required': 'required', + 'placeholder': _("Please describe your issue/request with as much details as possible. You can use Markdown syntax.")}, + 'labels': {'placeholder': _("You can enter one or several labels separated by commas")}, + })}} + {{ field.submit(_("Modify ticket"), class="has-margin-top-1") }} +{% endcall %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/ticket/item.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/ticket/item.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,80 @@ +{# display a single ticket + + @variable item(xmlui_item): ticket to display + @variable comments(data_object.BlogItems): comments of the ticket + @variable comments_service(unicode): service for adding comments + @variable comments_node(unicode): node for adding comments +#} + +{% set category_menu = [('tickets', url_tickets_list), + ('ticket_new', url_tickets_new), + ] %} +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'input/xmlui.html' as xmlui with context %} +{% import 'components/avatar.html' as avatar with context %} +{% import 'blog/macros.html' as blog with context %} +{% import 'input/textbox.html' as textbox with context %} + +{% block title %}{{item|adv_format('#{value.widget_value.id} {value.widget_value.title}') }}{% endblock %} + +{% block confirm_message %} + {% trans %}Your comment has been sent{% endtrans %} +{% endblock confirm_message %} + +{% block body %} +{{ icon_defs('pencil') }} +
+
+
+ {% if identities is defined %} + {% if avatar is defined %} +
+ {{ avatar.avatar(item.widget_value['publisher'].bare) }} +
+ {% endif %} + {% endif %} +
+
+

{{item.widget_value['title']}}

+ {{ item.widget_value['body'] }} + +
+ {% if comments is defined %} + {{ blog.show_items(comments|reverse, expanded=true) }} + {% endif %} + {% if comments_node is defined %} +
+ {{- textbox.comment_or_login(service=comments_service, node=comments_node) -}} +
+ {% endif %} +
+ {% if url_ticket_edit is defined %} + + {% endif %} +
+
+
+ {{ + xmlui.generate( + item, + form=false, + filters={ + 'created': { + 'filters': ['date_fmt'], + 'filters_args':[{'fmt': 'short'}] + }, + 'updated': { + 'filters': ['date_fmt'], + 'filters_args':[{'fmt': 'short'}] + }, + }, + ignore=['publisher', 'title', 'body', 'comments_uri'], + ) + }} +
+
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/ticket/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/ticket/overview.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,38 @@ +{# display the list of tickets #} + +{% set category_menu = [('ticket_new', url_tickets_new)] %} +{% extends 'base/base.html' %} +{% import 'input/xmlui.html' as xmlui with context %} +{% import 'input/navigation.html' as navigation with context %} + +{% block body %} +
+
+ {{ component.action_button(url_tickets_new) }} +
+
+ {{ xmlui.generate_list( + tickets, + ( + ('title', _('Title')), + ('labels', _('Labels')), + ('id', _('Id')), + ('author', _('Author')), + ), + { + 'id': '\n#{value}', + 'author': _('by {value}'), + }, + item_class_fields=['status', 'priority', 'severity'], + field_class_map={ + 'title': 'has-text-weight-bold', + 'labels': 'tag is-rounded x-is-hoverable', + 'id': 'has-text-grey-light is-size-7 has-whitespace-pre', + 'author': 'is-size-7' + }, + on_click=on_ticket_click) + }} +
+
+{{ navigation.prev_next(_("previous page"), _("next page")) }} +{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/bulma/ticket/tickets.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/ticket/tickets.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,12 @@ +{% extends 'base/base.html' %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+ {% for ticket in tickets %} +
+ {{ xmlui.generate(ticket) }} +
+ {% endfor %} +
+{% endblock body %} diff -r 739c3e6999fa -r 0e69b5843c2f sat_templates/templates/default/static/common.js --- a/sat_templates/templates/default/static/common.js Sun Apr 26 22:06:07 2020 +0200 +++ b/sat_templates/templates/default/static/common.js Tue May 19 00:02:34 2020 +0200 @@ -65,22 +65,23 @@ ); } -function tab_select(tab_btn_elt, tab_page_id) { +function tab_select(tab_btn_elt, tab_page_id, btn_clicked_cls='state_clicked', tab_clicked_cls='state_clicked') { + for (let elt of document.getElementsByClassName("tab__btn")) { if (elt === tab_btn_elt) { - elt.classList.add('state_clicked'); + elt.classList.add(btn_clicked_cls); } else { - elt.classList.remove('state_clicked'); + elt.classList.remove(btn_clicked_cls); } } let tab_page_elt = document.getElementById(tab_page_id); for (let elt of document.getElementsByClassName("tab__page")) { if (elt === tab_page_elt) { - elt.classList.add('state_clicked'); + elt.classList.add(tab_clicked_cls); } else { - elt.classList.remove('state_clicked'); + elt.classList.remove(tab_clicked_cls); } } }