-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add components to allow lists of distinct sessions/talks. viewMode for these topiclists is dw:Topiclist Update layout to select topiclist component if specified in model.
- Loading branch information
1 parent
1f7ab95
commit d7dd7bc
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{% include strings.html %} | ||
{%- assign title = include.title -%} | ||
{%- assign view = include.view -%} | ||
|
||
{% capture session_query %} | ||
SELECT DISTINCT ?session | ||
WHERE { | ||
{ | ||
?session dct:title "{{- title -}}"@en ; | ||
schema:location ?location ; | ||
dct:date ?date ; | ||
FILTER ({{ view.filter }}) | ||
} | ||
} ORDER BY ?date ?start ?end ?location | ||
{% endcapture %} | ||
|
||
{% capture metainformation_query %} | ||
SELECT DISTINCT ?start ?end ?location | ||
WHERE { | ||
{ | ||
?session dct:title "{{- title -}}"@en ; | ||
schema:location ?location ; | ||
dct:date ?date ; | ||
schema:startTime ?start ; | ||
schema:endTime ?end . | ||
FILTER ({{ view.filter }}) | ||
} | ||
} ORDER BY ?date ?start ?end ?location | ||
{% endcapture %} | ||
|
||
{% assign sessions = view.resource | sparql_query: session_query %} | ||
|
||
{%- if sessions.first -%} | ||
{%- assign title = sessions.first.session | rdf_property: "dct:title", site.language -%} | ||
{% assign metainformation = sessions.first.session | sparql_query: metainformation_query %} | ||
{%- assign description = sessions.first.session | rdf_property: "dct:description", site.language -%} | ||
<section class="timetable-unit" id="topic"> | ||
<header> | ||
<h3> | ||
{{ metainformation.first.start | date: "%H:%M" }} | ||
</h3> | ||
</header> | ||
<div> | ||
<h4> | ||
{{ title }} | ||
</h4> | ||
{%- for metadata in metainformation -%} | ||
{%- assign location_title = metadata.location | rdf_property: "dct:title", site.language -%} | ||
{%- unless location_title -%} | ||
{%- assign location_title = metadata.location | rdf_property: "dct:title" -%} | ||
{%- endunless -%} | ||
<p class="meta"> | ||
<time datetime="{{ metadata.start | date: "%H:%M" }}">{{ metadata.start | date: "%H:%M" }}</time> - <time datetime="{{ metadata.end | date: "%H:%M" }}">{{ metadata.end | date: "%H:%M" }}</time> <span>|</span> {{ location_title }} <span>|</span> {% include components/available_language.html resource=sessions.first.session %} | ||
</p> | ||
{%- endfor -%} | ||
<p>{{- description -}}</p> | ||
</div> | ||
</section> | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% assign view = include.view %} | ||
|
||
{% capture sessions_query %} | ||
SELECT DISTINCT ?title # (min(?q_session) as ?session) | ||
WHERE { | ||
{ | ||
?resourceUri schema:subEvent ?q_session ; | ||
} union { | ||
?resourceUri schema:subEvent ?subEvent . | ||
?subEvent schema:subEvent ?q_session . | ||
} | ||
?q_session dct:title ?title ; | ||
schema:startTime ?start . | ||
{ | ||
?q_session schema:location ?location ; | ||
dct:date ?date . | ||
FILTER NOT EXISTS {?q_session site:track ?pause } | ||
FILTER ({{ view.filter }}) | ||
} FILTER(lang(?title) = "en") | ||
} ORDER BY ?start | ||
#} GROUP BY ?title ORDER BY ?start # GROUP BY does not work ruby | ||
{% endcapture %} | ||
|
||
{% assign sessions = view.resource | sparql_query: sessions_query %} | ||
|
||
{%- if sessions.first -%} | ||
{%- for session_row in sessions -%} | ||
{%- include components/program_topic.html title=session_row.title view=view-%} | ||
{%- endfor -%} | ||
{%- else -%} | ||
{%- assign program_empty = true -%} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters