Commit c684331bcd55d5c5b81414ea7702bbd64270acc3
Exists in
master
and in
50 other branches
Merge branch 'search_template' into 'master'
Search template See merge request !68
Showing
4 changed files
with
211 additions
and
0 deletions
Show diff stats
src/colab-spb-theme-plugin/colab_spb_theme/static/css/screen.css
src/colab-spb-theme-plugin/colab_spb_theme/static/css/search.css
0 → 100644
@@ -0,0 +1,62 @@ | @@ -0,0 +1,62 @@ | ||
1 | + | ||
2 | +.search-form { | ||
3 | + margin-top: 28px; | ||
4 | + padding-top: 0px; | ||
5 | + padding-bottom: 15px; | ||
6 | + padding-left: 25px; | ||
7 | + padding-right: 25px; | ||
8 | + background: #ecedf1; | ||
9 | + border-radius: 4px; | ||
10 | + border: 1px solid #d3d6de; | ||
11 | +} | ||
12 | + | ||
13 | +.search-title { | ||
14 | + color: #3e67b1; | ||
15 | + margin: 5px 0px 3px; | ||
16 | + padding: 16px 0px 0px 0px; | ||
17 | + font-family: "open_sansregular", Arial, Helvetica, sans-serif; | ||
18 | + font-weight: bold; | ||
19 | + font-size: 15px; | ||
20 | + text-transform: uppercase; | ||
21 | +} | ||
22 | + | ||
23 | +.search-input { | ||
24 | + width: 100%; | ||
25 | + padding: 7px; | ||
26 | + font-size: 14px; | ||
27 | + margin-top: 15px; | ||
28 | + margin-bottom: 15px; | ||
29 | + border-radius: 4px; | ||
30 | + border: 1px solid #d3d6de; | ||
31 | +} | ||
32 | + | ||
33 | +.search-blue { | ||
34 | + background: #3e67b1; | ||
35 | + color: white; | ||
36 | + width: auto; | ||
37 | + height: 30px; | ||
38 | + padding: 0 14px; | ||
39 | + line-height: 14px; | ||
40 | + border-radius: 4px; | ||
41 | + text-transform: uppercase; | ||
42 | + font-family: "open_sansbold", Arial, sans-serif; | ||
43 | + font-size: 14px; | ||
44 | +} | ||
45 | + | ||
46 | +.btn:hover { | ||
47 | + color: white; | ||
48 | +} | ||
49 | + | ||
50 | +.search-divisor { | ||
51 | + margin-top: 0px; | ||
52 | +} | ||
53 | + | ||
54 | +.search-summary { | ||
55 | + margin-top: 50px; | ||
56 | +} | ||
57 | + | ||
58 | +.search-total { | ||
59 | + font-size: 14px; | ||
60 | + font-family: Arial; | ||
61 | + font-weight: bold; | ||
62 | +} | ||
0 | \ No newline at end of file | 63 | \ No newline at end of file |
src/colab-spb-theme-plugin/colab_spb_theme/templates/header.html
@@ -99,6 +99,7 @@ | @@ -99,6 +99,7 @@ | ||
99 | <fieldset class="LSBox"><legend class="hiddenStructure">Buscar no portal</legend> | 99 | <fieldset class="LSBox"><legend class="hiddenStructure">Buscar no portal</legend> |
100 | <label class="hiddenStructure" for="nolivesearchGadget">Buscar no portal</label> | 100 | <label class="hiddenStructure" for="nolivesearchGadget">Buscar no portal</label> |
101 | <input name="q" type="text" size="18" value="{{ request.GET.q }}" title="Buscar no portal" placeholder="Buscar no portal" class="searchField" id="nolivesearchGadget"> | 101 | <input name="q" type="text" size="18" value="{{ request.GET.q }}" title="Buscar no portal" placeholder="Buscar no portal" class="searchField" id="nolivesearchGadget"> |
102 | + <input name="order" value="latest" type="hidden"> | ||
102 | <input class="searchButton" type="submit" value="Buscar no portal"> | 103 | <input class="searchButton" type="submit" value="Buscar no portal"> |
103 | </fieldset> | 104 | </fieldset> |
104 | </form> | 105 | </form> |
src/colab-spb-theme-plugin/colab_spb_theme/templates/search/search.html
0 → 100644
@@ -0,0 +1,147 @@ | @@ -0,0 +1,147 @@ | ||
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 | + | ||
35 | +<form accept-charset="UTF-8" action="/search/" method="get"> | ||
36 | + <div class="container"> | ||
37 | + <div class="row"> | ||
38 | + <div class="col-md-12"> | ||
39 | + <div class="search-form"> | ||
40 | + <h3 class="search-title"> {% trans "BUSCAR NO PORTAL" %} </h3> | ||
41 | + <div class="search-field"> | ||
42 | + <span class="formfield"> | ||
43 | + <input class="search-input" id="search-input" name="q" value="" type="text"> | ||
44 | + </span> | ||
45 | + </div> | ||
46 | + <input class="btn search-blue with-text icon-search submit" name="commit" value="Buscar" type="submit"> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + </div> | ||
50 | + </div> | ||
51 | + | ||
52 | + <div class="container search-summary"> | ||
53 | + <div class="row"> | ||
54 | + <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> | ||
55 | + <p class="text-left search-total"> | ||
56 | + {% trans "Total de "%}{{ page.paginator.count }}{% trans " respostas na sua pesquisa"%} | ||
57 | + </p> | ||
58 | + </div> | ||
59 | + <div class="col-xs-3 col-sm-2 col-md-2 col-lg-2"> | ||
60 | + </div> | ||
61 | + <div class="col-xs-3 col-sm-4 col-md-4 col-lg-4"> | ||
62 | + <p class="text-right search-total">{% trans "Ordenar por:" %} | ||
63 | + <select name="order" id="order_option" onchange="this.form.submit()"> | ||
64 | + {% for option, dict_order in order_data.items %} | ||
65 | + {% ifequal request.GET.order option %} | ||
66 | + <option value="{{option}}" selected>{% trans option %}</option> | ||
67 | + {% else %} | ||
68 | + <option value="{{option}}">{% trans option %}</option> | ||
69 | + {% endifequal %} | ||
70 | + {% endfor %} | ||
71 | + </select> | ||
72 | + </p> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + <hr class="search-divisor" /> | ||
76 | + </div> | ||
77 | +</form> | ||
78 | + | ||
79 | + <div class="row"> | ||
80 | + <div class="col-md-12 col-lg-12"> | ||
81 | + <div class="container"> | ||
82 | + {% for result in page.object_list %} | ||
83 | + {% include "message-preview.html" %} | ||
84 | + {% empty %} | ||
85 | + <ul class="list-unstyled"> | ||
86 | + <li class="text-center"> | ||
87 | + {% trans "No results for your search." %} | ||
88 | + {% if request.GET.q %} | ||
89 | + <p class="text-muted">{% trans "You are searching for" %} {{ request.GET.q }}</p> | ||
90 | + {% endif %} | ||
91 | + </li> | ||
92 | + </ul> | ||
93 | + {% endfor %} | ||
94 | + </div> | ||
95 | + | ||
96 | + {% if page.has_other_pages %} | ||
97 | + <div class="text-center"> | ||
98 | + <ul class="pagination"> | ||
99 | + <li {% if page.number == 1 %}class="disabled"{% endif %}> | ||
100 | + <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> | ||
101 | + </li> | ||
102 | + <li {% if not page.has_previous %}class="disabled"{% endif %}> | ||
103 | + <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> | ||
104 | + </li> | ||
105 | + | ||
106 | + {% if page.has_previous %} | ||
107 | + {% if page.previous_page_number > 1 %} | ||
108 | + <li> | ||
109 | + <a href="{% append_to_get page=page.previous_page_number|add:-2 %}">{{ page.number|add:-2 }}</a> | ||
110 | + </li> | ||
111 | + {% endif %} | ||
112 | + <li> | ||
113 | + <a href="{% append_to_get page=page.previous_page_number %}">{{ page.number|add:-1 }}</a> | ||
114 | + </li> | ||
115 | + {% endif %} | ||
116 | + | ||
117 | + <li class="active"> | ||
118 | + <a href="javascript:void(0);">{{ page.number }}</a> | ||
119 | + </li> | ||
120 | + | ||
121 | + {% if page.has_next %} | ||
122 | + <li> | ||
123 | + <a href="{% append_to_get page=page.next_page_number %}">{{ page.number|add:1 }}</a> | ||
124 | + </li> | ||
125 | + {% if page.next_page_number < page.paginator.num_pages %} | ||
126 | + <li> | ||
127 | + <a href="{% append_to_get page=page.next_page_number|add:1 %}">{{ page.number|add:2 }}</a> | ||
128 | + </li> | ||
129 | + {% endif %} | ||
130 | + {% endif %} | ||
131 | + | ||
132 | + <li {% if not page.has_next %}class="disabled"{% endif %}> | ||
133 | + <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> | ||
134 | + </li> | ||
135 | + | ||
136 | + <li {% if page.number == page.paginator.num_pages %}class="disabled"{% endif %}> | ||
137 | + <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> | ||
138 | + </li> | ||
139 | + | ||
140 | + </ul> | ||
141 | + </div> | ||
142 | + {% endif %} | ||
143 | + </div> | ||
144 | + | ||
145 | + </div> | ||
146 | +</div> | ||
147 | +{% endblock main-content %} | ||
0 | \ No newline at end of file | 148 | \ No newline at end of file |