diff --git a/app/components/table-filters/dropdown-select-multiple.coffee b/app/components/table-filters/dropdown-select-multiple.coffee index 1beeaf9..e54e110 100644 --- a/app/components/table-filters/dropdown-select-multiple.coffee +++ b/app/components/table-filters/dropdown-select-multiple.coffee @@ -8,6 +8,7 @@ export default Ember.Component.extend eager_filter: false # filter on single select has_active_filter_value: Ember.computed.bool 'selected.length' search_string: '' + translationPath: '' # if set indicating a flat select requiring translated values search_placeholder: 'Search...' #.htmlSafe() filtered_options: Ember.computed 'options.length', 'search_string', -> return @get('options') unless @get('search_string.length') > 1 @@ -31,6 +32,12 @@ export default Ember.Component.extend result_html += '

' if result_html result_html += get(option, labelPath) result_html + else if translationPath = @get('translationPath') + result_html = '' + @get('selected').forEach (value) -> + result_html += '

' if result_html + result_html += t(value, scope: translationPath, default: value) + result_html else @get('selected').join('

') selected_display: Ember.computed 'selected.length', -> diff --git a/app/templates/components/table-filters/dropdown-select-multiple.emblem b/app/templates/components/table-filters/dropdown-select-multiple.emblem index 166c36e..fe3bc65 100644 --- a/app/templates/components/table-filters/dropdown-select-multiple.emblem +++ b/app/templates/components/table-filters/dropdown-select-multiple.emblem @@ -15,6 +15,8 @@ ui-dropdown class='right basic labeled icon' action='nothing' each filtered_options as |option| if labelPath ui-checkbox class='item' checked=(contains (get option valuePath) selected) label=(get option labelPath) onChange=(action 'toggle_filter' option) + else if translationPath + ui-checkbox class='item' checked=(contains option selected) label=(t option scope=translationPath) onChange=(action 'toggle_filter' option) else ui-checkbox class='item' checked=(contains option selected) label=option onChange=(action 'toggle_filter' option) if selected.length diff --git a/app/templates/components/table-filters/dropdown-select.emblem b/app/templates/components/table-filters/dropdown-select.emblem index 63494c3..c05a2e2 100644 --- a/app/templates/components/table-filters/dropdown-select.emblem +++ b/app/templates/components/table-filters/dropdown-select.emblem @@ -6,11 +6,10 @@ ui-dropdown class='right basic labeled icon' action='nothing' .item{action 'set_filter' option} if labelPath = get option labelPath + else if translationPath + = t option scope=translationPath else - if translationPath - = t option scope=translationPath - else - = option + = option if has_active_filter_value i.pointable.close.icon{action 'clear_filter'}