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
1=== modified file 'addons/web/static/lib/jquery.tipsy/jquery.tipsy.js'
2--- addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 2012-11-15 16:41:32 +0000
3+++ addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 2013-06-28 07:40:39 +0000
4@@ -71,9 +71,9 @@
5 }
6
7 if (this.options.fade) {
8- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
9+ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible', width: actualWidth}).animate({opacity: this.options.opacity});
10 } else {
11- $tip.css({visibility: 'visible', opacity: this.options.opacity});
12+ $tip.css({visibility: 'visible', opacity: this.options.opacity, width: actualWidth});
13 }
14 }
15 },
16
17=== modified file 'addons/web/static/src/css/base.css'
18--- addons/web/static/src/css/base.css 2013-06-19 12:51:06 +0000
19+++ addons/web/static/src/css/base.css 2013-06-28 07:40:39 +0000
20@@ -1294,7 +1294,7 @@
21 color: white;
22 padding: 2px 4px;
23 margin: 1px 6px 0 0;
24- border: 1px solid lightgrey;
25+ border: 1px solid lightGray;
26 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
27 -moz-border-radius: 4px;
28 -webkit-border-radius: 4px;
29@@ -1326,7 +1326,7 @@
30 transform: scale(1.1);
31 }
32 .openerp .oe_secondary_submenu .oe_active {
33- border-top: 1px solid lightgrey;
34+ border-top: 1px solid lightGray;
35 border-bottom: 1px solid #dedede;
36 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
37 -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2);
38@@ -2330,7 +2330,7 @@
39 }
40 .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
41 font-size: 80%;
42- color: darkgreen;
43+ color: darkGreen;
44 vertical-align: top;
45 position: relative;
46 top: -4px;
47@@ -3210,6 +3210,53 @@
48 float: right;
49 color: #333333;
50 }
51+.openerp .oe_form_field_legend .green, .openerp .oe_list_field_legends .green {
52+ border-radius: 6px 6px 6px 6px;
53+ display: inline-block;
54+ height: 12px;
55+ position: relative;
56+ top: 2px;
57+ width: 12px;
58+ background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
59+ background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
60+ background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
61+ background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
62+ background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
63+}
64+.openerp .oe_form_field_legend .red, .openerp .oe_list_field_legends .red {
65+ border-radius: 6px 6px 6px 6px;
66+ display: inline-block;
67+ height: 12px;
68+ position: relative;
69+ top: 2px;
70+ width: 12px;
71+ background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
72+ background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
73+ background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
74+ background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
75+ background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
76+}
77+.openerp .oe_form_field_legend .star {
78+ text-shadow: 0 0 2px black;
79+ vertical-align: top;
80+ position: relative;
81+ top: -8px;
82+ left: -2px;
83+ color: gold;
84+ display: inline-block;
85+ height: 12px;
86+}
87+.openerp .oe_list_field_legends .star {
88+ text-shadow: 0 0 4px black;
89+ vertical-align: top;
90+ position: relative;
91+ top: -2px;
92+ left: -3px;
93+ color: gold;
94+ display: inline-block;
95+ height: 12px;
96+ width: 12px;
97+}
98
99 @-moz-document url-prefix() {
100 .openerp .oe_view_manager .oe_view_manager_switch li {
101@@ -3227,6 +3274,10 @@
102 .openerp .oe_webclient .oe_star_on, .openerp .oe_webclient .oe_star_off {
103 top: 0px;
104 }
105+ .openerp .oe_list_field_legends .star {
106+ text-shadow: 0 0 2px black;
107+ top: 2px;
108+ }
109 }
110
111 .kitten-mode-activated {
112@@ -3471,6 +3522,7 @@
113 overflow: hidden !important;
114 }
115 }
116+
117 .blockUI.blockOverlay {
118 background-color: black;
119 opacity: 0.6;
120
121=== modified file 'addons/web/static/src/css/base.sass'
122--- addons/web/static/src/css/base.sass 2013-06-19 12:51:06 +0000
123+++ addons/web/static/src/css/base.sass 2013-06-28 07:40:39 +0000
124@@ -2533,6 +2533,51 @@
125 float: right
126 color: #333
127 // }}}
128+ // {{{ Legends [red],[green]and [star]
129+ .oe_form_field_legend .green, .oe_list_field_legends .green
130+ border-radius: 6px 6px 6px 6px
131+ display: inline-block
132+ height: 12px
133+ position: relative
134+ top: 2px
135+ width: 12px
136+ background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
137+ background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
138+ background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
139+ background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
140+ background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
141+ .oe_form_field_legend .red, .oe_list_field_legends .red
142+ border-radius: 6px 6px 6px 6px
143+ display: inline-block
144+ height: 12px
145+ position: relative
146+ top: 2px
147+ width: 12px
148+ background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
149+ background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
150+ background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
151+ background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
152+ background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
153+ .oe_form_field_legend .star
154+ text-shadow: 0 0 2px black
155+ vertical-align: top
156+ position: relative
157+ top: -8px
158+ left: -2px
159+ color: gold
160+ display: inline-block
161+ height: 12px
162+ .oe_list_field_legends .star
163+ text-shadow: 0 0 4px black
164+ vertical-align: top
165+ position: relative
166+ top: -2px
167+ left: -3px
168+ color: gold
169+ display: inline-block
170+ height: 12px
171+ width: 12px
172+ /// }}}
173 @-moz-document url-prefix()
174 .openerp
175 .oe_view_manager .oe_view_manager_switch li
176@@ -2546,6 +2591,9 @@
177 .oe_webclient
178 .oe_star_on, .oe_star_off
179 top: 0px
180+ .oe_list_field_legends .star
181+ text-shadow: 0 0 2px black
182+ top: 2px
183
184 // Kitten Mode {{{
185 .kitten-mode-activated
186
187=== modified file 'addons/web/static/src/js/formats.js'
188--- addons/web/static/src/js/formats.js 2013-04-09 14:44:14 +0000
189+++ addons/web/static/src/js/formats.js 2013-06-28 07:40:39 +0000
190@@ -120,6 +120,52 @@
191 };
192
193 /**
194+ * Replace the [green],[red] and [star] from the string
195+ * And Add the appropriate legends accordingly.
196+ *
197+ * @param {String} value -value of the field
198+ */
199+instance.web.parselegend = function(value, display_only) {
200+ var legends = {
201+ 'red': "<span class='red'/>",
202+ 'green': "<span class='green'/>",
203+ 'star': "<span class='oe_e star'>7</span>",
204+ }
205+ var result = "";
206+ _.each(_.str.lines(value), function (line) {
207+ line = _.str.clean(line);
208+ if(line){
209+ var matchs = line.match(/\[(.*?)\]/g);
210+ _.each(matchs, function(text){
211+ var key,
212+ value;
213+ key = text.substring(1, text.length-1);
214+ if(!_.isEmpty(display_only) &&!_.contains(display_only, key)){
215+ line = "";
216+ }
217+ value = legends[key.toLowerCase()];
218+ if (key && value){
219+ line = line.replace(/\[(.*?)\]/, value);
220+ }
221+ })
222+ if(line)
223+ result += line + '<br/>';
224+ }
225+
226+ });
227+ return result;
228+};
229+instance.web.show_legend = function(select, data) {
230+ select.tipsy({
231+ 'fade': true,
232+ 'title': function() { return data },
233+ 'gravity': $.fn.tipsy.autoNS,
234+ 'html': true,
235+ 'opacity': 0.8,
236+ 'trigger': 'hover'
237+ });
238+};
239+/**
240 * Formats a single atomic value based on a field descriptor
241 *
242 * @param {Object} value read from OpenERP
243
244=== modified file 'addons/web/static/src/js/view_form.js'
245--- addons/web/static/src/js/view_form.js 2013-06-18 13:35:21 +0000
246+++ addons/web/static/src/js/view_form.js 2013-06-28 07:40:39 +0000
247@@ -2685,6 +2685,20 @@
248 },
249 });
250
251+instance.web.form.FieldLegend = instance.web.form.FieldText.extend({
252+ render_value: function() {
253+ var value = this.get('value');
254+ if(this.get("effective_readonly")){
255+ this.$el.html(instance.web.parselegend(value || ''));
256+ } else {
257+ this._super.apply(this, arguments);
258+ }
259+ },
260+ renderElement: function() {
261+ this.template = this.get("effective_readonly") ? "FieldLegend" : "FieldText";
262+ this._super.apply(this, arguments);
263+ }
264+});
265 /**
266 * FieldTextHtml Widget
267 * Intended for FieldText widgets meant to display HTML content. This
268@@ -5645,6 +5659,7 @@
269 'many2many_binary': 'instance.web.form.FieldMany2ManyBinaryMultiFiles',
270 'statusbar': 'instance.web.form.FieldStatus',
271 'monetary': 'instance.web.form.FieldMonetary',
272+ 'legends': 'instance.web.form.FieldLegend'
273 });
274
275 /**
276
277=== modified file 'addons/web/static/src/js/view_list.js'
278--- addons/web/static/src/js/view_list.js 2013-06-13 17:24:14 +0000
279+++ addons/web/static/src/js/view_list.js 2013-06-28 07:40:39 +0000
280@@ -2061,7 +2061,8 @@
281 'field.handle': 'instance.web.list.Handle',
282 'button': 'instance.web.list.Button',
283 'field.many2onebutton': 'instance.web.list.Many2OneButton',
284- 'field.many2many': 'instance.web.list.Many2Many'
285+ 'field.many2many': 'instance.web.list.Many2Many',
286+ 'field.legends': 'instance.web.list.FieldLegend'
287 });
288 instance.web.list.columns.for_ = function (id, field, node) {
289 var description = _.extend({tag: node.tag}, field, node.attrs);
290@@ -2252,6 +2253,13 @@
291 });
292 }
293 });
294+instance.web.list.FieldLegend = instance.web.list.Column.extend({
295+ _format: function (row_data, options) {
296+ if(row_data[this.id].value) {
297+ return instance.web.parselegend(row_data[this.id].value);
298+ }
299+ }
300+});
301 instance.web.list.Handle = instance.web.list.Column.extend({
302 init: function () {
303 this._super.apply(this, arguments);
304
305=== modified file 'addons/web/static/src/xml/base.xml'
306--- addons/web/static/src/xml/base.xml 2013-06-13 17:24:14 +0000
307+++ addons/web/static/src/xml/base.xml 2013-06-28 07:40:39 +0000
308@@ -1069,6 +1069,9 @@
309 </t>
310 </div>
311 </t>
312+<t t-name="FieldLegend">
313+ <div class="oe_form_field_legend"></div>
314+</t>
315 <t t-name="FieldTextHtml">
316 <div t-att-class="'oe_form_field oe_form_field_html' + (widget.get('effective_readonly') ? ' oe_form_embedded_html' : '')"
317 t-att-style="widget.node.attrs.style">
318@@ -1201,7 +1204,7 @@
319 </table>
320 </t>
321 <t t-name="FieldBoolean">
322- <span class="oe_form_field oe_form_field_boolean" t-att-style="widget.node.attrs.style">
323+ <span class="oe_form_field oe_form_field_boolean" t-att-title="widget.node.attrs.title" t-att-style="widget.node.attrs.style">
324 <input type="checkbox"
325 t-att-id="widget.id_for_label"
326 t-att-name="widget.name"
327
328=== modified file 'addons/web/static/test/formats.js'
329--- addons/web/static/test/formats.js 2013-01-23 09:31:55 +0000
330+++ addons/web/static/test/formats.js 2013-06-28 07:40:39 +0000
331@@ -226,3 +226,14 @@
332 });
333
334 });
335+
336+openerp.testing.section('parse_legends', {
337+ dependencies: ['web.formats']
338+}, function (test) {
339+ test("legend_green", function (instance) {
340+ strictEqual(instance.web.parselegend('[green] tested ok'),"<span class='green'/> tested ok<br/>");
341+ 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/>");
342+ 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/>");
343+ 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/>");
344+ });
345+});
346
347=== modified file 'addons/web_kanban/static/src/css/kanban.css'
348--- addons/web_kanban/static/src/css/kanban.css 2013-04-29 11:03:58 +0000
349+++ addons/web_kanban/static/src/css/kanban.css 2013-06-28 07:40:39 +0000
350@@ -570,3 +570,43 @@
351 visibility: hidden; }
352 .openerp .oe_kanban_view .oe_kanban_group_title {
353 text-shadow: none !important; } }
354+
355+.tipsy-inner {
356+ padding: 3px 8px 3px 8px; }
357+ .tipsy-inner .green {
358+ margin: 0px 2px 2px 2px;
359+ border-radius: 6px 6px 6px 6px;
360+ display: inline-block;
361+ height: 10px;
362+ position: relative;
363+ top: 2px;
364+ width: 10px;
365+ background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
366+ background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
367+ background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
368+ background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green;
369+ background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green; }
370+ .tipsy-inner .red {
371+ margin: 0px 2px 2px 2px;
372+ border-radius: 6px 6px 6px 6px;
373+ display: inline-block;
374+ height: 10px;
375+ position: relative;
376+ top: 2px;
377+ width: 10px;
378+ background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
379+ background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
380+ background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
381+ background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red;
382+ background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red; }
383+ .tipsy-inner .star {
384+ font-size: 30px;
385+ color: gold;
386+ text-shadow: 0 0 2px black;
387+ display: inline-block;
388+ vertical-align: top;
389+ position: relative;
390+ top: -10px;
391+ height: 10px;
392+ width: 10px;
393+ margin-right: 4px; }
394
395=== modified file 'addons/web_kanban/static/src/css/kanban.sass'
396--- addons/web_kanban/static/src/css/kanban.sass 2013-04-29 11:03:58 +0000
397+++ addons/web_kanban/static/src/css/kanban.sass 2013-06-28 07:40:39 +0000
398@@ -565,7 +565,6 @@
399 @include vertical-gradient(#f6f6f6, #e3e3e3)
400 @include box-shadow((0 1px 2px rgba(0, 0, 0, .1), 0 1px 1px rgba(255, 255, 255, .8) inset))
401
402-
403 // Internet Explorer 9+ specifics {{{
404 .openerp_ie .oe_kanban_view
405 .oe_kanban_group_header .oe_kanban_group_title_vertical
406@@ -593,5 +592,46 @@
407 .oe_kanban_view .oe_kanban_group_title
408 text-shadow: none !important
409
410+// {{{ Legends [red],[green]and [star]
411+.tipsy-inner
412+ padding: 3px 8px 3px 8px
413+ .green
414+ margin: 0px 2px 2px 2px
415+ border-radius: 6px 6px 6px 6px
416+ display: inline-block
417+ height: 10px
418+ position: relative
419+ top: 2px
420+ width: 10px
421+ background: -webkit-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
422+ background: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
423+ background: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
424+ background: -o-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
425+ background: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%) repeat scroll center center green
426+ .red
427+ margin: 0px 2px 2px 2px
428+ border-radius: 6px 6px 6px 6px
429+ display: inline-block
430+ height: 10px
431+ position: relative
432+ top: 2px
433+ width: 10px
434+ background: -webkit-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
435+ background: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
436+ background: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
437+ background: -o-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
438+ background: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%) repeat scroll center center red
439+ .star
440+ font-size: 30px
441+ color: gold
442+ text-shadow: 0 0 2px black
443+ display: inline-block
444+ vertical-align: top
445+ position: relative
446+ top: -10px
447+ height: 10px
448+ width: 10px
449+ margin-right: 4px
450+// }}}
451 // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"
452 // vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:
453
454=== modified file 'addons/web_kanban/static/src/js/kanban.js'
455--- addons/web_kanban/static/src/js/kanban.js 2013-06-10 14:49:15 +0000
456+++ addons/web_kanban/static/src/js/kanban.js 2013-06-28 07:40:39 +0000
457@@ -634,6 +634,18 @@
458 this.is_started = true;
459 return def;
460 },
461+ get_legend: function(selector){
462+ var self = this;
463+ if (this.value) {
464+ return (new instance.web.Model(this.view.group_by_field.relation)).query([this.description_field]).filter([["id", "=", this.value]]).first().done(function(res){
465+ if(res[self.description_field]){
466+ self.description_data = instance.web.parselegend(res[self.description_field]);
467+ instance.web.show_legend(selector, self.description_data);
468+ }
469+ });
470+ }
471+ return
472+ },
473 compute_cards_auto_height: function() {
474 // oe_kanban_no_auto_height is an empty class used to disable this feature
475 if (!this.view.group_by) {