camp/content/templates/detail.html
2017-12-09 13:51:56 +01:00

111 lines
3.0 KiB
HTML

{% extends 'base.html' %}
{% block content %}
{% if request.user.is_staff %}
<div class="admin-menu">
<a href="{% url 'admin:content_content_change' content.id %}">Edit</a>
</div>
{% endif %}
{% if content.image_url %}
<img src="{{ content.image_url }}" width="75%">
{% endif %}
<div class="content_detail">
<h1>{{ content.title }}</h1>
<h4>{{ content.header|safe }} </h4>
<p>{{ content.body|safe }}</p>
{% if content.optbtn2 and content.opttext2 %}
<div class="part2">
<h4>{{ content.optbtn2|safe }} </h4>
<p>{{ content.opttext2|safe|linebreaks }}</p>
</div>
{% endif %}
{% if content.optbtn3 and content.opttext3 %}
<div class="part3">
<h4>{{ content.optbtn3|safe }} </h4>
<p>{{ content.opttext3|safe|linebreaks }}</p>
</div>
{% endif %}
{% if content.schedule %}
<div class="schedule">
<h4>{{content.schedulebutton|default:"Schedule"}}</h4>
<p>{{ content.schedule|safe|linebreaks }}</p>
</div>
{% endif %}
{% if content.parent or content.children.exists %}
<div class="context">
<b>In This Event</b>:
<ul>
{% if content.parent and content.parent.title %}
<li><a href="{{content.parent.get_absolute_url}}">{{content.parent.title}}</a></li>
<li><ul>
{% for node in content.parent.children.all %}
{% if node.shortname and node.published %}
<li>
{% if node == content %}
{{node.title}}
{% else %}
<a href="{{node.get_absolute_url}}">{{ node.title }}</a>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul><li>
{% elif content.children.exists %}
<li>{{content.title}}</li>
<li><ul>
{% for node in content.children.all %}
{% if node.shortname and node.published %}
<li>
<a href="{{node.get_absolute_url}}">{{ node.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul><li>
{% else %}
<li>{{content.title}}</li>
{% endif %}
</ul>
</div>
{% endif %}
{% if content.resources.exists %}
{% if content.links.exists %}
<div class="links">
<b>Links:</b>
<ul>
{% for res in content.links %}
<li>
<a href="{{res.get_absolute_url}}">{{res.description|default:res.href}}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if content.images.exists %}
<div class="images">
<b>Images:</b> <br>
{% for res in content.images %}
<div>
{% if res.is_image %}
<img src="{{res.get_absolute_url}}">
{% elif res.is_audio %}
<audio controls src="{{res.get_absolute_url}}"></audio>
{% elif res.is_video %}
<video controls src="{{res.get_absolute_url}}"></video>
{% else %}
<a href="{{res.get_absolute_url}}">{{res.description|default:res.href}}</a>
{% endif %}
</div>
{% endfor %}
<br clear="all">
</div>
{% endif %}
{% endif %}
</div>
{% endblock %}