changeset 19:422c54e0204a

event: adaptation to changes in backend/Libervia + background_image can now be specified in template data
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 12:59:43 +0200
parents d4a8afa7b590
children 8fa2fd2e928e
files default/base/base.html default/event/attendance.html default/event/invitation.html
diffstat 3 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/default/base/base.html	Thu May 04 01:00:29 2017 +0200
+++ b/default/base/base.html	Fri May 19 12:59:43 2017 +0200
@@ -13,6 +13,16 @@
             <link rel='stylesheet' type="text/css" href='{{root_path}}{{css_file}}'>
         {% endfor %}
     {% endif %}
+    {% if background_image is defined %}
+        {# Q&D workaround to implement dynamic background-image
+           it should be replaced by a better mechanism in the future, avoid using it #}
+        <style type="text/css">
+            html {
+                background-image: url('{{background_image}}');
+                background-size: 15em;
+            }
+        </style>
+    {% endif %}
 </head>
 <body>
     <div id="body">
--- a/default/event/attendance.html	Thu May 04 01:00:29 2017 +0200
+++ b/default/event/attendance.html	Fri May 19 12:59:43 2017 +0200
@@ -5,13 +5,13 @@
     <p class="poll_instructions">Please indicate if you plan to attend the event:</p>
     {% call form.form() %}
         {{ field.meta("type", "attendance") }}
-        {{ field.meta("service", event_service) }}
-        {{ field.meta("node", event_node) }}
+        {{ field.meta("service", event.invitees_service) }}
+        {{ field.meta("node", event.invitees_node) }}
         <div class="attending">
-            {{ field.choices("attend", ("yes", "no", "maybe"), checked=event.attend) }}
+            {{ field.choices("attend", ("yes", "no", "maybe"), checked=invitee.attend) }}
         </div>
         <div class="guests">
-            {{ field.int("guests", label="How many people will come (including you)?", init=event.get("guests", 1)) }}
+            {{ field.int("guests", label="How many people will come (including you)?", init=invitee.get("guests", 1)) }}
         </div>
         <div class="submit">
             {{ field.submit() }}
--- a/default/event/invitation.html	Thu May 04 01:00:29 2017 +0200
+++ b/default/event/invitation.html	Fri May 19 12:59:43 2017 +0200
@@ -4,8 +4,8 @@
 <div class='invitation_header box'>
     <h1>Welcome {{name}}</h1>
     <p class='instructions'>You have been invited to participate to an event</p>
-    {% if event.picture is defined %}
-        <p><img id='event_picture' src="{{event.picture}}"></p>
+    {% if event.image is defined %}
+        <p><img id='event_picture' src="{{event.image}}"></p>
     {% endif %}
 </div>