diff sat_templates/templates/default/event/admin.html @ 166:178f55b825b7

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
author Goffi <goffi@goffi.org>
date Wed, 03 Oct 2018 21:00:24 +0200
parents e9f0a4215e46
children f7d6ae06c42f
line wrap: on
line diff
--- 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 %}
-    <div class="box">
-    <h3 class="title">{% trans %}invitees{% endtrans %}</h3>
-    <table class="table--main">
-    <tr>
-        <th>{% trans %}name{% endtrans %}</th>
-        <th>{% trans %}coming?{% endtrans %}</th>
-        <th>{% trans %}guests{% endtrans %}</th>
-    {% for name, data in invitees.iteritems() %}
-        <tr>
-            <td>{{name}}</td>
-            <td>{{data.attend|default('')}}</td>
-            {% if data.attend == 'no' %}
-                <td>&nbsp;</td>
-            {% else %}
-                <td>{{data.guests|default(0)}}</td>
-            {% endif %}
-        </tr>
-    {% endfor %}
-    <tr>
-        <td colspan=2 class="table__total">{% trans %}total expected{% endtrans %}</td>
-        <td class="table__total_value">{{invitees_guests|default('0')}}</td>
-    </tr>
-    </table>
+<div class="tab__container">
+    <div class="tab__header">
+        <ul>
+            <li class="tab__btn state_clicked" onclick='tab_select(this, "tab_guests")'>{% trans %}Invitees{% endtrans %}</li>
+            <li class="tab__btn" onclick='tab_select(this,"tab_invitations")'>{% trans %}Invite people{% endtrans %}</li>
+            <li class="tab__btn" onclick='tab_select(this,"tab_new_post")'>{% trans %}Write a blog post{% endtrans %}</li>
+            <li class="tab__btn" onclick='tab_select(this,"tab_blog")'>{% trans %}Read event blog{% endtrans %}</li>
+        </ul>
+    </div>
+
+    <div class="tab__page state_clicked" id="tab_guests">
+        {% if invitees %}
+            <table class="table--main">
+            <tr>
+                <th>{% trans %}name{% endtrans %}</th>
+                <th>{% trans %}coming?{% endtrans %}</th>
+                <th>{% trans %}guests{% endtrans %}</th>
+            {% for name, data in invitees.iteritems() %}
+                <tr>
+                    <td>{{name}}</td>
+                    <td>{{data.attend|default('')}}</td>
+                    {% if data.attend == 'no' %}
+                        <td>&nbsp;</td>
+                    {% else %}
+                        <td>{{data.guests|default(0)}}</td>
+                    {% endif %}
+                </tr>
+            {% endfor %}
+            <tr>
+                <td colspan=2 class="table__total">{% trans %}total expected{% endtrans %}</td>
+                <td class="table__total_value">{{invitees_guests|default('0')}}</td>
+            </tr>
+            </table>
+        {% else %}
+            <p class="message--info">{% trans %}No invitee has answered yet{% endtrans %}</p>
+        {% endif %}
     </div>
-{% endif %}
+
+
+    <div class="tab__page" id="tab_invitations">
+        {% 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 %}
+    </div>
 
-<div class="box">
-<h3 class="title">{% trans %}invite people{% endtrans %}</h3>
-{% 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 %}
+    <div class="tab__page" id="tab_new_post">
+        {% 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 %}
+    </div>
+
+    <div class="tab__page" id="tab_blog">
+        {% if items is defined %}
+            {% include 'blog/articles.html' %}
+        {% endif %}
+    </div>
+
 </div>
 
-<div class="box">
-<h3 class="title">{% trans %}write a blog post{% endtrans %}</h3>
-{% 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 %}
-</div>
-
-{% if items is defined %}
-    {% include 'blog/articles.html' %}
-{% endif %}
-
 {% endblock body %}