From 401e1663275b179fa2d3505cd85e8572054865e9 Mon Sep 17 00:00:00 2001 From: "nrvikas@gmail.com" Date: Thu, 4 Jul 2019 12:09:57 +1000 Subject: [PATCH] [SDESK-4436] Template for downloading events for courts listing added entry to planning_export_templates data file --- server/data/planning_export_templates.json | 30 ++++++++++++++------- server/templates/event_courts_download.html | 2 ++ 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 server/templates/event_courts_download.html diff --git a/server/data/planning_export_templates.json b/server/data/planning_export_templates.json index 5b647b41c..9413385b1 100644 --- a/server/data/planning_export_templates.json +++ b/server/data/planning_export_templates.json @@ -1,10 +1,22 @@ -[{ - "_id" : "planning_outlook", - "name" : "outlook", - "type" : "planning", - "data" : { - "slugline" : "Outlook", - "body_html_template" : "outlook_planning_template.html" +[ + { + "_id" : "planning_outlook", + "name" : "outlook", + "type" : "planning", + "data" : { + "slugline" : "Outlook", + "body_html_template" : "outlook_planning_template.html" + }, + "label" : "Outlook" }, - "label" : "Outlook" -}] + { + "_id" : "event_courts_download", + "name" : "event_courts_download", + "type" : "event", + "data" : { + "template_file" : "event_courts_download.html" + }, + "label" : "Courts", + "download" : true + } +] diff --git a/server/templates/event_courts_download.html b/server/templates/event_courts_download.html new file mode 100644 index 000000000..4600281d3 --- /dev/null +++ b/server/templates/event_courts_download.html @@ -0,0 +1,2 @@ +{% for item in items %}{{ item['dates']['start'].strftime('%H%M') }} - {{ item['name'] }}.{% if (item.get('location') or [])|length > 0 %}{% for l in item.location %} {{ l.name }}{% endfor %}{% endif %} +{% endfor %} \ No newline at end of file