factor out preview content

This commit is contained in:
root 2017-12-18 14:54:39 +00:00
parent 0d95e04598
commit 28338bbe5e
4 changed files with 48 additions and 52 deletions

View File

@ -27,26 +27,7 @@
<div class="large-4 medium-4 columns"> <div class="large-4 medium-4 columns">
{% if events.children.all %} {% include "related.html" with related=events.children.all %}
<h4 class="sidebar-h4"> Related </h4>
{% for child in events.children.all %}
<div class="row related-row">
<div class="small-6 columns">
<img src="{{ child.image_url }}">
</div>
<div class="small-6 columns">
<h6><a href="{{ child.get_absolute_url }}" class="sidebar-title"> {{child}} </a> </h6>
<h6 class="sidebar-date">
<font color="#ef4e5c">
<b> {{ child.datestart }} {% if child.dateend %} - {{child.dateend}} {% endif %} </b>
</font>
{% if content.place %}<br/>{{content.place}}{% endif%}
</h6>
</div>
</div>
{% endfor %}
{% endif %}
<h4 class="sidebar-h4">Events </h4> <h4 class="sidebar-h4">Events </h4>
<div class="row"> <div class="row">

View File

@ -0,0 +1,19 @@
<div class="row related-row">
<div class="small-6 columns">
{% if content.image_url %}
<img src="{{ content.image_url }}">
{% endif %}
</div>
<div class="small-6 columns">
<h6><a href="{{ content.get_absolute_url }}" class="sidebar-title"> {{content.title}} </a> </h6>
<h6 class="sidebar-date">
{% if content.type.name == 'events' %}
<font color="#ef4e5c">
<b> {{ content.datestart }} {% if content.dateend %} - {{content.dateend}} {% endif %} </b>
</font>
{% if content.place %}<br/>{{content.place}}{% endif%}
{% endif %}
</h6>
<p> {{ content.formatted_teaser }} </p>
</div>
</div>

View File

@ -19,37 +19,25 @@
{% if latest_content_list %} {% if latest_content_list %}
<div class="large-4 medium-4 columns"> <div class="large-4 medium-4 columns">
{% if projects.children.all %} {% include "related.html" with related=projects.children.all %}
<h4 class="sidebar-h4"> Related </h4> <h4 class="sidebar-h4">Projects </h4>
{% for child in projects.children.all %} <div class="row">
<div class="row related-row">
<div class="small-6 columns">
<a href="{{ child.get_absolute_url }}"> <img src="{{ child.image_url }}"> </a>
</div>
<div class="small-6 columns">
<h6><a href="{{ child.get_absolute_url }}" class="sidebar-title"> {{child}} </a> </h6>
</div>
</div>
{% endfor %}
{% endif %}
<h4 class="sidebar-h4">Projects </h4>
<div class="row">
{% for projects in latest_content_list %} {% for projects in latest_content_list %}
<div class="row right-items"> <div class="row right-items">
<div class="small-6 columns"> <div class="small-6 columns">
<a href="{{ projects.get_absolute_url }}"> <img src="{{ projects.image_url }}"> </a> <a href="{{ projects.get_absolute_url }}"> <img src="{{ projects.image_url }}"> </a>
</div> </div>
<div class="small-6 columns"> <div class="small-6 columns">
<a href="{{ projects.get_absolute_url }}" class="sidebar-title">{{ projects.title }}</a> <a href="{{ projects.get_absolute_url }}" class="sidebar-title">{{ projects.title }}</a>
<p> {{projects.formatted_teaser}} </p> <p> {{projects.formatted_teaser}} </p>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
{% else %} {% else %}
<p>No projects.</p> <p>No projects.</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -0,0 +1,8 @@
{% if related %}
<h4 class="sidebar-h4"> Related </h4>
{% for content in related %}
{% include "preview.html" %}
{% endfor %}
<br>
<br>
{% endif %}