Commit 75ac7fa38d6f4c6c26a17c539359ce6ca0fc3e38
Committed by
Carlos Coêlho
1 parent
572d5019
Exists in
master
and in
53 other branches
Added new search template
Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com> Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com> Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Showing
1 changed file
with
128 additions
and
0 deletions
Show diff stats
src/colab-spb-theme-plugin/colab_spb_theme/templates/search/search.html
0 → 100644
| ... | ... | @@ -0,0 +1,128 @@ |
| 1 | +{% extends "base.html" %} | |
| 2 | +{% load i18n highlight superarchives %} | |
| 3 | +{% load static from staticfiles %} | |
| 4 | + | |
| 5 | +{% block title %}{% trans 'search'|title %}{% endblock %} | |
| 6 | + | |
| 7 | +{% block head_js %} | |
| 8 | +<script type="text/javascript" src="{% static 'third-party/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js' %}"></script> | |
| 9 | +{% if use_language %} | |
| 10 | + <script type="text/javascript" src="{{ STATIC_URL }}third-party/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.{{ use_language }}.js"></script> | |
| 11 | +{% endif %} | |
| 12 | + | |
| 13 | +<script type="text/javascript"> | |
| 14 | + $(function () { | |
| 15 | + | |
| 16 | + $('#datepicker_since, #datepicker_until').datetimepicker({ | |
| 17 | + pickTime: false, | |
| 18 | + {% if use_language and date_format %} | |
| 19 | + language: '{{ use_language }}', | |
| 20 | + format: '{{ date_format }}', | |
| 21 | + {% endif %} | |
| 22 | + }); | |
| 23 | + | |
| 24 | + }); | |
| 25 | +</script> | |
| 26 | +{% endblock head_js %} | |
| 27 | + | |
| 28 | +{% block head_css %} | |
| 29 | + <link rel="stylesheet" href="{% static 'third-party/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css' %}"/> | |
| 30 | +{% endblock %} | |
| 31 | + | |
| 32 | +{% block main-content %} | |
| 33 | +<div class="search-results" style="width: 980px;margin: auto;"> | |
| 34 | + <div class="row"> | |
| 35 | + <div class="col-xs-6 col-sm-4 col-md-2 col-lg-2"> | |
| 36 | + <h2>{% trans "Search" %}</h2> | |
| 37 | + </div> | |
| 38 | + <div class="col-xs-6 col-sm-8 col-md-10 col-lg-10"> | |
| 39 | + <br/><br/> | |
| 40 | + <p class="text-right quiet"> | |
| 41 | + {{ page.paginator.count }} {% trans "documents found" %} | |
| 42 | + </p> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + | |
| 46 | + <hr/> | |
| 47 | + | |
| 48 | + <div class="row"> | |
| 49 | + | |
| 50 | + <form class="col-xs-12 col-sm-12 hidden-md hidden-lg" action="{% url "haystack_search" %}"> | |
| 51 | + <div class="input-group"> | |
| 52 | + <input type="text" class="form-control" name="q" placeholder="{% trans "Search here" %}" | |
| 53 | + {% if request.GET.q %}value="{{ request.GET.q }}"{% endif %} /> | |
| 54 | + <div class="input-group-btn"> | |
| 55 | + <button type="submit" class="btn btn-primary"> | |
| 56 | + <span class="glyphicon glyphicon-search"></span> | |
| 57 | + </button> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </form> | |
| 61 | + <br /> | |
| 62 | + | |
| 63 | + <div class="col-md-12 col-lg-12"> | |
| 64 | + {% for result in page.object_list %} | |
| 65 | + {% include "message-preview.html" %} | |
| 66 | + {% empty %} | |
| 67 | + <ul class="list-unstyled"> | |
| 68 | + <li class="text-center"> | |
| 69 | + {% trans "No results for your search." %} | |
| 70 | + {% if request.GET.q %} | |
| 71 | + <p class="text-muted">{% trans "You are searching for" %} {{ request.GET.q }}</p> | |
| 72 | + {% endif %} | |
| 73 | + </li> | |
| 74 | + </ul> | |
| 75 | + {% endfor %} | |
| 76 | + | |
| 77 | + {% if page.has_other_pages %} | |
| 78 | + <div class="text-center"> | |
| 79 | + <ul class="pagination"> | |
| 80 | + <li {% if page.number == 1 %}class="disabled"{% endif %}> | |
| 81 | + <a href="{% if page.number == 1 %}javascript:void(0);{% else %}{% append_to_get page=1 %}{% endif %}"><span class="glyphicon glyphicon-chevron-left small-icon"></span><span class="glyphicon glyphicon-chevron-left small-icon"></span></a> | |
| 82 | + </li> | |
| 83 | + <li {% if not page.has_previous %}class="disabled"{% endif %}> | |
| 84 | + <a href="{% if page.has_previous %}{% append_to_get page=page.previous_page_number %}{% else %}javascript:void(0);{% endif %}"><span class="glyphicon glyphicon-chevron-left small-icon"></span></a> | |
| 85 | + </li> | |
| 86 | + | |
| 87 | + {% if page.has_previous %} | |
| 88 | + {% if page.previous_page_number > 1 %} | |
| 89 | + <li> | |
| 90 | + <a href="{% append_to_get page=page.previous_page_number|add:-2 %}">{{ page.number|add:-2 }}</a> | |
| 91 | + </li> | |
| 92 | + {% endif %} | |
| 93 | + <li> | |
| 94 | + <a href="{% append_to_get page=page.previous_page_number %}">{{ page.number|add:-1 }}</a> | |
| 95 | + </li> | |
| 96 | + {% endif %} | |
| 97 | + | |
| 98 | + <li class="active"> | |
| 99 | + <a href="javascript:void(0);">{{ page.number }}</a> | |
| 100 | + </li> | |
| 101 | + | |
| 102 | + {% if page.has_next %} | |
| 103 | + <li> | |
| 104 | + <a href="{% append_to_get page=page.next_page_number %}">{{ page.number|add:1 }}</a> | |
| 105 | + </li> | |
| 106 | + {% if page.next_page_number < page.paginator.num_pages %} | |
| 107 | + <li> | |
| 108 | + <a href="{% append_to_get page=page.next_page_number|add:1 %}">{{ page.number|add:2 }}</a> | |
| 109 | + </li> | |
| 110 | + {% endif %} | |
| 111 | + {% endif %} | |
| 112 | + | |
| 113 | + <li {% if not page.has_next %}class="disabled"{% endif %}> | |
| 114 | + <a href="{% if page.has_next %}{% append_to_get page=page.next_page_number %}{% else %}javascript:void(0);{% endif %}"><span class="glyphicon glyphicon-chevron-right small-icon"></span></a> | |
| 115 | + </li> | |
| 116 | + | |
| 117 | + <li {% if page.number == page.paginator.num_pages %}class="disabled"{% endif %}> | |
| 118 | + <a href="{% if page.number == page.paginator.num_pages %}javascript:void(0);{% else %}{% append_to_get page=page.paginator.num_pages %}{% endif %}"><span class="glyphicon glyphicon-chevron-right small-icon"></span><span class="glyphicon glyphicon-chevron-right small-icon"></span></a> | |
| 119 | + </li> | |
| 120 | + | |
| 121 | + </ul> | |
| 122 | + </div> | |
| 123 | + {% endif %} | |
| 124 | + </div> | |
| 125 | + | |
| 126 | + </div> | |
| 127 | +</div> | |
| 128 | +{% endblock main-content %} | |
| 0 | 129 | \ No newline at end of file | ... | ... |