Merge lp:~openerp-dev/openerp-web/trunk-customize_kanban-pan into lp:openerp-web

Proposed by Anand
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/trunk-customize_kanban-pan
Merge into: lp:openerp-web
Diff against target: 475 lines (+283/-8)
11 files modified
addons/web/static/lib/jquery.tipsy/jquery.tipsy.js (+2/-2)
addons/web/static/src/css/base.css (+55/-3)
addons/web/static/src/css/base.sass (+48/-0)
addons/web/static/src/js/formats.js (+46/-0)
addons/web/static/src/js/view_form.js (+15/-0)
addons/web/static/src/js/view_list.js (+9/-1)
addons/web/static/src/xml/base.xml (+4/-1)
addons/web/static/test/formats.js (+11/-0)
addons/web_kanban/static/src/css/kanban.css (+40/-0)
addons/web_kanban/static/src/css/kanban.sass (+41/-1)
addons/web_kanban/static/src/js/kanban.js (+12/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-customize_kanban-pan
Reviewer Review Type Date Requested Status
Nicolas Vanhoren (OpenERP) (community) Disapprove
SnippetBucket.com Pending
Review via email: mp+164842@code.launchpad.net

This proposal supersedes a proposal from 2013-03-20.

Description of the change

Hello,

 Improved the description/requirements field in stage and put the legend in following [Task,Opportunity,Applicant].

 1) Here if user enters like below and save:

   [green] = ready for next stage
   [red] = Blocked
   [Star] [Star] [Star] = High priority

then:-> in the read_only page view the value inside the square bracket '[]' should appear accordingly.
        if [green] then green's image , if [red] then red's image and if [star] then star's image.

 2) Made The Legend tool tip of the column in kanban. So that no need to go form_view of the stage to see the
   description or the requirements.the tool tip available on hover on the title of kanban column.

 3) Added help string below description field so that user can understand that how to enter the legends value.

 4) Added records in to the data file for the preconfigured legends.

 5) Added the 'legends' widget in requirement/Description field of [Task,Opportunity,Applicant] form view.
    And also added js files in crm and hr_applicant for that.

 6) Make visible legends in the list view of the stage for more user help.

 Improved project kanbanview and form view

 1) [] Use tasks -> if true the "as: [ Tasks ]" appears. the user can rename Issues into whatever he wants
    [] Use issues-> if true the "as: [ Issues ]" appears. the user can rename Issues into whatever he wants

 2) rename the tab Task Stages into "Stages"

 3) If the user select use Issues, the tab "Stages" must appear

    Pad Link: http://pad.openerp.com/p/openerp-project.task-H2CYUKWGJN

Kindly Review the code.

Thanks,
PAN

To post a comment you must log in.
Revision history for this message
SnippetBucket.com (tta-openerp) wrote : Posted in a previous version of this proposal

Hello Anand,

Very bad implementation.

* Ugly coded: 'mouseenter' event, line 86, each time mouse enter it makes server calls.
Server call only once not each time mouse over.

* convert_image, Give proper function name like parse_legends(...). Also make proper code for parsing legends.

* Line no. 139, 140, 141 .
As you coded,
  if(self.dataset.model == "project.task") return 'description';
This should not be here, move it to project module, similarly others too.

* Improve coding,
 -> Line 11,14, 20,23,... this._super.apply(this,arguments); please add space between two argument.
     Correct it : this._super.apply(this, arguments);

Thanks,
tta

review: Disapprove
3754. By Anand

[IMP] remove conflicts and merged with trunk

3755. By Anand

[IMP] remove conflicts

3756. By RGA(OpenERP)

Merge with trunk

3757. By RGA(OpenERP)

[IMP] change legend description for star tag

3758. By RGA(OpenERP)

[FIX] legend items are not aligned

3759. By RGA(OpenERP)

[IMP] support multi line legend description

3760. By RGA(OpenERP)

[IMP] refactore parser: now legend tag can parse any where in line not only at begining, legend key is not casesensetive now

3761. By RGA(OpenERP)

Merge with trunk

3762. By RGA(OpenERP)

Merge with trunk

3763. By RGA(OpenERP)

[IMP]support title attribute for boolean field, it usefully to display tips on checkbox, openerp help display only on lable of checkbox

3764. By RGA(OpenERP)

Merge with trunk

3765. By RGA(OpenERP)

update web test case for legend widget

Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

- You must not modify an existing library, ever.
- The file formats.js is not dedicated to that kind of stuff. It should not be altered in any way.
- I don't like the whole idea of creating new field types for just a legend, I think that feature should be re-created by one of the persons responsible of the web client.

review: Disapprove
Revision history for this message
Pascal TAGO (tagopas) wrote :

Hi

cannot launch openerp since i upgrade my ubuntu to 13.04

can u help me

I have message telling me that the package distribution PIL is not found.

I 've reinstall the  PIL  but no positive result   The same bug is still hanging

Best regards

________________________________
 De : Nicolas V.(OpenERP) <email address hidden>
À : Anandkumar (OpenERP) <email address hidden>
Envoyé le : Mercredi 26 juin 2013 10h13
Objet : Re: [Merge] lp:~openerp-dev/openerp-web/trunk-customize_kanban-pan into lp:openerp-web

Review: Disapprove

- You must not modify an existing library, ever.
- The file formats.js is not dedicated to that kind of stuff. It should not be altered in any way.
- I don't like the whole idea of creating new field types for just a legend, I think that feature should be re-created by one of the persons responsible of the web client.
--
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-customize_kanban-pan/+merge/164842
You are subscribed to branch lp:openerp-web.

3766. By RGA(OpenERP)

Merge with trunk

3767. By RGA(OpenERP)

[IMP] tooltips display according to viewport (top or bottom side)

3768. By RGA(OpenERP)

[IMP] tooltips: remvoe float alingment for .star

3769. By RGA(OpenERP)

[IMP] add option to dipslay only perticular state msg in tooltips

Unmerged revisions

3769. By RGA(OpenERP)

[IMP] add option to dipslay only perticular state msg in tooltips

3768. By RGA(OpenERP)

[IMP] tooltips: remvoe float alingment for .star

3767. By RGA(OpenERP)

[IMP] tooltips display according to viewport (top or bottom side)

3766. By RGA(OpenERP)

Merge with trunk

3765. By RGA(OpenERP)

update web test case for legend widget

3764. By RGA(OpenERP)

Merge with trunk

3763. By RGA(OpenERP)

[IMP]support title attribute for boolean field, it usefully to display tips on checkbox, openerp help display only on lable of checkbox

3762. By RGA(OpenERP)

Merge with trunk

3761. By RGA(OpenERP)

Merge with trunk

3760. By RGA(OpenERP)

[IMP] refactore parser: now legend tag can parse any where in line not only at begining, legend key is not casesensetive now

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/static/lib/jquery.tipsy/jquery.tipsy.js'
--- addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 2012-11-15 16:41:32 +0000
+++ addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 2013-06-28 07:40:39 +0000
@@ -71,9 +71,9 @@
71 }71 }
72 72
73 if (this.options.fade) {73 if (this.options.fade) {
74 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});74 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible', width: actualWidth}).animate({opacity: this.options.opacity});
75 } else {75 } else {
76 $tip.css({visibility: 'visible', opacity: this.options.opacity});76 $tip.css({visibility: 'visible', opacity: this.options.opacity, width: actualWidth});
77 }77 }
78 }78 }
79 },79 },
8080
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css 2013-06-19 12:51:06 +0000
+++ addons/web/static/src/css/base.css 2013-06-28 07:40:39 +0000
@@ -1294,7 +1294,7 @@
1294 color: white;1294 color: white;
1295 padding: 2px 4px;1295 padding: 2px 4px;
1296 margin: 1px 6px 0 0;1296 margin: 1px 6px 0 0;
1297 border: 1px solid lightgrey;1297 border: 1px solid lightGray;
1298 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);1298 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
1299 -moz-border-radius: 4px;1299 -moz-border-radius: 4px;
1300 -webkit-border-radius: 4px;1300 -webkit-border-radius: 4px;
@@ -1326,7 +1326,7 @@
1326 transform: scale(1.1);1326 transform: scale(1.1);
1327}1327}
1328.openerp .oe_secondary_submenu .oe_active {1328.openerp .oe_secondary_submenu .oe_active {
1329 border-top: 1px solid lightgrey;1329 border-top: 1px solid lightGray;
1330 border-bottom: 1px solid #dedede;1330 border-bottom: 1px solid #dedede;
1331 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);1331 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
1332 -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2);1332 -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2);
@@ -2330,7 +2330,7 @@
2330}2330}
2331.openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {2331.openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
2332 font-size: 80%;2332 font-size: 80%;
2333 color: darkgreen;2333 color: darkGreen;
2334 vertical-align: top;2334 vertical-align: top;
2335 position: relative;2335 position: relative;
2336 top: -4px;2336 top: -4px;
@@ -3210,6 +3210,53 @@
3210 float: right;3210 float: right;
3211 color: #333333;3211 color: #333333;
3212}3212}
3213.openerp .oe_form_field_legend .green, .openerp .oe_list_field_legends .green {
3214 border-radius: 6px 6px 6px 6px;
3215 display: inline-block;
3216 height: 12px;
3217 position: relative;
3218 top: 2px;
3219 width: 12px;
3220 background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
3221 background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
3222 background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
3223 background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
3224 background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
3225}
3226.openerp .oe_form_field_legend .red, .openerp .oe_list_field_legends .red {
3227 border-radius: 6px 6px 6px 6px;
3228 display: inline-block;
3229 height: 12px;
3230 position: relative;
3231 top: 2px;
3232 width: 12px;
3233 background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
3234 background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
3235 background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
3236 background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
3237 background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
3238}
3239.openerp .oe_form_field_legend .star {
3240 text-shadow: 0 0 2px black;
3241 vertical-align: top;
3242 position: relative;
3243 top: -8px;
3244 left: -2px;
3245 color: gold;
3246 display: inline-block;
3247 height: 12px;
3248}
3249.openerp .oe_list_field_legends .star {
3250 text-shadow: 0 0 4px black;
3251 vertical-align: top;
3252 position: relative;
3253 top: -2px;
3254 left: -3px;
3255 color: gold;
3256 display: inline-block;
3257 height: 12px;
3258 width: 12px;
3259}
32133260
3214@-moz-document url-prefix() {3261@-moz-document url-prefix() {
3215 .openerp .oe_view_manager .oe_view_manager_switch li {3262 .openerp .oe_view_manager .oe_view_manager_switch li {
@@ -3227,6 +3274,10 @@
3227 .openerp .oe_webclient .oe_star_on, .openerp .oe_webclient .oe_star_off {3274 .openerp .oe_webclient .oe_star_on, .openerp .oe_webclient .oe_star_off {
3228 top: 0px;3275 top: 0px;
3229 }3276 }
3277 .openerp .oe_list_field_legends .star {
3278 text-shadow: 0 0 2px black;
3279 top: 2px;
3280 }
3230}3281}
32313282
3232.kitten-mode-activated {3283.kitten-mode-activated {
@@ -3471,6 +3522,7 @@
3471 overflow: hidden !important;3522 overflow: hidden !important;
3472 }3523 }
3473}3524}
3525
3474.blockUI.blockOverlay {3526.blockUI.blockOverlay {
3475 background-color: black;3527 background-color: black;
3476 opacity: 0.6;3528 opacity: 0.6;
34773529
=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass 2013-06-19 12:51:06 +0000
+++ addons/web/static/src/css/base.sass 2013-06-28 07:40:39 +0000
@@ -2533,6 +2533,51 @@
2533 float: right2533 float: right
2534 color: #3332534 color: #333
2535 // }}}2535 // }}}
2536 // {{{ Legends [red],[green]and [star]
2537 .oe_form_field_legend .green, .oe_list_field_legends .green
2538 border-radius: 6px 6px 6px 6px
2539 display: inline-block
2540 height: 12px
2541 position: relative
2542 top: 2px
2543 width: 12px
2544 background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
2545 background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
2546 background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
2547 background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
2548 background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
2549 .oe_form_field_legend .red, .oe_list_field_legends .red
2550 border-radius: 6px 6px 6px 6px
2551 display: inline-block
2552 height: 12px
2553 position: relative
2554 top: 2px
2555 width: 12px
2556 background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
2557 background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
2558 background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
2559 background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
2560 background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
2561 .oe_form_field_legend .star
2562 text-shadow: 0 0 2px black
2563 vertical-align: top
2564 position: relative
2565 top: -8px
2566 left: -2px
2567 color: gold
2568 display: inline-block
2569 height: 12px
2570 .oe_list_field_legends .star
2571 text-shadow: 0 0 4px black
2572 vertical-align: top
2573 position: relative
2574 top: -2px
2575 left: -3px
2576 color: gold
2577 display: inline-block
2578 height: 12px
2579 width: 12px
2580 /// }}}
2536@-moz-document url-prefix()2581@-moz-document url-prefix()
2537 .openerp2582 .openerp
2538 .oe_view_manager .oe_view_manager_switch li2583 .oe_view_manager .oe_view_manager_switch li
@@ -2546,6 +2591,9 @@
2546 .oe_webclient2591 .oe_webclient
2547 .oe_star_on, .oe_star_off2592 .oe_star_on, .oe_star_off
2548 top: 0px2593 top: 0px
2594 .oe_list_field_legends .star
2595 text-shadow: 0 0 2px black
2596 top: 2px
25492597
2550// Kitten Mode {{{2598// Kitten Mode {{{
2551.kitten-mode-activated2599.kitten-mode-activated
25522600
=== modified file 'addons/web/static/src/js/formats.js'
--- addons/web/static/src/js/formats.js 2013-04-09 14:44:14 +0000
+++ addons/web/static/src/js/formats.js 2013-06-28 07:40:39 +0000
@@ -120,6 +120,52 @@
120};120};
121121
122/**122/**
123 * Replace the [green],[red] and [star] from the string
124 * And Add the appropriate legends accordingly.
125 *
126 * @param {String} value -value of the field
127 */
128instance.web.parselegend = function(value, display_only) {
129 var legends = {
130 'red': "<span class='red'/>",
131 'green': "<span class='green'/>",
132 'star': "<span class='oe_e star'>7</span>",
133 }
134 var result = "";
135 _.each(_.str.lines(value), function (line) {
136 line = _.str.clean(line);
137 if(line){
138 var matchs = line.match(/\[(.*?)\]/g);
139 _.each(matchs, function(text){
140 var key,
141 value;
142 key = text.substring(1, text.length-1);
143 if(!_.isEmpty(display_only) &&!_.contains(display_only, key)){
144 line = "";
145 }
146 value = legends[key.toLowerCase()];
147 if (key && value){
148 line = line.replace(/\[(.*?)\]/, value);
149 }
150 })
151 if(line)
152 result += line + '<br/>';
153 }
154
155 });
156 return result;
157};
158instance.web.show_legend = function(select, data) {
159 select.tipsy({
160 'fade': true,
161 'title': function() { return data },
162 'gravity': $.fn.tipsy.autoNS,
163 'html': true,
164 'opacity': 0.8,
165 'trigger': 'hover'
166 });
167};
168/**
123 * Formats a single atomic value based on a field descriptor169 * Formats a single atomic value based on a field descriptor
124 *170 *
125 * @param {Object} value read from OpenERP171 * @param {Object} value read from OpenERP
126172
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2013-06-18 13:35:21 +0000
+++ addons/web/static/src/js/view_form.js 2013-06-28 07:40:39 +0000
@@ -2685,6 +2685,20 @@
2685 },2685 },
2686});2686});
26872687
2688instance.web.form.FieldLegend = instance.web.form.FieldText.extend({
2689 render_value: function() {
2690 var value = this.get('value');
2691 if(this.get("effective_readonly")){
2692 this.$el.html(instance.web.parselegend(value || ''));
2693 } else {
2694 this._super.apply(this, arguments);
2695 }
2696 },
2697 renderElement: function() {
2698 this.template = this.get("effective_readonly") ? "FieldLegend" : "FieldText";
2699 this._super.apply(this, arguments);
2700 }
2701});
2688/**2702/**
2689 * FieldTextHtml Widget2703 * FieldTextHtml Widget
2690 * Intended for FieldText widgets meant to display HTML content. This2704 * Intended for FieldText widgets meant to display HTML content. This
@@ -5645,6 +5659,7 @@
5645 'many2many_binary': 'instance.web.form.FieldMany2ManyBinaryMultiFiles',5659 'many2many_binary': 'instance.web.form.FieldMany2ManyBinaryMultiFiles',
5646 'statusbar': 'instance.web.form.FieldStatus',5660 'statusbar': 'instance.web.form.FieldStatus',
5647 'monetary': 'instance.web.form.FieldMonetary',5661 'monetary': 'instance.web.form.FieldMonetary',
5662 'legends': 'instance.web.form.FieldLegend'
5648});5663});
56495664
5650/**5665/**
56515666
=== modified file 'addons/web/static/src/js/view_list.js'
--- addons/web/static/src/js/view_list.js 2013-06-13 17:24:14 +0000
+++ addons/web/static/src/js/view_list.js 2013-06-28 07:40:39 +0000
@@ -2061,7 +2061,8 @@
2061 'field.handle': 'instance.web.list.Handle',2061 'field.handle': 'instance.web.list.Handle',
2062 'button': 'instance.web.list.Button',2062 'button': 'instance.web.list.Button',
2063 'field.many2onebutton': 'instance.web.list.Many2OneButton',2063 'field.many2onebutton': 'instance.web.list.Many2OneButton',
2064 'field.many2many': 'instance.web.list.Many2Many'2064 'field.many2many': 'instance.web.list.Many2Many',
2065 'field.legends': 'instance.web.list.FieldLegend'
2065});2066});
2066instance.web.list.columns.for_ = function (id, field, node) {2067instance.web.list.columns.for_ = function (id, field, node) {
2067 var description = _.extend({tag: node.tag}, field, node.attrs);2068 var description = _.extend({tag: node.tag}, field, node.attrs);
@@ -2252,6 +2253,13 @@
2252 });2253 });
2253 }2254 }
2254});2255});
2256instance.web.list.FieldLegend = instance.web.list.Column.extend({
2257 _format: function (row_data, options) {
2258 if(row_data[this.id].value) {
2259 return instance.web.parselegend(row_data[this.id].value);
2260 }
2261 }
2262});
2255instance.web.list.Handle = instance.web.list.Column.extend({2263instance.web.list.Handle = instance.web.list.Column.extend({
2256 init: function () {2264 init: function () {
2257 this._super.apply(this, arguments);2265 this._super.apply(this, arguments);
22582266
=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml 2013-06-13 17:24:14 +0000
+++ addons/web/static/src/xml/base.xml 2013-06-28 07:40:39 +0000
@@ -1069,6 +1069,9 @@
1069 </t>1069 </t>
1070 </div>1070 </div>
1071</t>1071</t>
1072<t t-name="FieldLegend">
1073 <div class="oe_form_field_legend"></div>
1074</t>
1072<t t-name="FieldTextHtml">1075<t t-name="FieldTextHtml">
1073 <div t-att-class="'oe_form_field oe_form_field_html' + (widget.get('effective_readonly') ? ' oe_form_embedded_html' : '')"1076 <div t-att-class="'oe_form_field oe_form_field_html' + (widget.get('effective_readonly') ? ' oe_form_embedded_html' : '')"
1074 t-att-style="widget.node.attrs.style">1077 t-att-style="widget.node.attrs.style">
@@ -1201,7 +1204,7 @@
1201 </table>1204 </table>
1202</t>1205</t>
1203<t t-name="FieldBoolean">1206<t t-name="FieldBoolean">
1204 <span class="oe_form_field oe_form_field_boolean" t-att-style="widget.node.attrs.style">1207 <span class="oe_form_field oe_form_field_boolean" t-att-title="widget.node.attrs.title" t-att-style="widget.node.attrs.style">
1205 <input type="checkbox"1208 <input type="checkbox"
1206 t-att-id="widget.id_for_label"1209 t-att-id="widget.id_for_label"
1207 t-att-name="widget.name"1210 t-att-name="widget.name"
12081211
=== modified file 'addons/web/static/test/formats.js'
--- addons/web/static/test/formats.js 2013-01-23 09:31:55 +0000
+++ addons/web/static/test/formats.js 2013-06-28 07:40:39 +0000
@@ -226,3 +226,14 @@
226 });226 });
227227
228});228});
229
230openerp.testing.section('parse_legends', {
231 dependencies: ['web.formats']
232}, function (test) {
233 test("legend_green", function (instance) {
234 strictEqual(instance.web.parselegend('[green] tested ok'),"<span class='green'/> tested ok<br/>");
235 strictEqual(instance.web.parselegend('Between [star] legend [star] [green] [star]'),"Between <span class='oe_e star'>7</span> legend <span class='oe_e star'>7</span> <span class='green'/> <span class='oe_e star'>7</span><br/>");
236 strictEqual(instance.web.parselegend('Multiple lengend per line [green][red][star]'),"Multiple lengend per line <span class='green'/><span class='red'/><span class='oe_e star'>7</span><br/>");
237 strictEqual(instance.web.parselegend('Case test [STAR] [greeN] [rEd]'),"Case test <span class='oe_e star'>7</span> <span class='green'/> <span class='red'/><br/>");
238 });
239});
229240
=== modified file 'addons/web_kanban/static/src/css/kanban.css'
--- addons/web_kanban/static/src/css/kanban.css 2013-04-29 11:03:58 +0000
+++ addons/web_kanban/static/src/css/kanban.css 2013-06-28 07:40:39 +0000
@@ -570,3 +570,43 @@
570 visibility: hidden; }570 visibility: hidden; }
571 .openerp .oe_kanban_view .oe_kanban_group_title {571 .openerp .oe_kanban_view .oe_kanban_group_title {
572 text-shadow: none !important; } }572 text-shadow: none !important; } }
573
574.tipsy-inner {
575 padding: 3px 8px 3px 8px; }
576 .tipsy-inner .green {
577 margin: 0px 2px 2px 2px;
578 border-radius: 6px 6px 6px 6px;
579 display: inline-block;
580 height: 10px;
581 position: relative;
582 top: 2px;
583 width: 10px;
584 background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
585 background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
586 background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
587 background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
588 background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green; }
589 .tipsy-inner .red {
590 margin: 0px 2px 2px 2px;
591 border-radius: 6px 6px 6px 6px;
592 display: inline-block;
593 height: 10px;
594 position: relative;
595 top: 2px;
596 width: 10px;
597 background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
598 background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
599 background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
600 background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
601 background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red; }
602 .tipsy-inner .star {
603 font-size: 30px;
604 color: gold;
605 text-shadow: 0 0 2px black;
606 display: inline-block;
607 vertical-align: top;
608 position: relative;
609 top: -10px;
610 height: 10px;
611 width: 10px;
612 margin-right: 4px; }
573613
=== modified file 'addons/web_kanban/static/src/css/kanban.sass'
--- addons/web_kanban/static/src/css/kanban.sass 2013-04-29 11:03:58 +0000
+++ addons/web_kanban/static/src/css/kanban.sass 2013-06-28 07:40:39 +0000
@@ -565,7 +565,6 @@
565 @include vertical-gradient(#f6f6f6, #e3e3e3)565 @include vertical-gradient(#f6f6f6, #e3e3e3)
566 @include box-shadow((0 1px 2px rgba(0, 0, 0, .1), 0 1px 1px rgba(255, 255, 255, .8) inset))566 @include box-shadow((0 1px 2px rgba(0, 0, 0, .1), 0 1px 1px rgba(255, 255, 255, .8) inset))
567567
568
569// Internet Explorer 9+ specifics {{{568// Internet Explorer 9+ specifics {{{
570.openerp_ie .oe_kanban_view569.openerp_ie .oe_kanban_view
571 .oe_kanban_group_header .oe_kanban_group_title_vertical570 .oe_kanban_group_header .oe_kanban_group_title_vertical
@@ -593,5 +592,46 @@
593 .oe_kanban_view .oe_kanban_group_title592 .oe_kanban_view .oe_kanban_group_title
594 text-shadow: none !important593 text-shadow: none !important
595594
595// {{{ Legends [red],[green]and [star]
596.tipsy-inner
597 padding: 3px 8px 3px 8px
598 .green
599 margin: 0px 2px 2px 2px
600 border-radius: 6px 6px 6px 6px
601 display: inline-block
602 height: 10px
603 position: relative
604 top: 2px
605 width: 10px
606 background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
607 background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
608 background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
609 background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
610 background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
611 .red
612 margin: 0px 2px 2px 2px
613 border-radius: 6px 6px 6px 6px
614 display: inline-block
615 height: 10px
616 position: relative
617 top: 2px
618 width: 10px
619 background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
620 background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
621 background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
622 background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
623 background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
624 .star
625 font-size: 30px
626 color: gold
627 text-shadow: 0 0 2px black
628 display: inline-block
629 vertical-align: top
630 position: relative
631 top: -10px
632 height: 10px
633 width: 10px
634 margin-right: 4px
635// }}}
596// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"636// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"
597// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:637// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:
598638
=== modified file 'addons/web_kanban/static/src/js/kanban.js'
--- addons/web_kanban/static/src/js/kanban.js 2013-06-10 14:49:15 +0000
+++ addons/web_kanban/static/src/js/kanban.js 2013-06-28 07:40:39 +0000
@@ -634,6 +634,18 @@
634 this.is_started = true;634 this.is_started = true;
635 return def;635 return def;
636 },636 },
637 get_legend: function(selector){
638 var self = this;
639 if (this.value) {
640 return (new instance.web.Model(this.view.group_by_field.relation)).query([this.description_field]).filter([["id", "=", this.value]]).first().done(function(res){
641 if(res[self.description_field]){
642 self.description_data = instance.web.parselegend(res[self.description_field]);
643 instance.web.show_legend(selector, self.description_data);
644 }
645 });
646 }
647 return
648 },
637 compute_cards_auto_height: function() {649 compute_cards_auto_height: function() {
638 // oe_kanban_no_auto_height is an empty class used to disable this feature650 // oe_kanban_no_auto_height is an empty class used to disable this feature
639 if (!this.view.group_by) {651 if (!this.view.group_by) {