# HG changeset patch # User Goffi # Date 1538593224 -7200 # Node ID 178f55b825b70e0325e08721868dccf3a26504a7 # Parent 9e8d9d754337ecdaba10247ab406768a5aedd45e small refactoring/redesign, better BEM integration: - blog has been redesigned, and almost all blog CSS has been made generic and moved to main styles.css file. - better noscript handling, dynamic elements are created using "magic" classes (dom_update.js) - using better icons for older/newer messages - better state handling, classes now use "state_XXX" - more classes now use BEM convention - menu labels have been moved to a separate template (components/menu_labels.html), so it can be overriden easily by other sites - better styles.css organisation diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/app/app.html --- a/sat_templates/templates/default/app/app.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/app/app.html Wed Oct 03 21:00:24 2018 +0200 @@ -1,23 +1,23 @@ {% extends 'base/base.html' %} {% block body %} -
-

- {% trans app_name=C.APP_NAME %} - The following link allows you to access {{app_name}} web application, which is a more feature rich way to use this software (but it is also a bit more heavy and complex to use). - {% endtrans %} -

-

- {% trans %} - Please note that current version of web application use legacy technologies and will be rewritten for next version of Salut à Toi (0.8). It does contain some bugs and it is under minimal maintenance. - {% endtrans %} -

- -

- {% trans %} - Next time you can go directly to the above URL. - {% endtrans %} -

-
+
+

+ {% trans app_name=C.APP_NAME %} + The following link allows you to access {{app_name}} web application, which is a more feature rich way to use this software (but it is also a bit more heavy and complex to use). + {% endtrans %} +

+

+ {% trans %} + Please note that current version of web application use legacy technologies and will be rewritten for next version of Salut à Toi (0.8). It does contain some bugs and it is under minimal maintenance. + {% endtrans %} +

+ +

+ {% trans %} + Next time you can go directly to the above URL. + {% endtrans %} +

