Rename resource-detail template to be more correct

This commit is contained in:
kez 2022-09-06 15:09:06 -07:00 committed by kezzle
parent e79e0d3c83
commit 667e3345e2
3 changed files with 112 additions and 111 deletions

View File

@ -7,7 +7,7 @@ enabled = yes
per_page = 10
[fields.html]
default = resource-detail.html
default = training-guide.html
[fields.title]
label = Title

View File

@ -1,110 +0,0 @@
{% 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) %}
<style>
#sample-slides td:not(:first-child) {
padding-right: 0;
}
</style>
<div class="row pt-5">
{% include 'sidenav.html' %}
<div class="col-sm-12 col-xs-12 ml-sm-auto col-md-9 col-lg-9 {{ bag('alternatives', this.alt, 'order') }}">
<div>
<img src="{{ resource['cover'] | url }}" class="image-thumb-200px mb-5" alt="{{ this.title }}">
<h1 class="mb-5">{{ resource['name'] }}</h1>
<div>
<table class="resource-table mb-5">
<tr>
<td>
<span class="text-muted h5 font-weight-600">{{ _('Maintained by') }}</span>
</td>
<td>
<span class="h5 font-weight-600">{{ resource['author'] }}</span>
</td>
</tr>
<tr>
<td>
<span class="text-muted h5 font-weight-600">{{ _('Last updated') }}</span>
</td>
<td>
<span class="h5 font-weight-600">{{ resource['date'] }}</span>
</td>
</tr>
<tr>
<td>
<span class="text-muted h5 font-weight-600">{{ _('Estimated time') }}</span>
</td>
<td>
<span class="h5 font-weight-600">{{ this.estimated_time or 'FIXME: NO TIME ESTIMATE' }}</span>
</td>
</tr>
</table>
<p class="mb-5">{{ resource['description'] }}</p>
{% if this.objectives %}
<div class="mb-5">
<h4>{{ _('Objectives') }}</h4>
<ul>
{% for objective in this.objectives %}
<li>{{ objective }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if this.external_sources %}
<div class="mb-5">
<h4>{{ _('External reading sources') }}</h4>
<ul>
{% for external_source in this.external_sources %}
<li>{{ external_source }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if this.sample_slides %}
<h4 class="mb-5">{{ _('Download sample slides') }}</h4>
<table class="resource-table mb-5" id="sample-slides">
{% for slide in this.sample_slides.blocks %}
<tr class="h5 font-weight-600">
<td>
<span class="text-muted">{{ slide.language }}</span>
</td>
{% if slide.view_link %}
<td>
<a href="{{ slide.view_link }}"><button type="button" class="btn btn-sm btn-primary font-weight-600 h5">View</button></a>
</td>
{% endif %}
{% if slide.pdf_link %}
<td>
<button type="button" class="btn btn-sm btn-outline-primary font-weight-600 h5">PDF</button>
</td>
{% endif %}
{% if slide.odp_link %}
<td>
<button type="button" class="btn btn-sm btn-outline-primary font-weight-600 h5">ODP</button>
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% endif %}
{% if this.topics %}
<div class="mb-5">
<h4>{{ _('Topics') }}</h4>
<p>
{% for topic in this.topics %}
<span>{{ topic }}</span>
{%- if loop.index != this.topics|length -%}
{{ ', ' }}
{% endif %}
{% endfor %}
</p>
</div>
{% endif %}
</div>
</div>
<div class="d-flex my-4">
</div>
<hr class="mb-5 mt-0">
<h2 class="text-primary">{{ _('Join the Conversation') }}</h2>
</div>
</div>

View File

@ -0,0 +1,111 @@
{% 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) %}
<style>
#sample-slides td:not(:first-child) {
padding-right: 0;
}
</style>
<div class="row pt-5">
{% include 'sidenav.html' %}
<div class="col-sm-12 col-xs-12 ml-sm-auto col-md-9 col-lg-9 {{ bag('alternatives', this.alt, 'order') }}">
<div>
<img src="{{ resource['cover'] | url }}" class="image-thumb-200px mb-5" alt="{{ this.title }}">
<h1 class="mb-5">{{ resource['name'] }}</h1>
<div>
<table class="resource-table mb-5">
<tr>
<td>
<span class="text-muted h5 font-weight-600">{{ _('Maintained by') }}</span>
</td>
<td>
<span class="h5 font-weight-600">{{ resource['author'] }}</span>
</td>
</tr>
<tr>
<td>
<span class="text-muted h5 font-weight-600">{{ _('Last updated') }}</span>
</td>
<td>
<span class="h5 font-weight-600">{{ resource['date'] }}</span>
</td>
</tr>
<tr>
<td>
<span class="text-muted h5 font-weight-600">{{ _('Estimated time') }}</span>
</td>
<td>
<span class="h5 font-weight-600">{{ this.estimated_time or 'FIXME: NO TIME ESTIMATE' }}</span>
</td>
</tr>
</table>
</div>
<p class="mb-5">{{ resource['description'] }}</p>
{% if this.objectives %}
<div class="mb-5">
<h4>{{ _('Objectives') }}</h4>
<ul>
{% for objective in this.objectives %}
<li>{{ objective }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if this.external_sources %}
<div class="mb-5">
<h4>{{ _('External reading sources') }}</h4>
<ul>
{% for external_source in this.external_sources %}
<li>{{ external_source }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if this.sample_slides %}
<h4 class="mb-5">{{ _('Download sample slides') }}</h4>
<table class="resource-table mb-5" id="sample-slides">
{% for slide in this.sample_slides.blocks %}
<tr class="h5 font-weight-600">
<td>
<span class="text-muted">{{ slide.language }}</span>
</td>
{% if slide.view_link %}
<td>
<a href="{{ slide.view_link }}"><button type="button" class="btn btn-sm btn-primary font-weight-600 h5">View</button></a>
</td>
{% endif %}
{% if slide.pdf_link %}
<td>
<button type="button" class="btn btn-sm btn-outline-primary font-weight-600 h5">PDF</button>
</td>
{% endif %}
{% if slide.odp_link %}
<td>
<button type="button" class="btn btn-sm btn-outline-primary font-weight-600 h5">ODP</button>
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% endif %}
{% if this.topics %}
<div class="mb-5">
<h4>{{ _('Topics') }}</h4>
<p>
{% for topic in this.topics %}
<span>{{ topic }}</span>
{%- if loop.index != this.topics|length -%}
{{ ', ' }}
{% endif %}
{% endfor %}
</p>
</div>
{% endif %}
</div>
</div>
<div class="d-flex my-4">
</div>
<hr class="mb-5 mt-0">
<h2 class="text-primary">{{ _('Join the Conversation') }}</h2>
</div>
</div>