summaryrefslogtreecommitdiff
path: root/addons/gamification
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-04-29 15:05:36 +0200
committerMartin Trigaux <mat@openerp.com>2013-04-29 15:05:36 +0200
commit6eaf93264b3f87c185ed4bf0ccf759a2c92138ad (patch)
treee0c955732cff2c371c6e9753b113418a5c11d2a8 /addons/gamification
parentf99ce17ecf8234542914458b5b2ba1f101781f22 (diff)
parent0c59ac9fcc684f805f6500915e852e2bda362258 (diff)
[IMP] small fixes
bzr revid: mat@openerp.com-20130429130536-gx2vtz8qgy3ogx5u
Diffstat (limited to 'addons/gamification')
-rw-r--r--addons/gamification/badge_view.xml5
-rw-r--r--addons/gamification/goal.py4
-rw-r--r--addons/gamification/goal_base_data.xml4
-rw-r--r--addons/gamification/goal_view.xml4
-rw-r--r--addons/gamification/static/src/css/gamification.css7
-rw-r--r--addons/gamification/static/src/xml/gamification.xml49
6 files changed, 39 insertions, 34 deletions
diff --git a/addons/gamification/badge_view.xml b/addons/gamification/badge_view.xml
index 8d4db8dff8e..3f2199d1a2b 100644
--- a/addons/gamification/badge_view.xml
+++ b/addons/gamification/badge_view.xml
@@ -159,9 +159,8 @@
<div class="oe_grey">Can not grant</div>
</t>
<p>
- <strong>Stats</strong><br/>
- Total: <t t-esc="record.stat_count.raw_value"/><br/>
- This month: <t t-esc="record.stat_this_month.raw_value"/>
+ <strong><t t-esc="record.stat_count.raw_value"/></strong> granted,<br/>
+ <strong><t t-esc="record.stat_this_month.raw_value"/></strong> this month
</p>
</div>
<div class="oe_kanban_badge_avatars">
diff --git a/addons/gamification/goal.py b/addons/gamification/goal.py
index 3398f094a37..cb0e554370c 100644
--- a/addons/gamification/goal.py
+++ b/addons/gamification/goal.py
@@ -59,7 +59,7 @@ class gamification_goal_type(osv.Model):
return res
_columns = {
- 'name': fields.char('Goal Type Name', required=True, translate=True),
+ 'name': fields.char('Goal Type', required=True, translate=True),
'description': fields.text('Goal Description'),
'monetary': fields.boolean('Monetary Value', help="The target and current value are defined in the company currency."),
@@ -95,7 +95,7 @@ class gamification_goal_type(osv.Model):
help="Technical filters rules to apply",
required=True),
'compute_code': fields.char('Compute Code',
- help="The name of the python method that will be executed to verify if a user can receive this badge."),
+ help="The name of the python method that will be executed to compute the current value. See the file gamification/goal_type_data.py for examples."),
'condition': fields.selection([
('higher', 'The higher the better'),
diff --git a/addons/gamification/goal_base_data.xml b/addons/gamification/goal_base_data.xml
index a4790a1c692..e2861bda863 100644
--- a/addons/gamification/goal_base_data.xml
+++ b/addons/gamification/goal_base_data.xml
@@ -79,7 +79,7 @@
<!-- plans -->
<record model="gamification.goal.plan" id="plan_base_discover">
- <field name="name">Manage your Personal Profile</field>
+ <field name="name">Complete your Profile</field>
<field name="period">once</field>
<field name="visibility_mode">progressbar</field>
<field name="report_message_frequency">never</field>
@@ -89,7 +89,7 @@
</record>
<record model="gamification.goal.plan" id="plan_base_configure">
- <field name="name">Manage your Company Profile</field>
+ <field name="name">Setup your Company</field>
<field name="period">once</field>
<field name="visibility_mode">progressbar</field>
<field name="report_message_frequency">never</field>
diff --git a/addons/gamification/goal_view.xml b/addons/gamification/goal_view.xml
index 42907747887..4e8612e5128 100644
--- a/addons/gamification/goal_view.xml
+++ b/addons/gamification/goal_view.xml
@@ -249,8 +249,8 @@
</group>
<group string="Formating Options">
<field name="display_mode" widget="radio" />
- <field name="unit" class="oe_inline"/>
- <field name="monetary" class="oe_inline"/>
+ <field name="unit" placeholder="e.g. days"/>
+ <field name="monetary"/>
</group>
<group string="Clickable Goals">
<field name="action_id" class="oe_inline"/>
diff --git a/addons/gamification/static/src/css/gamification.css b/addons/gamification/static/src/css/gamification.css
index 15a6daa48d2..cc20afede80 100644
--- a/addons/gamification/static/src/css/gamification.css
+++ b/addons/gamification/static/src/css/gamification.css
@@ -119,7 +119,7 @@
.openerp .oe_mail_wall_aside .oe_goals_list .oe_cell.oe_goal_current {
font-size: 150%;
font-weight: bold;
- min-width: 20px;
+ min-width: 50px;
padding: 0 5px;
}
.openerp .oe_mail_wall_aside .oe_goals_list .oe_no_progress.oe_goal_reached .oe_cell {
@@ -160,10 +160,7 @@
padding-left: 0;
margin-top: 5px;
margin-bottom: 10px;
- width: 95%;
-}
-.openerp .oe_mail_wall_aside .oe_goals_list .oe_row {
- margin-bottom: 10px;
+ width: 100%;
}
.openerp .oe_mail_wall_aside .oe_goals_list .oe_thead {
diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml
index 97b69453490..1c655afbb64 100644
--- a/addons/gamification/static/src/xml/gamification.xml
+++ b/addons/gamification/static/src/xml/gamification.xml
@@ -16,29 +16,28 @@
<t t-if="goal.type_display == 'progress'">
<div class="oe_goal_progress_background"></div>
<div class="oe_goal_progress" t-attf-style="#{goal.type_display == 'progress' ? 'width: '+goal.completeness+'%;' : 'width:0;'}"></div>
+ <div class="oe_cell oe_goal_current"><t t-esc="goal.current" /></div>
</t>
-
- <t t-if="goal.type_display == 'progress'">
- <div class="oe_cell oe_goal_current"><t t-esc="goal.current" /></div>
+ <div class="oe_cell">
+ <t t-if="goal.computation_mode != 'manually' and !goal.type_action">
+ <span t-att-title="goal.type_description"><t t-esc="goal.type_name" /></span>
</t>
- <div class="oe_cell">
- <t t-if="goal.computation_mode != 'manually' and !goal.type_action">
- <span t-att-title="goal.type_description"><t t-esc="goal.type_name" /></span>
- </t>
- <t t-if="goal.type_action or goal.computation_mode == 'manually'">
- <span t-att-title="goal.type_description"><a class="oe_goal_action" t-att-id="goal.id"><t t-esc="goal.type_name" /></a></span>
- </t>
- <t t-if="goal.type_display == 'progress'">
+ <t t-if="goal.type_action or goal.computation_mode == 'manually'">
+ <span t-att-title="goal.type_description"><a class="oe_goal_action" t-att-id="goal.id"><t t-esc="goal.type_name" /></a></span>
+ </t>
+ <t t-if="goal.type_display == 'progress'"><br/>
+ <div class="oe_grey">
<t t-if="goal.type_condition == 'higher'">
- (target:
+ Target:
</t>
<t t-if="goal.type_condition == 'lower'">
- (target less than:
+ Target less than:
</t>
<span t-attf-class="#{goal.type_monetary ? 'oe_goal_field_monetary' : ''}"><t t-esc="goal.target_goal"/></span>
- <t t-if="goal.type_unit"><t t-esc="goal.type_unit"/></t>)
- </t>
- </div>
+ <t t-if="goal.type_unit"><t t-esc="goal.type_unit"/></t>
+ </div>
+ </t>
+ </div>
</div>
</div>
</t>
@@ -61,7 +60,7 @@
</div>
</div>
<div t-foreach="planline.goals" t-as="goal" t-attf-class="#{goal.id == planline.own_goal_id ? 'oe_bold' : ''}">
- <div class="oe_row oe_goal_outer_box">
+ <div t-attf-class="oe_row oe_goal_outer_box #{goal.state == 'reached' ? 'oe_goal_reached' : ''} #{goal.type_display != 'progress' ? 'oe_no_progress' : ''}">
<t t-if="planline.type_display == 'progress'">
<div class="oe_goal_progress_background"></div>
<div class="oe_goal_progress" t-attf-style="#{planline.type_display == 'progress' ? 'width: '+goal.completeness+'%;' : 'width:0;'}"></div>
@@ -70,8 +69,9 @@
<div class="oe_cell col0"><t t-esc="goal.rank" /></div>
<div class="oe_cell col1"><img class="oe_user_avatar" t-attf-alt="#{goal.user_name}" t-attf-data-id="#{goal.user_id}"/></div>
<div class="oe_cell col2">
-
- <t t-esc="goal.user_name"/><br/>
+ <t t-if="planline.type_display == 'progress'"><br/>
+ <!-- progress, action on current value -->
+ <t t-esc="goal.user_name"/>
<t t-if="goal.id != planline.own_goal_id or (planline.computation_mode != 'manually' and !planline.type_action)">
<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>
</t>
@@ -80,8 +80,17 @@
<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>
</a>
</t>
+ </t>
+ <t t-if="planline.type_display != 'progress'">
+ <!-- not progress, action on user name -->
+ <t t-if="goal.id != planline.own_goal_id or (planline.computation_mode != 'manually' and !planline.type_action)">
+ <t t-esc="goal.user_name"/>
+ </t>
+ <t t-if="goal.id == planline.own_goal_id and (planline.type_action or planline.computation_mode == 'manually')">
+ <a class="oe_goal_action" t-att-id="planline.own_goal_id"><t t-esc="goal.user_name"/></a>
+ </t>
+ </t>
</div>
-
</div>
</div>
</div>