Commit ae4ef72ea5e031146224e3cb9621f1d6ea0878ad
1 parent
9c77b115
Exists in
master
and in
2 other branches
Search template included
Showing
1 changed file
with
79 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,79 @@ | @@ -0,0 +1,79 @@ | ||
1 | +{% extends 'news/list.html' %} | ||
2 | + | ||
3 | +{% load static i18n django_bootstrap_breadcrumbs permission_tags pagination %} | ||
4 | + | ||
5 | +{% block breadcrumbs %} | ||
6 | + {{ block.super }} | ||
7 | + {% trans 'Search News' as search_news %} | ||
8 | + {% breadcrumb search_news 'news:search' %} | ||
9 | +{% endblock %} | ||
10 | + | ||
11 | +{% block render_breadcrumbs %} | ||
12 | + {% render_breadcrumbs %} | ||
13 | +{% endblock %} | ||
14 | + | ||
15 | +{% block content %} | ||
16 | + | ||
17 | +{% if messages %} | ||
18 | + {% for message in messages %} | ||
19 | + <script type="text/javascript"> | ||
20 | + {% if message.tags == "danger" %} | ||
21 | + alertify.error('{{message}}'); | ||
22 | + {% else %} | ||
23 | + alertify.success('{{message}}'); | ||
24 | + {% endif %} | ||
25 | + </script> | ||
26 | + {% endfor %} | ||
27 | +{% endif %} | ||
28 | + | ||
29 | +<div class="row"> | ||
30 | + <div class="col-md-9"> | ||
31 | + <form action="{% url 'news:search' %}" method="GET" class="form-horizontal"> | ||
32 | + <div class="form-group"> | ||
33 | + <div class="col-md-11 col-sm-11 col-xs-11"> | ||
34 | + <input type="text" class="form-control" name="search" placeholder="{% trans 'Search by title, author or date' %}" /> | ||
35 | + </div> | ||
36 | + <div class="col-md-1 col-sm-1 col-xs-1"> | ||
37 | + <button type="submit" class="btn btn-fab btn-fab-mini"> | ||
38 | + <i class="fa fa-search"></i> | ||
39 | + </button> | ||
40 | + </div> | ||
41 | + </div> | ||
42 | + </form> | ||
43 | + </div> | ||
44 | + <div class="col-md-3"> | ||
45 | + <a href="{% url 'news:create' %}" class="pull-right btn btn-success btn-raised btn-md"><i class="fa fa-plus"></i> {% trans 'Create News' %}</a> | ||
46 | + </div> | ||
47 | +</div> | ||
48 | + | ||
49 | +{% if news %} | ||
50 | + {% for new in news %} | ||
51 | + <div class="row-fluid panel panel-default"> | ||
52 | + <div class="panel-body"> | ||
53 | + <div class="col-md-6"> | ||
54 | + <a href="{% url 'news:view' new.slug %}"><h3> <b>{{ new }}</b> </h3></a> | ||
55 | + <p>{{ new.creator}}, em {{ new.create_date }}</p> | ||
56 | + </div> | ||
57 | + <div class="col-md-6"> | ||
58 | + <div align="right"> | ||
59 | + <a href="{% url 'news:update' new.slug %}" class="btn btn-success btn-raised btn-sm"><i class="fa fa-edit"></i> {% trans 'Edit' %}</a> | ||
60 | + <a href="" class="btn btn-default btn-raised btn-sm"><i class="fa fa-trash"></i> {% trans 'Delete' %}</a> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + | ||
65 | + </div> | ||
66 | + {% endfor %} | ||
67 | + {% pagination request paginator page_obj %} | ||
68 | +{% else %} | ||
69 | + <div class="row"> | ||
70 | + <div class="col-md-12 col-sm-12 col-xs-12"> | ||
71 | + <p>{% trans 'No news found' %}</p> | ||
72 | + </div> | ||
73 | + </div> | ||
74 | +{% endif %} | ||
75 | +<div id="modal_remove"> | ||
76 | + | ||
77 | +</div> | ||
78 | + | ||
79 | +{% endblock %} |