diff --git a/app/assets/stylesheets/label_templates/show.scss b/app/assets/stylesheets/label_templates/show.scss index af28f8f3c..5a470cc01 100644 --- a/app/assets/stylesheets/label_templates/show.scss +++ b/app/assets/stylesheets/label_templates/show.scss @@ -172,5 +172,15 @@ .no-results { color: $color-silver-chalice; } + + .tooltip-body { + display: flex; + width: 350px; + + .tooltip-inner { + max-width: 350px; + text-align: left; + } + } } } diff --git a/app/javascript/vue/label_template/insert_field_dropdown.vue b/app/javascript/vue/label_template/insert_field_dropdown.vue index 4fb93b012..5ac990018 100644 --- a/app/javascript/vue/label_template/insert_field_dropdown.vue +++ b/app/javascript/vue/label_template/insert_field_dropdown.vue @@ -1,35 +1,40 @@
- Nothing found… + {{ i18n.t('label_templates.show.insert_dropdown.nothing_found') }}
@@ -76,6 +82,14 @@ } }, computed: { + tooltipTemplate() { + return `` + }, filteredFields() { let result = {}; if (this.searchValue.length == 0) { @@ -95,6 +109,7 @@ } this.$nextTick(() => { + $('.tooltip').remove(); $('[data-toggle="tooltip"]').tooltip(); }); return result; diff --git a/app/services/label_templates/tag_service.rb b/app/services/label_templates/tag_service.rb index 2870d0c09..9f6bddea8 100644 --- a/app/services/label_templates/tag_service.rb +++ b/app/services/label_templates/tag_service.rb @@ -3,10 +3,10 @@ module LabelTemplates class TagService DEFAULT_COLUMNS = [ - { key: 'Item ID', tag: '{{ITEM_ID}}' }, - { key: 'Name', tag: '{{NAME}}' }, - { key: 'Added on', tag: '{{ADDED_ON}}' }, - { key: 'Added by', tag: '{{ADDED_BY}}' } + { key: I18n.t('label_templates.default_columns.item_id'), tag: '{{ITEM_ID}}' }, + { key: I18n.t('label_templates.default_columns.name'), tag: '{{NAME}}' }, + { key: I18n.t('label_templates.default_columns.added_on'), tag: '{{ADDED_ON}}' }, + { key: I18n.t('label_templates.default_columns.added_by'), tag: '{{ADDED_BY}}' } ].freeze def initialize(team) diff --git a/config/locales/en.yml b/config/locales/en.yml index 7585db141..3a227d80e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -858,9 +858,20 @@ en: content_title: '%{format} template code' preview_title: 'Template preview' view_content_tooltip: 'Click to edit template code' + insert_dropdown: + button: 'Insert field code' + common_fields: 'Common custom fields' + nothing_found: 'Nothing found…' + field_code: 'Field code: %{code}' + search_placeholder: 'Type to search…' buttons: refresh: 'Refresh preview' save: 'Save template code' + default_columns: + item_id: 'Item ID' + name: 'Name' + added_on: 'Added On' + added_by: 'Added by' promo: head_title: 'Label templates'