sort facets via preferences

This commit is contained in:
Mike Ng
2018-03-06 13:59:53 +04:00
parent 249a4126b4
commit a517b1d6a3
2 changed files with 16 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ class DisplaySettingService
const ORDER_ALPHA_ASC = "ORDER_ALPHA_ASC";
const ORDER_ALPHA_DESC = "ORDER_ALPHA_DESC";
const ORDER_BY_ADMIN = "ORDER_BY_ADMIN";
const ORDER_BY_BCT = "ORDER_BY_BCT";
/**
* The default user settings.

View File

@@ -143,7 +143,7 @@
$(document).ready(function(){
prodApp.appEvents.emit('workzone.doRemoveWarning', "{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), "warning_on_delete_story") %}true{% else %}false{% endif %}");
prodApp.appEvents.emit('search.setFilterFacet', "{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), "facet") %}{{ app['settings'].getUserSetting(app.getAuthenticatedUser(), "facet") }}{% else %}false{% endif %}")
prodApp.appEvents.emit('search.updateFacetData');
});
@@ -713,6 +713,20 @@
</label>
</form>
</div>
<div class="box">
<h1>{{ 'index::advance_search: facet-order' | trans }}</h1>
<form class="form-inline">
{% set order_facet = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'order_facet') %}
<label class="select" for="orderFacet">
<select class="preferences-facet-order" name="orderFacet">
<option {% if order_facet == constant('Alchemy\\Phrasea\\Core\\Configuration\\DisplaySettingService::ORDER_ALPHA_ASC') %} selected="selected" {% endif %}
value="{{ constant('Alchemy\\Phrasea\\Core\\Configuration\\DisplaySettingService::ORDER_ALPHA_ASC') }}">{{ 'Alphabetic asc' | trans }}</option>
<option {% if order_facet == constant('Alchemy\\Phrasea\\Core\\Configuration\\DisplaySettingService::ORDER_BY_BCT') %} selected="selected" {% endif %}
value="{{ constant('Alchemy\\Phrasea\\Core\\Configuration\\DisplaySettingService::ORDER_BY_BCT') }}">{{ 'index::advance_search: facet-tech-order' | trans }}</option>
</select>
</label>
</form>
</div>
<div class="box">
<h1>{{ 'index::advance_search: facet' | trans }}</h1>
{% set facetFilter = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'facet') %}