Skip to content

Commit 030d9a3

Browse files
committed
Filters
* Used bootstrap v5 icon pack
1 parent 728641f commit 030d9a3

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

rest_framework/templates/rest_framework/base.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ <h4 class="text-center">Are you sure you want to delete this {{ name }}?</h4>
141141
{% endif %}
142142

143143
{% if filter_form %}
144-
<button style="float: right; margin-right: 10px" data-toggle="modal" data-target="#filtersModal" class="btn btn-default">
145-
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
144+
<button data-toggle="modal" data-target="#filtersModal" class="btn btn-outline-secondary button-form">
145+
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-wrench" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
146+
<path fill-rule="evenodd" d="M.102 2.223A3.004 3.004 0 0 0 3.78 5.897l6.341 6.252A3.003 3.003 0 0 0 13 16a3 3 0 1 0-.851-5.878L5.897 3.781A3.004 3.004 0 0 0 2.223.1l2.141 2.142L4 4l-1.757.364L.102 2.223zm13.37 9.019L13 11l-.471.242-.529.026-.287.445-.445.287-.026.529L11 13l.242.471.026.529.445.287.287.445.529.026L13 15l.471-.242.529-.026.287-.445.445-.287.026-.529L15 13l-.242-.471-.026-.529-.445-.287-.287-.445-.529-.026z"/>
147+
</svg>
146148
{% trans "Filters" %}
147149
</button>
148150
{% endif %}

rest_framework/templates/rest_framework/filters/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<div class="modal-dialog">
33
<div class="modal-content">
44
<div class="modal-header">
5-
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
65
<h4 class="modal-title">Filters</h4>
7-
</div>
6+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
7+
</div>
88
<div class="modal-body">
99
{% for element in elements %}
1010
{% if not forloop.first %}<hr/>{% endif %}

rest_framework/templates/rest_framework/filters/ordering.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ <h2>{% trans "Ordering" %}</h2>
55
{% for key, label in options %}
66
{% if key == current %}
77
<a href="{% add_query_param request param key %}" class="list-group-item active">
8-
<span class="glyphicon glyphicon-ok" style="float: right" aria-hidden="true"></span> {{ label }}
8+
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-check2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
9+
<path fill-rule="evenodd" d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/>
10+
</svg>
11+
{{ label }}
912
</a>
1013
{% else %}
1114
<a href="{% add_query_param request param key %}" class="list-group-item">{{ label }}</a>
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{% load i18n %}
22
<h2>{% trans "Search" %}</h2>
3-
<form class="form-inline">
4-
<div class="mb-3">
5-
<div class="input-group">
3+
<form>
4+
<div class="input-group mb-3">
65
<input type="text" class="form-control" style="width: 350px" name="{{ param }}" value="{{ term }}">
7-
<span class="input-group-btn">
8-
<button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search</button>
9-
</span>
10-
</div>
11-
</div>
6+
<button class="btn btn-primary" type="submit">
7+
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-search" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
8+
<path fill-rule="evenodd" d="M10.442 10.442a1 1 0 0 1 1.415 0l3.85 3.85a1 1 0 0 1-1.414 1.415l-3.85-3.85a1 1 0 0 1 0-1.415z"/>
9+
<path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0z"/>
10+
</svg>
11+
Search</button>
12+
</div>
1213
</form>

0 commit comments

Comments
 (0)