diff --git a/app/assets/javascripts/select2_customization.js b/app/assets/javascripts/select2_customization.js index fc832f539..189a133aa 100644 --- a/app/assets/javascripts/select2_customization.js +++ b/app/assets/javascripts/select2_customization.js @@ -2,6 +2,7 @@ $.fn.extend({ select2Multiple: function(config = {}) { // Adding ID to each block + var placeholder = this[0].dataset.placeholder || ''; if (this.next().find('.select2-selection').length > 0) return this; var templateSelection = (state) => { return $('' @@ -12,6 +13,7 @@ $.fn.extend({ closeOnSelect: false, multiple: true, ajax: config.ajax, + placeholder: placeholder, templateSelection: templateSelection, sorter: function(data) { return data.sort(function(a, b) { diff --git a/app/assets/stylesheets/select2_customizations.scss b/app/assets/stylesheets/select2_customizations.scss index 4251b7c40..2953fb615 100644 --- a/app/assets/stylesheets/select2_customizations.scss +++ b/app/assets/stylesheets/select2_customizations.scss @@ -16,6 +16,10 @@ width: calc(100% - 26px) } + .select2-search__field { + min-width: 150px; + } + .select2-selection__choice { background: $color-concrete; border: 1px solid $color-alto; diff --git a/app/views/global_activities/_side_filters.html.erb b/app/views/global_activities/_side_filters.html.erb index 0e38ea3b0..abd7faa65 100644 --- a/app/views/global_activities/_side_filters.html.erb +++ b/app/views/global_activities/_side_filters.html.erb @@ -6,7 +6,8 @@ 'data-select-all-button': t('global_activities.index.all_teams_btn'), 'data-select-multiple-name': t('global_activities.index.l_teams'), 'data-select-multiple-all-selected': t('global_activities.index.all_teams'), - 'data-dropdown-position': 'left' + 'data-dropdown-position': 'left', + 'data-placeholder': t('global_activities.index.select_teams') } %> @@ -49,7 +50,8 @@ 'data-select-multiple-name': t('global_activities.index.l_activities'), 'data-select-multiple-all-selected': t('global_activities.index.all_activities'), 'data-dropdown-position': 'left', - 'data-select-by-group': 'true' + 'data-select-by-group': 'true', + 'data-placeholder': t('global_activities.index.select_activity_types') } %> @@ -63,7 +65,8 @@ 'data-select-all': 'true', 'data-select-multiple-name': t('global_activities.index.l_users'), 'data-select-multiple-all-selected': t('global_activities.index.all_users'), - 'data-dropdown-position': 'left' + 'data-dropdown-position': 'left', + 'data-placeholder': t('global_activities.index.select_users') } %> @@ -72,6 +75,6 @@

<%= t('global_activities.index.object') %>

<%= t('global_activities.index.clear') %>
- +
diff --git a/config/locales/global_activities/en.yml b/config/locales/global_activities/en.yml index ac0404188..a068fb030 100644 --- a/config/locales/global_activities/en.yml +++ b/config/locales/global_activities/en.yml @@ -27,6 +27,10 @@ en: all_activities_btn: "Select All Activities" l_activities: "activities" clear_filters: "Clear filters" + select_teams: "Select Teams" + select_activity_types: "Select Activity types" + select_users: "Select Users" + select_objects: "Select Objects" content: create_project_html: "%{user} created project %{project}." rename_project_html: "%{user} renamed project %{project}." @@ -190,7 +194,7 @@ en: create_inventory: "Inventory created" rename_inventory: "Inventory renamed" delete_inventory: "Inventory deleted" - create_item_inventory: Inventory item created" + create_item_inventory: "Inventory item created" edit_item_inventory: "Inventory item edited" delete_item_inventory: "Inventory item deleted" create_column_inventory: "Inventory column created"