Added search and orderby features to people

This commit is contained in:
Tom Price
2014-11-04 04:35:03 +00:00
parent 0cfa36b602
commit a097a8c08c
4 changed files with 56 additions and 8 deletions

View File

@@ -1,8 +1,10 @@
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
{% load widget_tweaks %}
{% load paginator from filters %}
{% load url_replace from filters %}
{% load orderby from filters %}
{% block title %}People list{% endblock %}
{% block title %}People{% endblock %}
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
@@ -13,6 +15,13 @@
<div class="col-sm-2">
<a href="{% url 'person_add' %}" class="btn btn-default pull-right">New <span class="glyphicon glyphicon-plus"></span></a>
</div>
<div class="col-sm-3 col-sm-offset-9">
<form class="form form-horizontal col-sm-12">
<div class="form-group">
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}" class="form-control" />
</div>
</form>
</div>
</div>
<div class="pull-right">{% paginator %}</div>
<div>
@@ -20,7 +29,7 @@
<thead>
<tr>
<td></td>
<td>Name</td>
<td>Name<a href="?{% orderby request 'orderBy' 'name' %}"><span class="caret"></span></a></td>
<td>Email</td>
<td>Phone</td>
<td>Notes</td>