Commit d8c0d89a authored by gijs's avatar gijs
Browse files

Display of trajectories, links from trajectory overview.

parent 8e0a6879
......@@ -182,10 +182,15 @@ class LinkField(object):
# return None
@property
def target (self):
if self.value:
return self.value.target
"""
Field for multiple links, every link will be a single linkfield.
"""
class MultiLinkField(LinkField):
class MultiLinkField(object):
def __init__ (self, contentType = None, reverse = None):
self.contentType = contentType
self.value = []
......@@ -248,6 +253,11 @@ class ReverseLinkField(object):
# Simplify?
link.source.registerMetadataField(self.name, self)
@property
def target (self):
if self.value:
return self.value.target
class ReverseMultiLinkField(ReverseLinkField):
def __init__ (self, name):
self.name = name
......@@ -756,8 +766,8 @@ class ProgrammeItem (Model):
labelField = 'title'
def link (self):
if not callable(self.event):
return self.event.value[0].target.link + '#' + self.key
if self.event.target:
return self.event.target.link + '#' + self.key
else:
return ''
......
......@@ -13,10 +13,10 @@
<ul>
{% if note.programmeItem %}
<li><a href="../activities.html">Activities</a></li>
<li><a href="{{ note.programmeItem.link }}">{{ note.programmeItem }}</a></li>
<li><a href="{{ note.programmeItem.target.link }}">{{ note.programmeItem }}</a></li>
{% elif note.event %}
<li><a href="../activities.html">Activities</a></li>
<li><a href="{{ note.event.link }}">{{ note.event }}</a></li>
<li><a href="{{ note.event.target.link }}">{{ note.event }}</a></li>
{% endif %}
<li>{{ note }}</li>
</ul>
......
......@@ -10,9 +10,9 @@
</nav>
<h1 class="produser">{% if produser.name %}{{ produser.name }}{% else %}{{ produser.produser }}{% endif %}</h1>
{% if produser.trajectories %}
{% for trajectory in produser.trajectories %}
{% for trajectory in produser.trajectories.targets %}
<h2>Trajectory</h2>
{{ trajectory.content}}
{{ trajectory.content }}
{% endfor %}
{% endif %}
......@@ -24,7 +24,7 @@
{% if produser.events %}
<h2>Activities</h2>
<ul class="simplelist">
{% for event in produser.events|link_target_iterator %}
{% for event in produser.events.targets %}
<li>
<section class="event-preview">
<a href="{{ event.link }}">{{ event }}</a>
......@@ -38,7 +38,7 @@
{% if produser.bibliography %}
<h2>Bibliography</h2>
<ul class="simplelist">
{% for entry in produser.bibliography.value %}
{% for entry in produser.bibliography.targets %}
<li>{{ entry }}</li>
{% endfor %}
</ul>
......@@ -47,7 +47,7 @@
{% if produser.video %}
<h2>Video</h2>
<ul class="simplelist">
{% for video in produser.video %}
{% for video in produser.video.targets %}
<li>
<video controls>
<source type="{{ video.type }}" src="{{ video.video }}">
......@@ -60,7 +60,7 @@
{% if produser.audio %}
<h2>Audio</h2>
<ul class="simplelist">
{% for audio in produser.audio %}
{% for audio in produser.audio.targets %}
<li>
<audio controls>
<source type="{{ audio.type }}" src="{{ audio.audio }}">
......@@ -72,7 +72,7 @@
{% if produser.notes %}
<h2>Notes</h2>
<ul>
{% for note in produser.notes %}
{% for note in produser.notes.targets %}
<li>
<a href="{{ note.link }}" class="note">{{ note }}</a>
</li>
......@@ -83,7 +83,7 @@
{% if produser.events_participant %}
<h2>Activities (participant)</h2>
<ul class="simplelist">
{% for event in produser.events_participant %}
{% for event in produser.events_participant.targets %}
<li>
<section class="event-preview">
<a href="{{ event.link }}">{{ event }}</a>
......@@ -96,7 +96,7 @@
{% if produser.notes_participant %}
<h2>Notes (participant)</h2>
<ul>
{% for note in produser.notes_participant %}
{% for note in produser.notes_participant.targets %}
<li>
<a href="{{ note.link }}" class="note">{{ note }}</a>
</li>
......
......@@ -11,7 +11,7 @@
{% for trajectory in trajectories %}
<section class="trajectory">
<h2 class="produser">
<a href="{{ trajectory.produser.link }}">{{ trajectory.produser }}</a>
<a href="{{ trajectory.produser.target.link }}">{{ trajectory.produser }}</a>
</h2>
{% if trajectory.summary %}
{{ trajectory.summary }}
......
Supports Markdown
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