camp/content/templates/results.html

72 lines
2.5 KiB
HTML
Raw Normal View History

2017-12-18 12:54:04 +00:00
{% extends 'base.html' %}
{% block content %}
<div class="row">
2017-12-19 09:40:14 +00:00
<div class="row">
<div class="small-4 small-offset-2 columns results-title">
<h3> Search results </h3>
</div>
</div>
2017-12-18 12:54:04 +00:00
{% for content in results %}
{% if content.type.name == 'news' %}
<div class="row">
2017-12-19 09:40:14 +00:00
<div class= "small-4 small-offset-2 columns">
2017-12-18 12:54:04 +00:00
<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' %}
2017-12-19 09:40:14 +00:00
<div class="row results">
<div class="small-4 small-offset-2 columns">
2017-12-18 12:54:04 +00:00
<img src="{{ content.image_url }}">
</div>
2017-12-19 09:40:14 +00:00
<div class="small-4 end columns">
2017-12-18 12:54:04 +00:00
<a href="{{ content.get_absolute_url }}" class="sidebar-title">{{ content.title }}</a>
2017-12-19 09:40:14 +00:00
<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>
2017-12-18 12:54:04 +00:00
<a href="{{ content.get_absolute_url }}">read more</a> </p>
</div>
</div>
{% else %}
2017-12-19 09:40:14 +00:00
<div class="row">
<div class="small-4 small-offset-2 columns">
2017-12-18 12:54:04 +00:00
Add view for content type: {{content.type}}
2017-12-19 09:40:14 +00:00
</div>
2017-12-18 12:54:04 +00:00
</div>
{% endif %}
{% endfor %}
<br>
<br>
2017-12-19 09:40:14 +00:00
{% 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="?page={{ results.previous_page_number }}">&laquo;</a></li>
{% else %}
<li class="disabled"><span>&laquo;</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="?page={{ i }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if results.has_next %}
<li><a href="?page={{ results.next_page_number }}">&raquo;</a></li>
{% else %}
<li class="disabled"><span>&raquo;</span></li>
{% endif %}
</ul>
</div>
</div>
{% endif %}
2017-12-18 12:54:04 +00:00
</div>
{% endblock %}