-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds changelist filters form functionality
- Loading branch information
Showing
18 changed files
with
187 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% load i18n baton_tags %} | ||
<h3>{% blocktranslate with filter_title=title %} By {{ filter_title }} {% endblocktranslate %}</h3> | ||
{% baton_config_value 'CHANGELIST_FILTERS_FORM' as filters_form %} | ||
{% if filters_form %} | ||
<ul style="padding-right: 15px;"> | ||
<li> | ||
<select class="form-select form-select-sm" style="width: 100% !important;"> | ||
{% for choice in choices %} | ||
<option{% if choice.selected %} selected="selected"{% endif %} value="{{ choice.query_string|iriencode }}">{{ choice.display }}</option> | ||
{% endfor %} | ||
</select> | ||
</li> | ||
</ul> | ||
{% else %} | ||
<ul> | ||
{% for choice in choices %} | ||
<li{% if choice.selected %} class="selected"{% endif %}> | ||
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">{{ choice.display }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,38 @@ | ||
{% load i18n %} | ||
<script type="text/javascript">var go_from_select = function(opt) { window.location = window.location.pathname + opt };</script> | ||
{% load i18n baton_tags %} | ||
{% baton_config_value 'CHANGELIST_FILTERS_FORM' as filters_form %} | ||
{% if not filters_form %} | ||
<script type="text/javascript">var go_from_select = function(opt) { window.location = window.location.pathname + opt };</script> | ||
{% endif %} | ||
<h3>{% blocktrans with title as filter_title %} By {{ filter_title }} {% endblocktrans %}</h3> | ||
<ul class="admin-filter-{{ title|cut:' ' }}" style="padding-right: 15px;"> | ||
{% if choices|slice:"3:" %} | ||
<li> | ||
<select class="form-select form-select-sm" style="width: 100% !important;" | ||
onchange="go_from_select(this.options[this.selectedIndex].value)"> | ||
{% for choice in choices %} | ||
<option{% if choice.selected %} selected="selected"{% endif %} | ||
value="{{ choice.query_string|iriencode }}">{{ choice.display }}</option> | ||
{% endfor %} | ||
</select> | ||
</li> | ||
{% else %} | ||
|
||
{% for choice in choices %} | ||
<li{% if choice.selected %} class="selected"{% endif %}> | ||
<a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a> | ||
{% if filters_form %} | ||
<li> | ||
<select class="form-select form-select-sm" style="width: 100% !important;" name="{{ spec.parameter_name }}"> | ||
{% for choice in choices %} | ||
<option{% if choice.selected %} selected="selected"{% endif %} | ||
value="{{ choice.query_string|iriencode }}">{{ choice.display }} {{ choice.name }} {{ choice.value }}</option> | ||
{% endfor %} | ||
</select> | ||
</li> | ||
{% endfor %} | ||
{% else %} | ||
{% if choices|slice:"3:" %} | ||
<li> | ||
<select class="form-select form-select-sm" style="width: 100% !important;" | ||
onchange="go_from_select(this.options[this.selectedIndex].value)"> | ||
{% for choice in choices %} | ||
<option{% if choice.selected %} selected="selected"{% endif %} | ||
value="{{ choice.query_string|iriencode }}">{{ choice.display }}</option> | ||
{% endfor %} | ||
</select> | ||
</li> | ||
{% else %} | ||
|
||
{% endif %} | ||
{% for choice in choices %} | ||
<li{% if choice.selected %} class="selected"{% endif %}> | ||
<a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a> | ||
</li> | ||
{% endfor %} | ||
|
||
{% endif %} | ||
{% endif %} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
{% load i18n %} | ||
{% load i18n baton_tags %} | ||
|
||
{% baton_config_value 'CHANGELIST_FILTERS_FORM' as filters_form %} | ||
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3> | ||
<ul style="padding-right: 15px;"> | ||
<li> | ||
{% with choices.0 as all_choice %} | ||
<form method="GET" action=""> | ||
{% if not filters_form %} | ||
{% with choices.0 as all_choice %} | ||
<form method="GET" action=""> | ||
|
||
{% for k, v in all_choice.query_parts %} | ||
<input type="hidden" name="{{ k }}" value="{{ v }}" /> | ||
{% endfor %} | ||
{% for k, v in all_choice.query_parts %} | ||
<input type="hidden" name="{{ k }}" value="{{ v }}" /> | ||
{% endfor %} | ||
|
||
<input type="text" | ||
class="form-control form-control-sm" | ||
value="{{ spec.value|default_if_none:'' }}" | ||
placeholder="{% trans "type and press enter..."%}" | ||
name="{{ spec.parameter_name }}"/> | ||
<input type="text" | ||
class="form-control form-control-sm" | ||
value="{{ spec.value|default_if_none:'' }}" | ||
placeholder="{% trans "type and press enter..."%}" | ||
name="{{ spec.parameter_name }}"/> | ||
|
||
{% if not all_choice.selected %} | ||
<a style="margin-top: .5rem;" href="{{ all_choice.query_string }}" class="btn btn-sm btn-warning">x {% trans 'Remove' %}</a> | ||
{% endif %} | ||
{% if not all_choice.selected %} | ||
<a style="margin-top: .5rem;" href="{{ all_choice.query_string }}" class="btn btn-sm btn-warning">{% trans 'Reset' %}</a> | ||
{% endif %} | ||
|
||
</form> | ||
{% endwith %} | ||
</form> | ||
{% endwith %} | ||
{% else %} | ||
<input type="text" | ||
class="form-control form-control-sm" | ||
value="{{ spec.value|default_if_none:'' }}" | ||
placeholder="{% trans "type and press enter..."%}" | ||
name="{{ spec.parameter_name }}"/> | ||
{% endif %} | ||
</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.