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