From e79e0d3c83a46aa1c962d1a946ccc80c8b732196 Mon Sep 17 00:00:00 2001 From: kez Date: Thu, 1 Sep 2022 21:02:20 -0700 Subject: [PATCH] Add sample slides element --- flowblocks/sample_slide.ini | 22 ++++++++++++++++++++++ models/resource.ini | 5 +++++ templates/resource-detail.html | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 flowblocks/sample_slide.ini diff --git a/flowblocks/sample_slide.ini b/flowblocks/sample_slide.ini new file mode 100644 index 00000000..47e56063 --- /dev/null +++ b/flowblocks/sample_slide.ini @@ -0,0 +1,22 @@ +[block] +name = Sample Slides + +[fields.language] +label = Language +type = string +translate = False + +[fields.view_link] +label = View Link +type = string +translate = False + +[fields.pdf_link] +label = PDF Link +type = string +translate = False + +[fields.odp_link] +label = ODP Link +type = string +translate = False diff --git a/models/resource.ini b/models/resource.ini index cc29f14d..f18ef29a 100644 --- a/models/resource.ini +++ b/models/resource.ini @@ -68,3 +68,8 @@ type = strings [fields.external_sources] label = External Reading Sources type = strings + +[fields.sample_slides] +label = External Reading Sources +type = flow +flowblocks = sample_slide diff --git a/templates/resource-detail.html b/templates/resource-detail.html index 63d8c6b6..450c0588 100644 --- a/templates/resource-detail.html +++ b/templates/resource-detail.html @@ -1,6 +1,11 @@ {% set sidenav_items = this.parent.parent.children %} {% set resource_name = this.resource_name or this._path.split('/')[-1][:-('-guide'|length)] %} {% set resource = bag('community-training-materials', resource_name) %} +
{% include 'sidenav.html' %}
@@ -55,7 +60,33 @@
{% endif %} -

{{ _('Download sample slides') }}

+ {% if this.sample_slides %} +

{{ _('Download sample slides') }}

+ + {% for slide in this.sample_slides.blocks %} + + + {% if slide.view_link %} + + {% endif %} + {% if slide.pdf_link %} + + {% endif %} + {% if slide.odp_link %} + + {% endif %} + + {% endfor %} +
+ {{ slide.language }} + + + + + + +
+ {% endif %} {% if this.topics %}

{{ _('Topics') }}