+
{% endblock body %} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/base/base.html --- a/sat_templates/templates/default/base/base.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/base/base.html Wed Oct 03 21:00:24 2018 +0200 @@ -1,6 +1,7 @@ {% set embedded = True %} {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #} {% import 'components/common.html' as component with context %} {{ script.include('common', '') }} {# common.js is, as its name state, a common script, so it's useful to import it here #} +{{ script.include('dom_update') }} {# will check page for dom element to modify when javascript is enabled #} @@ -52,6 +53,8 @@ {% if websocket is defined %} {{ script.include('websocket', '') }} {% endif %} + {# FIXME: following ugly hack is temporarily needed for dom_update, until a proper way to handle gettext dynamicly is implemented #} + {{ script.generate_scripts() }} {% if websocket is defined %} @@ -92,7 +95,7 @@ {% block body %} {% endblock body %} - + diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/blog/articles.html --- a/sat_templates/templates/default/blog/articles.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/blog/articles.html Wed Oct 03 21:00:24 2018 +0200 @@ -1,6 +1,7 @@ {% if not embedded %}{% extends 'base/base.html' %}{% 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 %} @@ -18,6 +19,7 @@ {%- endblock title -%} {% block body %} +{{ icon_defs('angle-double-left', 'angle-double-right') }} {% if items %}
{{ blog.show_items(items, expanded=single) }} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/blog/item.html --- a/sat_templates/templates/default/blog/item.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/blog/item.html Wed Oct 03 21:00:24 2018 +0200 @@ -11,34 +11,22 @@ {% 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" %} + {% set other_lang = " other_lang" if expanded else " other_lang state_init" %} {% endif %} -{% if expanded %} - {# FIXME: the style attribute is not nice, but due to the use of clicked_mh_fix. A cleaner way would be welcomed #} -
-{% else %} -
-{% endif %} +
{# following message is displayed if item lang is different from page locale #} {% if other_lang is defined %} -

{% trans language=locale.language_name %}This message is not in {{language}}, click to display anyway{% endtrans %}

+

{% trans language=locale.language_name %}This message is not in {{language}}, click to display anyway{% endtrans %}

{% endif %} - {# we put a reduce button at the top #} -
-

- {% trans %}Click to reduce…{% endtrans %} -

-
-
{% block header %} {# title and publication date link to a HTTP page if items_http_uri is set #} {% set item_http_uri = items_http_uri.get(item.id) if items_http_uri is defined else none %} -
+
{% block blog_title scoped %} {% set title = item.title_xhtml or item.title or '' %} {% if item_http_uri %} @@ -49,15 +37,18 @@ {% endblock %}
{% block metadata scoped %} -
-
+
{% block content %} {{- item.content_xhtml or item.content|urlize or '' -}} {% endblock content %}
- {# and the bottom button to expand/reduce the article #} -
-

- {% trans %}Click to expand…{% endtrans %} - {% trans %}Click to reduce…{% endtrans %} -

-
-
{% endblock item %} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/blog/macros.html --- a/sat_templates/templates/default/blog/macros.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/blog/macros.html Wed Oct 03 21:00:24 2018 +0200 @@ -1,10 +1,10 @@ {% import 'input/textbox.html' as textbox with context %} -{% macro show_items(items, comments=False, expanded=false, dates_fmt=none) %} +{% 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 comments(bool): True items are comments + @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 #} @@ -12,18 +12,20 @@ {% set dates_format = dates_fmt or 'short' %} {% endif %} {% for item in items %} - {% if not comments %}
{% endif %} + {% if not comment %}
{% endif %} {% include 'blog/item.html' %} - {% if not comments %}
{% endif %} + {% if not comment %}
{% endif %} {# we recursively display comments for all comments nodes (usually there's only one) #} {% for comments_items in item.comments_items_list %} - -
+
+
{% if allow_commenting %}
{{- textbox.comment(service=comments_items.service, node=comments_items.node) -}} @@ -31,7 +33,7 @@ {% endif %}
- {{show_items(comments_items, comments=True)}} + {{show_items(comments_items, comment=True)}}
diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/components/common.html --- a/sat_templates/templates/default/components/common.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/components/common.html Wed Oct 03 21:00:24 2018 +0200 @@ -1,26 +1,10 @@ -{# menu labels, map from menu names to labels #} -{% set ml = { - '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'), -} %} +{% import 'components/menu_labels.html' as ml %} {% macro menu(menus, class='') %} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/components/menu_labels.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/default/components/menu_labels.html Wed Oct 03 21:00:24 2018 +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 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/event/admin.html --- a/sat_templates/templates/default/event/admin.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/event/admin.html Wed Oct 03 21:00:24 2018 +0200 @@ -16,70 +16,84 @@ {% include 'event/counter.html' %} -{% if invitees %} -
-

{% trans %}invitees{% endtrans %}

- - - - - - {% for name, data in invitees.iteritems() %} - - - - {% 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')}}
+
+
+
    +
  • {% trans %}Invitees{% endtrans %}
  • +
  • {% trans %}Invite people{% endtrans %}
  • +
  • {% trans %}Write a blog post{% endtrans %}
  • +
  • {% trans %}Read event blog{% endtrans %}
  • +
+
+ +
+ {% if invitees %} + + + + + + {% for name, data in invitees.iteritems() %} + + + + {% 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 %}
-{% 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"), + class="form__field--medium") }} + {{ field.textarea("emails", + _("enter here a list of emails addresses (one per line) to invite"), + class="form__field--medium") }} + {{ field.submit(_("Invite people")) }} + {% endcall %} +
-
-

{% trans %}invite people{% endtrans %}

-{% 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"), - class="form__field--medium") }} - {{ field.textarea("emails", - _("enter here a list of emails addresses (one per line) to invite"), - class="form__field--medium") }} - {{ 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"), + class="form__field--big") }} + {{ field.text("language", + _("language"), + class="form__field--tiny") }} + {{ field.checkbox("comments", + _("allow comments"), + checked=true) }} + {{ field.submit(_("send")) }} + {% endcall %} +
+ +
+ {% if items is defined %} + {% include 'blog/articles.html' %} + {% endif %} +
+
-
-

{% trans %}write a blog post{% endtrans %}

-{% 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"), - class="form__field--big") }} - {{ field.text("language", - _("language"), - class="form__field--tiny") }} - {{ field.checkbox("comments", - _("allow comments"), - checked=true) }} - {{ field.submit(_("send")) }} -{% endcall %} -
- -{% if items is defined %} - {% include 'blog/articles.html' %} -{% endif %} - {% endblock body %} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/forum/view.html --- a/sat_templates/templates/default/forum/view.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/forum/view.html Wed Oct 03 21:00:24 2018 +0200 @@ -2,8 +2,10 @@ {% set dates_format='relative' if single else 'short' %} {% 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 %} +{{ icon_defs('angle-double-left', 'angle-double-right') }}
{{ blog.show_items(items, expanded=true) }} @@ -11,24 +13,6 @@
{{- textbox.comment_or_login(service=service, node=node, placeholder=_("Enter your message here")) -}}
- + +{{ navigation.prev_next(_("newer articles"), _("older articles")) }} {% endblock body %} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/input/field.html --- a/sat_templates/templates/default/input/field.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/input/field.html Wed Oct 03 21:00:24 2018 +0200 @@ -72,5 +72,5 @@ {% endmacro %} {% macro submit(text=_("Send")) %} - + {% endmacro %} diff -r 9e8d9d754337 -r 178f55b825b7 sat_templates/templates/default/input/navigation.html --- a/sat_templates/templates/default/input/navigation.html Fri Sep 14 19:49:15 2018 +0200 +++ b/sat_templates/templates/default/input/navigation.html Wed Oct 03 21:00:24 2018 +0200 @@ -1,19 +1,19 @@ {% macro prev_next(prev_label=_("newer"), next_label=_("older")) %} -