Commit 108c7b79 authored by Serge S. Koval's avatar Serge S. Koval

Added 'x' to the filter remove button.

parent 5fe6bd03
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- Reduce number of parameters passed to list view - Reduce number of parameters passed to list view
- Checkboxes and mass operations - Checkboxes and mass operations
- Filters - Filters
- Add 'x' to remove filter and remove button - Use table to draw filters so column names will line up?
- Custom filters for date fields? - Custom filters for date fields?
- Change boolean filter to True/False instead of Yes/No - Change boolean filter to True/False instead of Yes/No
- Ability to sort by fields that are not visible? - Ability to sort by fields that are not visible?
......
...@@ -43,4 +43,20 @@ form.search-form a.clear i { ...@@ -43,4 +43,20 @@ form.search-form a.clear i {
{ {
margin-bottom: 0px; margin-bottom: 0px;
width: 208px; width: 208px;
} }
\ No newline at end of file
.filter-row .remove-filter
{
vertical-align: middle;
}
.filter-row .remove-filter .close-icon
{
font-size: 16px;
}
.filter-row .remove-filter .close-icon:hover
{
color: black;
opacity: 0.4;
}
...@@ -24,8 +24,10 @@ var AdminFilters = function(element, filters_element, adminForm, operations, opt ...@@ -24,8 +24,10 @@ var AdminFilters = function(element, filters_element, adminForm, operations, opt
function addFilter(name, op) { function addFilter(name, op) {
var $el = $('<div class="filter-row" />').appendTo($container); var $el = $('<div class="filter-row" />').appendTo($container);
$('<a href="#" class="btn remove-filter" title="Remove Filter" />') $('<a href="#" class="btn remove-filter" />')
.text(name) .append($('<span class="close-icon">&times;</span>'))
.append('&nbsp;')
.append(name)
.appendTo($el) .appendTo($el)
.click(removeFilter); .click(removeFilter);
...@@ -47,7 +49,7 @@ var AdminFilters = function(element, filters_element, adminForm, operations, opt ...@@ -47,7 +49,7 @@ var AdminFilters = function(element, filters_element, adminForm, operations, opt
$field = $('<select class="filter-val" />') $field = $('<select class="filter-val" />')
.attr('name', 'flt' + lastCount + '_' + optId) .attr('name', 'flt' + lastCount + '_' + optId)
.appendTo($el); .appendTo($el);
$(options[optId]).each(function() { $(options[optId]).each(function() {
$field.append($('<option/>') $field.append($('<option/>')
.val(this[0]).text(this[1])) .val(this[0]).text(this[1]))
...@@ -72,7 +74,7 @@ var AdminFilters = function(element, filters_element, adminForm, operations, opt ...@@ -72,7 +74,7 @@ var AdminFilters = function(element, filters_element, adminForm, operations, opt
$('a.filter', filters_element).click(function() { $('a.filter', filters_element).click(function() {
var name = $(this).text().trim(); var name = $(this).text().trim();
addFilter(name, operations[name]); addFilter(name, operations[name]);
$('button', $root).show(); $('button', $root).show();
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<div class="filter-row"> <div class="filter-row">
{% set filter = admin_view._filters[flt[0]] %} {% set filter = admin_view._filters[flt[0]] %}
<a href="#" class="btn remove-filter" title="{{ _gettext('Remove Filter') }}"> <a href="#" class="btn remove-filter" title="{{ _gettext('Remove Filter') }}">
{{ filters[flt[0]] }} <span class="close-icon">&times;</span>&nbsp;{{ filters[flt[0]] }}
</a><select class="filter-op" data-role="chosen"> </a><select class="filter-op" data-role="chosen">
{% for op in admin_view._filter_dict[filter.name] %} {% for op in admin_view._filter_dict[filter.name] %}
<option value="{{ op[0] }}"{% if flt[0] == op[0] %} selected="selected"{% endif %}>{{ op[1] }}</option> <option value="{{ op[0] }}"{% if flt[0] == op[0] %} selected="selected"{% endif %}>{{ op[1] }}</option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment