[IMP] change CSS classes for m2m tags and get them out of the oe_form namespace

this way, we can consistently display m2m tags anywhere without dummy CSS copy/paste (example: projet issues, projet tasks)
oe_form_field_many2manytags became oe_field_many2many_tags (container)
oe_form_field_many2manytags_box became oe_field_many2many_tag (item)
Qweb templates names have been changed accordingly

bzr revid: abo@openerp.com-20120712125637-hji6e9chch1h01f0
This commit is contained in:
Antonin Bourguignon 2012-07-12 14:56:37 +02:00
parent 30c3919316
commit b83fff287a
4 changed files with 93 additions and 91 deletions

View File

@ -34,7 +34,7 @@
background: white;
/* http://www.quirksmode.org/dom/inputfile.html
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
*/ */
*/
}
.openerp a {
text-decoration: none;
@ -450,6 +450,32 @@
.openerp .oe_webclient .oe_star_on {
color: gold;
}
.openerp .oe_field_many2many_tags .text-wrap {
width: 100% !important;
}
.openerp .oe_field_many2many_tags .text-wrap textarea {
width: 100% !important;
}
.openerp .oe_field_many2many_tags .oe_field_many2many_tag {
border-radius: 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
position: relative;
float: left;
border: 1px solid #9daccc;
background: #e2e6f0;
color: black;
padding: 0px 3px 0px 3px;
margin: 0 2px 2px 0;
height: 16px;
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
}
.openerp .oe_field_many2many_tags .text-core .text-wrap .text-dropdown .text-list .text-suggestion em {
font-style: italic;
text-decoration: none;
}
.openerp.oe_tooltip {
font-size: 12px;
}
@ -2017,32 +2043,6 @@
padding-top: 4px;
width: auto;
}
.openerp .oe_form .oe_form_field_many2manytags .text-wrap {
width: 100% !important;
}
.openerp .oe_form .oe_form_field_many2manytags .text-wrap textarea {
width: 100% !important;
}
.openerp .oe_form .oe_form_field_many2manytags .oe_form_field_many2manytags_box {
border-radius: 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
position: relative;
float: left;
border: 1px solid #9daccc;
background: #e2e6f0;
color: black;
padding: 0px 3px 0px 3px;
margin: 0 2px 2px 0;
height: 16px;
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
}
.openerp .oe_form .oe_form_field_many2manytags .text-core .text-wrap .text-dropdown .text-list .text-suggestion em {
font-style: italic;
text-decoration: none;
}
.openerp .oe_form .oe_datepicker_container {
display: none;
}

View File

@ -362,8 +362,28 @@ $sheet-max-width: 860px
text-decoration: none
.oe_star_on
color: gold
//.oe_edit_only 
// }}}
// Many2many tags {{{
.oe_field_many2many_tags
.text-wrap
width: 100% !important
textarea
width: 100% !important
.oe_field_many2many_tag
border-radius: 2px
@include box-sizing(border)
position: relative
float: left
border: 1px solid #9DACCC
background: #E2E6F0
color: black
padding: 0px 3px 0px 3px
margin: 0 2px 2px 0
height: 16px
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif
.text-core .text-wrap .text-dropdown .text-list .text-suggestion em
font-style: italic
text-decoration: none
// }}}
// Tooltips {{{
&.oe_tooltip
@ -1572,26 +1592,6 @@ $sheet-max-width: 860px
.oe_form_field_boolean
padding-top: 4px
width: auto
.oe_form_field_many2manytags
.text-wrap
width: 100% !important
textarea
width: 100% !important
.oe_form_field_many2manytags_box
border-radius: 2px
@include box-sizing(border)
position: relative
float: left
border: 1px solid #9DACCC
background: #E2E6F0
color: black
padding: 0px 3px 0px 3px
margin: 0 2px 2px 0
height: 16px
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif
.text-core .text-wrap .text-dropdown .text-list .text-suggestion em
font-style: italic
text-decoration: none
.oe_datepicker_container
display: none
.oe_datepicker_root

View File

@ -3462,7 +3462,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
$("textarea", self.$element).css("padding-left", "3px");
self.tags.addTags(_.map(data, function(el) {return {name: el[1], id:el[0]};}));
} else {
self.$element.html(QWeb.render("FieldMany2ManyTags.box", {elements: data}));
self.$element.html(QWeb.render("FieldMany2ManyTag", {elements: data}));
}
};
if (! self.get('values') || self.get('values').length > 0) {

View File

@ -961,18 +961,20 @@
</t>
</span>
</t>
<!-- Collection of m2m tags -->
<t t-name="FieldMany2ManyTags">
<div class="oe_form_field oe_form_field_many2manytags" t-att-style="widget.node.attrs.style">
<div class="oe_form_field oe_field_many2many_tags" t-att-style="widget.node.attrs.style">
<t t-if="! widget.get('effective_readonly')">
<textarea rows="1" style="width: 100%"
t-att-placeholder="widget.node.attrs.placeholder"></textarea>
</t>
</div>
</t>
<t t-name="FieldMany2ManyTags.box">
<!-- Individual m2m tag element -->
<t t-name="FieldMany2ManyTag">
<t t-set="i" t-value="0"/>
<t t-foreach="elements" t-as="el">
<span class="oe_form_field_many2manytags_box" t-att-data-index="i">
<span class="oe_field_many2many_tag" t-att-data-index="i">
<t t-esc="el[1]"/>
</span>
<t t-set="i" t-value="i + 1"/>