camp/content/templates/results.html

118 lines
4.4 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<div class="row">
<div class="row">
<div class="small-4 small-offset-2 columns results-title">
{% if section %}
<h3> {{section }}</h3>
{% else %}
<h3> Search results </h3>
{% endif %}
</div>
</div>
{% for row in content %}
{% if row.type.name == 'news' %}
<div class="row">
<div class= "small-4 small-offset-2 columns">
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{row.datestart}} </b>
{{ row.title }} <br />
{{ row.formatted_header|striptags|safe }} </font>
</h6>
</div>
</div>
{% elif row.type.name == 'events' %}
<div class="row results">
<div class="small-4 small-offset-2 columns">
{% if row.image_url %}
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
{% endif %}
</div>
<div class="small-4 end columns">
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ row.datestart }} {% if row.dateend %} - {{row.dateend}} {% endif %} </b></font>
{% if row.place %}<br/> {{row.place}} {% endif%}</h6>
<p> {{row.formatted_teaser}} </p>
<a href="{{ row.get_absolute_url }}">read more</a> </p>
</div>
</div>
{% elif row.type.name == 'projects' %}
<div class="row results">
<div class="small-4 small-offset-2 columns">
{% if row.image_url %}
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
{% endif %}
</div>
<div class="small-4 end columns">
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
<p> {{row.formatted_teaser}} </p>
<a href="{{ row.get_absolute_url }}">read more</a> </p>
</div>
</div>
{% elif row.type.name == 'works' %}
<div class="row results">
<div class="small-4 small-offset-2 columns">
{% if row.image_url %}
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
{% endif %}
</div>
<div class="small-4 end columns">
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
<p> {{row.formatted_teaser}} </p>
<a href="{{ row.get_absolute_url }}">read more</a> </p>
</div>
</div>
{% elif row.type.name == 'texts' %}
<div class="row results">
<div class="small-4 small-offset-2 columns">
{% if row.image_url %}
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
{% endif %}
</div>
<div class="small-4 end columns">
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
<p> {{row.formatted_teaser}} </p>
<a href="{{ row.get_absolute_url }}">read more</a> </p>
</div>
</div>
{% else %}
{% if request.user.is_staff %}
<div class="row">
<div class="small-4 small-offset-2 columns">
Add view for content type: {{row.type}}
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
<br>
<br>
{% if content.has_other_pages %}
<div class="row">
<div class="small-4 small-offset-4 columns">
<ul class="pagination">
{% if content.has_previous %}
<li><a href="?{{ base_query }}&page={{ content.previous_page_number }}">&laquo;</a></li>
{% else %}
<li class="disabled"><span>&laquo;</span></li>
{% endif %}
{% for i in content.paginator.page_range %}
{% if content.number == i %}
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
{% else %}
<li><a href="?{{ base_query }}page={{ i }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if content.has_next %}
<li><a href="?{{ base_query }}page={{ content.next_page_number }}">&raquo;</a></li>
{% else %}
<li class="disabled"><span>&raquo;</span></li>
{% endif %}
</ul>
</div>
</div>
{% endif %}
</div>
{% endblock %}