camp/content/templates/results.html
2017-12-19 15:10:14 +05:30

72 lines
2.5 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="?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 %}
</div>
{% endblock %}