Skip to content
Permalink
Browse files

[IMP]Improve title attribute, make it translatable

  • Loading branch information...
msh-odoo committed Apr 12, 2019
1 parent f992b18 commit a6b9d271b9b35baa2270f6a3c6d668376711c263
Showing with 4 additions and 1 deletion.
  1. +4 −0 addons/web/static/src/js/fields/relational_fields.js
  2. +0 −1 addons/web/static/src/xml/base.xml
@@ -1965,6 +1965,9 @@ var FieldMany2ManyTags = AbstractField.extend({
}

this.colorField = this.nodeOptions.color_field;
this.colornames = [_t('No color'), _t('Red'), _t('Orange'), _t('Yellow'), _t('Light blue'),
_t('Dark purple'), _t('Salmon pink'), _t('Medium blue'), _t('Dark blue'), _t('Fushia'),
_t('Green'), _t('Purple')];
this.hasDropdown = false;
},

@@ -2033,6 +2036,7 @@ var FieldMany2ManyTags = AbstractField.extend({
var elements = this.value ? _.pluck(this.value.data, 'data') : [];
return {
colorField: this.colorField,
colornames: this.colornames,
elements: elements,
hasDropdown: this.hasDropdown,
readonly: this.mode === "readonly",
@@ -845,7 +845,6 @@
<t t-name="FieldMany2ManyTag">
<t t-foreach="elements" t-as="el">
<t t-set="color" t-value="el[colorField] || 0"/>
<t t-set="colornames" t-value="['No color', 'Red', 'Orange', 'Yellow', 'Light blue', 'Dark purple', 'Salmon pink', 'Medium blue', 'Dark blue', 'Fushia', 'Green', 'Purple']"/>
<div t-attf-class="badge badge-pill #{hasDropdown ? 'dropdown' : ''} o_tag_color_#{color}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id" t-attf-title="#{title} #{colornames[color]}">
<t t-set="_badge_text">
<span class="o_badge_text" t-att-title="el.display_name"><span role="img" t-attf-aria-label="#{title} #{colornames[color]}"/><t t-esc="el.display_name"/></span>

0 comments on commit a6b9d27

Please sign in to comment.
You can’t perform that action at this time.