# HG changeset patch # User Goffi # Date 1529536267 -7200 # Node ID 80cf52fbcc40dedcbe293c2b0d43677a93bbab21 # Parent b84d20af0ed30d94b4cff3179ff8b3f9f6d353fe events: added admin, create and overview templates diff -r b84d20af0ed3 -r 80cf52fbcc40 sat_templates/default/components/common.html --- 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'), } %} diff -r b84d20af0ed3 -r 80cf52fbcc40 sat_templates/default/event/admin.html --- /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 %} +
+

{% 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 %} +
+

{% 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')}}
+
+{% endif %} + +
+

{% 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 %} +
+ +
+

{% 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 b84d20af0ed3 -r 80cf52fbcc40 sat_templates/default/event/counter.html --- /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 %} +
+ {% trans %} + {{days_left}} day left + {% pluralize %} + {{days_left}} days left + {% endtrans %} +
+ {% else %} +
{% trans %}the event is finished{% endtrans %}
+ {% endif %} + +{% endif %} diff -r b84d20af0ed3 -r 80cf52fbcc40 sat_templates/default/event/create.html --- /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 %} +
+{% 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, + 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 %} +
+{% endblock body %} diff -r b84d20af0ed3 -r 80cf52fbcc40 sat_templates/default/event/invitation.html --- 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 %} -
+

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

{% trans %}You have been invited to participate to an event{% endtrans %}

{% if event.image is defined %} @@ -9,14 +9,7 @@ {% endif %}
-{% if days_left is defined %} - {% if days_left > 0 %} -
{% trans %}{{days_left}} days left{% endtrans %}
- {% else %} -
{% trans %}the event is finished{% endtrans %}
- {% endif %} - -{% endif %} +{% include 'event/counter.html' %} {% include 'event/attendance.html' %} diff -r b84d20af0ed3 -r 80cf52fbcc40 sat_templates/default/event/overview.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 %} +
+

{% trans %}There is not events discovery yet, this will come in the future.{% endtrans %}

+
+{% 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 %} +

+ +{% endif %} +{% endblock body %}