changeset 154:80cf52fbcc40

events: added admin, create and overview templates
author Goffi <goffi@goffi.org>
date Thu, 21 Jun 2018 01:11:07 +0200 (2018-06-20)
parents b84d20af0ed3
children 954759f0e8fa
files sat_templates/default/components/common.html sat_templates/default/event/admin.html sat_templates/default/event/counter.html sat_templates/default/event/create.html sat_templates/default/event/invitation.html sat_templates/default/event/overview.html
diffstat 6 files changed, 169 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/default/components/common.html	Thu Jun 21 01:09:00 2018 +0200
+++ b/sat_templates/default/components/common.html	Thu Jun 21 01:11:07 2018 +0200
@@ -11,6 +11,7 @@
     'chat': _('Chat'),
     'files': _('Files sharing'),
     'events': _('Events'),
+    'event_new': _('Create an event'),
     'photos': _('Photos albums'),
     'app': _('Application'),
 } %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/default/event/admin.html	Thu Jun 21 01:11:07 2018 +0200
@@ -0,0 +1,85 @@
+{% 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 %}
+<div class='invitation_header box'>
+    <h1>{% trans name=event.name %}{{name}} administration{% endtrans %}</h1>
+    {% if event.image is defined %}
+        <p><img class='event__picture' src="{{event.image}}"></p>
+    {% endif %}
+    {% if event.description is defined %}
+        <p>{{event.description}}</p>
+    {% endif %}
+</div>
+
+{% 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>
+{% endif %}
+
+<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>
+
+<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 %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/default/event/counter.html	Thu Jun 21 01:11:07 2018 +0200
@@ -0,0 +1,14 @@
+{% if days_left is defined %}
+    {% if days_left > 0 %}
+        <div class="event__counter box">
+            {% trans %}
+                {{days_left}} day left
+            {% pluralize %}
+                {{days_left}} days left
+            {% endtrans %}
+        </div>
+    {% else %}
+        <div class="event__counter box">{% trans %}the event is finished{% endtrans %}</div>
+    {% endif %}
+
+{% endif %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/default/event/create.html	Thu Jun 21 01:11:07 2018 +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 %}
+<div class='instructions--head'>
+{% trans %}Create an event{% endtrans %}
+</div>
+<div class="box--hollow">
+{% 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,
+                      class="form__field--medium") }}
+    {{ 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 %}
+</div>
+{% endblock body %}
--- a/sat_templates/default/event/invitation.html	Thu Jun 21 01:09:00 2018 +0200
+++ b/sat_templates/default/event/invitation.html	Thu Jun 21 01:11:07 2018 +0200
@@ -1,7 +1,7 @@
 {% extends 'base/base.html' %}
 
 {% block body %}
-<div class='invitation_header box'>
+<div class='box box--paper'>
     <h1>{% trans %}Welcome {{name}}{% endtrans %}</h1>
     <p class='instructions'>{% trans %}You have been invited to participate to an event{% endtrans %}</p>
     {% if event.image is defined %}
@@ -9,14 +9,7 @@
     {% endif %}
 </div>
 
-{% if days_left is defined %}
-    {% if days_left > 0 %}
-        <div id="event_counter" class="box">{% trans %}{{days_left}} days left{% endtrans %}</div>
-    {% else %}
-        <div id="event_counter" class="box">{% trans %}the event is finished{% endtrans %}</div>
-    {% endif %}
-
-{% endif %}
+{% include 'event/counter.html' %}
 
 {% include 'event/attendance.html' %}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/default/event/overview.html	Thu Jun 21 01:11:07 2018 +0200
@@ -0,0 +1,36 @@
+{# 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
+#}
+
+{% set category_menu = [('event_new', url_event_new)] %}
+{% if not embedded %}{% extends 'base/base.html' %}{% endif %}
+{% block body %}
+<div class="box message--info">
+    <p>{% trans %}There is not events discovery yet, this will come in the future.{% endtrans %}</p>
+</div>
+{% if events is defined %}
+    <p class="message--note">
+        {% 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 %}
+    </p>
+    <ul class="grid grid--center">
+        {% for event in events %}
+            <li class='grid__item grid__item--medium grid__item--selectable'>
+                <a href="{{event.url}}">
+                    {% if event.image %}
+                        <img class="img--small" src="{{event.image}}">
+                    {% endif %}
+                    <span><em>{{event.name}}</em></span>
+                </a>
+            </li>
+        {% endfor %}
+    </ul>
+{% endif %}
+{% endblock body %}