Commit 43e637c1 authored by gijs's avatar gijs
Browse files

Moved reflections to a seperate content type

parent a3f8f9d5
......@@ -101,7 +101,8 @@ def generate ():
os.mkdir(os.path.join(outputdir, 'tags'))
os.mkdir(os.path.join(outputdir, 'notes'))
os.mkdir(os.path.join(outputdir, 'questions'))
os.mkdir(os.path.join(outputdir, 'trajectories'))
# os.mkdir(os.path.join(outputdir, 'trajectories'))
os.mkdir(os.path.join(outputdir, 'reflections'))
models = parse_pads()
......@@ -117,6 +118,7 @@ def generate ():
notes = collectionFor('notes')
trajectories = collectionFor('trajectory')
questions = collectionFor('question')
reflections = collectionFor('reflection')
def getProduserSortKey (produser):
attr = try_attributes(produser, ['sortname', 'name', 'produser'])
......@@ -197,12 +199,13 @@ def generate ():
'trajectories.html',
{
'trajectories': sorted_trajectories,
'grouped_trajectories': grouped_trajectories
'grouped_trajectories': grouped_trajectories,
'reflections': sorted(reflections.models, getLabelAsSortKey)
})
for trajectory in trajectories.models:
if trajectory.title.value:
output(os.path.join(outputdir, trajectory.prefix, '{}.html'.format(keyFilter(trajectory.title))), 'trajectory.html', { 'trajectory': trajectory })
# for trajectory in trajectories.models:
# if trajectory.title.value:
# output(os.path.join(outputdir, trajectory.prefix, '{}.html'.format(keyFilter(trajectory.title))), 'trajectory.html', { 'trajectory': trajectory })
## Questions
output(
......@@ -224,7 +227,7 @@ def generate ():
generate_single_pages(filter(lambda e: not hasattr(e, 'programmeItems') or not e.programmeItems, events.models), 'event.html', outputdir, lambda event: { 'event': event })
generate_single_pages(filter(lambda e: hasattr(e, 'programmeItems') and e.programmeItems, events.models), 'event-with-programme-items.html', outputdir, lambda event: { 'event': event, 'groupedProgrammeItems': groupedProgrammeItems(event)})
generate_single_pages(notes.models, 'note.html', outputdir, lambda note: { 'note': note })
generate_single_pages(reflections.models, 'reflection.html', outputdir, lambda reflection: { 'reflection': reflection })
output(os.path.join(outputdir, 'activities.html'), 'activities.html', { 'events': sorted(events.models, key=datesorter, reverse=True) })
......
......@@ -837,6 +837,25 @@ class Trajectory (Model):
'title': fields.Single(fields.StringField())
}
@property
def link (self):
# if self.title.value:
# return os.path.join(SITE_URL, self.prefix, '{}.html'.format(keyFilter(self.title.value)))
# else:
return self.produser.target.link
class Reflection (Model):
contentType = 'reflection'
prefix = 'reflections'
def _metadataFields (self):
return {
'produser': linkMultiReverse('produser', 'reflections'),
'tags': multiLinkMultiReverse('tag', 'reflections'),
'summary': fields.Single(fields.MarkdownField()),
'title': fields.Single(fields.StringField())
}
@property
def link (self):
if self.title.value:
......@@ -1019,20 +1038,21 @@ class ContentType (object):
# Might also need to include the outputfolder here
# rather than on the model?
contentTypes = {
'audio': ContentType(Audio, InstantiatingCollection),
'bibliography': ContentType(Bibliography, InstantiatingCollection),
'event': ContentType(Event),
'external-project': ContentType(ExternalProject, InstantiatingCollection),
'image': ContentType(Image, InstantiatingCollection),
'notes': ContentType(Note),
'pad': ContentType(Pad),
'page': ContentType(Page),
'programme-item': ContentType(ProgrammeItem),
'produser': ContentType(Produser),
'reflection': ContentType(Reflection),
'trajectory': ContentType(Trajectory),
'pad': ContentType(Pad),
'page': ContentType(Page),
'tag': ContentType(Tag, InstantiatingCollection),
'bibliography': ContentType(Bibliography, InstantiatingCollection),
'video': ContentType(Video, InstantiatingCollection),
'audio': ContentType(Audio, InstantiatingCollection),
'image': ContentType(Image, InstantiatingCollection),
'text': ContentType(Text),
'notes': ContentType(Note),
'external-project': ContentType(ExternalProject, InstantiatingCollection),
'question': ContentType(Question, InstantiatingCollection)
}
......
{% extends "generator_base.html" %}
{% block title %}Caveat → Trajectories → {{ trajectory.title|striptags }}{% endblock %}
{% block title %}Caveat → Trajectories → Reflections → {{ reflection.title|striptags }}{% endblock %}
{% block content %}
<nav class="breadcrumbs">
<ul>
<li><a href="../trajectories.html">Trajectories</a></li>
<li>{{ trajectory.title }}</li>
<li><a href="../trajectories.html#reflections">Reflections</a></li>
<li>{{ reflection.title }}</li>
</ul>
</nav>
<section class="long-text">
<h1>{{ trajectory.title }}</h1>
{{ trajectory.content }}
<h1>{{ reflection.title }}</h1>
{{ reflection.content }}
</section>
{% endblock %}
\ No newline at end of file
......@@ -15,14 +15,15 @@
Artist trajectories
{% elif category == 'designertrajectory' %}
Designer trajectories
{% elif category == 'reflection' %}
Reflections
{% else %}
{{ category}}
{% endif %}
</a>
</li>
{% endfor %}
{% if relflections %}
<a href="#reflections">Reflections</a>
{% endif %}
</ul>
</nav>
{% for category, trajectories in grouped_trajectories %}
......@@ -66,4 +67,27 @@
</section>
</section>
{% endfor %}
{% if reflections %}
<section id="reflections" class="trajectory-list">
<h3>Reflections</h3>
<p>
Critial considerations by the <em>Caveat</em> research team and 'dramaturgs' , and by invited guest writers put the research trajectories in different perspectives from their art historical, legal, sociological and other backgrounds.
</p>
<section class="trajectory-list--grid">
{% for reflection in reflections %}
<section class="trajectory--item">
<h2>
<a href="{{ reflection.link }}">{{ reflection }}</a>
</h2>
{% if reflection.summary.value %}
{{ reflection.summary }}
{% else %}
{{ reflection.content|truncatewords_html:60 }}
{% endif %}
<a href="{{ reflection.link }}" class="read-further">read further</a>
</section>
{% endfor %}
</section>
</section>
{% endif %}
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment