diff options
Diffstat (limited to 'addons/gamification/static/src')
| -rw-r--r-- | addons/gamification/static/src/css/goal.css | 16 | ||||
| -rw-r--r-- | addons/gamification/static/src/js/gamification.js | 25 | ||||
| -rw-r--r-- | addons/gamification/static/src/xml/gamification.xml | 18 |
3 files changed, 17 insertions, 42 deletions
diff --git a/addons/gamification/static/src/css/goal.css b/addons/gamification/static/src/css/goal.css index c113ac6ad2e..c4f74aae557 100644 --- a/addons/gamification/static/src/css/goal.css +++ b/addons/gamification/static/src/css/goal.css @@ -80,11 +80,8 @@ } /* mark goal as completed */ .openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_reached { - /*text-decoration: line-through;*/ - color: rgb(17, 95, 17); -} -.openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_failed { - color: rgb(95, 17, 17); + text-decoration: line-through; + color: rgb(138, 137, 137); } .openerp .oe_mail_wall_aside .oe_goals_list { @@ -94,7 +91,7 @@ width: 200px; } .openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal_outer_box { - background: rgb(173, 219, 178); + background: rgb(213, 213, 213); min-height: 32px; } .openerp .oe_mail_wall_aside .oe_goals_list .oe_goal_inner_box { @@ -110,8 +107,12 @@ .openerp .oe_mail_wall_aside .oe_goals_list .oe_goal_inner_box strong { padding-left: 5px; } -.openerp .oe_mail_wall .oe_mail_wall_aside table { +.openerp .oe_mail_wall .oe_mail_wall_aside table.oe_goals_list { margin: 10px 0; + border: solid 1px white; +} +.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goals_list thead { + font-weight: normal; } .oe_mail_wall_aside .oe_goals_list tbody tr:nth-child(even) { background-color: #fff; @@ -122,6 +123,7 @@ border: none; } .openerp .oe_mail_wall_aside .oe_goals_list thead th { + font-weight: normal; padding: 5px; } .openerp .oe_mail_wall_aside .oe_goals_list tbody tr { diff --git a/addons/gamification/static/src/js/gamification.js b/addons/gamification/static/src/js/gamification.js index 41b6125a4c9..edfc304f83f 100644 --- a/addons/gamification/static/src/js/gamification.js +++ b/addons/gamification/static/src/js/gamification.js @@ -79,8 +79,6 @@ openerp.gamification = function(instance) { if(self.goals_info.info.length > 0){ self.render_template_replace(self.$el.filter(".oe_gamification_goal"),'gamification.goal_list_to_do'); self.render_money_fields(self.goals_info.info[0].currency); - // self.render_progress_bars(); - self.render_piechars(); self.render_user_avatars(); } else { self.$el.filter(".oe_gamification_goal").hide(); @@ -117,29 +115,6 @@ openerp.gamification = function(instance) { money_field.replace($(this)); }); }, - render_progress_bars: function() { - var self = this; - - dfm = new instance.web.form.DefaultFieldManager(self); - // Generate a FieldMonetary for each .oe_goal_field_monetary - self.$(".oe_goal_progress").each(function() { - progress_field = new instance.web.form.FieldProgressBar(dfm, { - attrs: { - modifiers: '{"readonly": true}' - } - }); - progress_field.set('value', $(this).attr('value')); - progress_field.replace($(this)); - }); - }, - render_piechars: function() { - var self = this; - self.$(".oe_goal_sparkline_piechart").each(function() { - var completeness = parseInt( $(this).attr('data-completeness'), 10); - var values = [completeness, 100-completeness]; - $(this).sparkline(values, {type: 'pie', offset: 180, sliceColors: ['#0B610B','#F78181']}); - }); - }, render_user_avatars: function() { var self = this; self.$(".oe_user_avatar").each(function() { diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml index e3782a7d22b..c83862af829 100644 --- a/addons/gamification/static/src/xml/gamification.xml +++ b/addons/gamification/static/src/xml/gamification.xml @@ -11,13 +11,12 @@ <t t-if="plan.visibility_mode == 'progressbar'"> <div class="oe_goals_list"> - <div class="oe_goal_outer_box" t-foreach="plan.goals" t-as="goal" t-attf-style="width: #{goal.completeness}%;"> + <div t-attf-class="#{goal.type_display == 'progress' ? 'oe_goal_outer_box' : ''}" t-foreach="plan.goals" t-as="goal" t-attf-style="#{goal.type_display == 'progress' ? 'width: '+goal.completeness+'%;' : ''}"> <div class="oe_goal_inner_box"> - <!-- <span class="oe_goal_sparkline_piechart" t-att-data-completeness="goal.completeness"></span> --> - <strong t-attf-class="#{goal.state == 'reached' ? 'oe_goal_reached' : goal.state == 'failed' ? 'oe_goal_failed' : ''}" t-att-title="goal.type_description"><t t-esc="goal.type_name" /></strong> + <strong t-attf-class="#{goal.state == 'reached' ? 'oe_goal_reached' : ''}" t-att-title="goal.type_description"><t t-esc="goal.type_name" /></strong> <t t-if="goal.computation_mode == 'manually' or goal.type_action"> <a class="oe_goal_action oe_e" t-att-id="goal.id">&</a> - </t> + </t><br/> <t t-if="goal.type_display == 'progress'"> <t t-if="goal.type_condition == 'higher'"> @@ -38,11 +37,11 @@ </div> </t> <t t-if="plan.visibility_mode == 'board'"> - <table width="100%" border="1" t-foreach="plan.planlines" t-as="planline" class="oe_goals_list"> + <table t-foreach="plan.planlines" t-as="planline" class="oe_goals_list"> <thead> <tr> <th colspan="4" t-attf-title="#{planline.type_description ? planline.type_description : ''}"> - <t t-esc="planline.type_name"/> + <strong><t t-esc="planline.type_name"/></strong><br/> (Goal: max <span t-attf-class="#{planline.type_monetary ? 'oe_goal_field_monetary' : ''}"><t t-esc="planline.target_goal" /></span><t t-if="planline.type_unit"> <t t-esc="planline.type_unit"/></t>) <t t-if="planline.type_computation_mode == 'manually' or planline.type_action"> <a class="oe_goal_action oe_e" t-att-id="planline.own_goal_id">&</a> @@ -55,11 +54,10 @@ <div style="background: #fff;"> <th class="col0"><t t-esc="goal.rank" /></th> <td><img class="oe_user_avatar" t-attf-alt="#{goal.user_name}" t-attf-data-id="#{goal.user_id}"/></td> - <td class="col1" style="width:200px;"> + <td class="col1" style="width:180px;"> <div class="oe_goal_outer_box" t-attf-style="width: #{goal.completeness}%;"> <div class="oe_goal_inner_box"> - <!-- <span class="oe_goal_sparkline_piechart" t-att-data-completeness="goal.completeness"></span> --> - <t t-esc="goal.user_name"/> + <t t-esc="goal.user_name"/><br/> <span t-attf-class="#{planline.type_monetary ? 'oe_goal_field_monetary' : ''}"><t t-esc="goal.current" /></span><t t-if="planline.type_unit"> <t t-esc="planline.type_unit"/></t> </div> </div> @@ -77,7 +75,7 @@ <em>You have been invited to the following challenges:</em> <ul t-foreach="widget.challenge_suggestions.info" t-as="challenge" class="oe_challenge"> <li> - <strong><t t-esc="challenge.name"/></strong> <a class="oe_challenge_reply" t-attf-title="#{challenge.description.value ? challenge.description.value : ''}" t-attf-id="{challenge.id}">accept?</a> + <strong><a class="oe_challenge_reply" t-attf-title="#{challenge.description.value ? challenge.description.value : ''}" t-attf-id="{challenge.id}" title="more details..."><t t-esc="challenge.name"/></a></strong> </li> </ul> </t> |
