mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
wip PHRAS-681
This commit is contained in:
@@ -237,15 +237,27 @@
|
||||
</div>
|
||||
<div id="ADVSRCH_OPTIONS_ZONE">
|
||||
<div id="ADVSRCH_SORT_ZONE">
|
||||
{% set sortByDefault = app['phraseanet.SE'].getDefaultSort()%}
|
||||
{% set sortOrderDefault = app['phraseanet.SE'].getDefaultSortDirection()%}
|
||||
|
||||
{#{% set sortByPreference = constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON') %}#}
|
||||
{% if sortByPreference is not defined %}
|
||||
{% set sortByPreference = sortByDefault %}
|
||||
{% endif %}
|
||||
|
||||
{% if sortOrderPreference is not defined %}
|
||||
{% set sortOrderPreference = sortOrderDefault %}
|
||||
{% endif %}
|
||||
|
||||
<span>{{ 'Trier par' | trans }}</span>
|
||||
<select name="sort" class="input-medium">
|
||||
{% set b = (app['phraseanet.SE'].getDefaultSort() == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON')) %}
|
||||
<select name="sort" class="input-medium" onchange="checkFilters(true);">
|
||||
{% set b = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON')) %}
|
||||
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON') }}" {% if b %}selected="selected" class="default-selection"{% endif %}>{{ "Date Added"|trans }}</option>
|
||||
{% set b = (app['phraseanet.SE'].getDefaultSort() == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE')) %}
|
||||
{% set b = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE')) %}
|
||||
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE') }}" {% if b %}selected="selected" class="default-selection"{% endif %}>{{ "Relevance"|trans }}</option>
|
||||
<optgroup label="{{ 'By field'|trans }}">
|
||||
{% for fieldname, sort in search_datas['sort'] %}
|
||||
{% set b = (app['phraseanet.SE'].getDefaultSort() == fieldname) %}
|
||||
{% set b = (sortOrderPreference == fieldname) %}
|
||||
<option value="{{ fieldname }}"
|
||||
{% if b %}selected="selected"{% endif %}
|
||||
class="{% if b %}default-selection {% endif %}dbx db_{{sort['sbas']|join(' db_')}}"
|
||||
@@ -253,7 +265,7 @@
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
</select>
|
||||
<select name="ord" class="input-medium">
|
||||
<select name="ord" class="input-medium" onchange="checkFilters(true);">
|
||||
{% for ord, ord_name in app['phraseanet.SE'].getAvailableOrder() %}
|
||||
{% set b = (app['phraseanet.SE'].getDefaultSortDirection() == ord) %}
|
||||
<option value="{{ ord }}" {% if b %}selected="selected" class="default-selection"{% endif %}>{{ ord_name }}</option>
|
||||
|
Reference in New Issue
Block a user