From 38f205ef32a1acd3d5712d203c5f18d2d0805c95 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 22 Apr 2013 11:32:36 +0200 Subject: [PATCH] [IMP] more consistent display of challenges bzr revid: mat@openerp.com-20130422093236-y76ad91yoyemejxa --- addons/gamification/plan.py | 29 +++---- addons/gamification/plan_view.xml | 14 ++++ addons/gamification/static/src/css/goal.css | 78 ++++++++++++------- .../static/src/xml/gamification.xml | 76 +++++++++--------- 4 files changed, 115 insertions(+), 82 deletions(-) diff --git a/addons/gamification/plan.py b/addons/gamification/plan.py index 8df348b1af9..4a47987e59d 100644 --- a/addons/gamification/plan.py +++ b/addons/gamification/plan.py @@ -158,10 +158,6 @@ class gamification_goal_plan(osv.Model): required=True), 'manager_id': fields.many2one('res.users', string='Responsible', help="The user responsible for the challenge."), - 'start_date': fields.date('Start Date', - help="The day a new challenge will be automatically started. If no periodicity is set, will use this date as the goal start date."), - 'end_date': fields.date('End Date', - help="The day a new challenge will be automatically closed. If no periodicity is set, will use this date as the goal end date."), 'user_ids': fields.many2many('res.users', 'user_ids', string='Users', @@ -170,6 +166,21 @@ class gamification_goal_plan(osv.Model): string='Auto-subscription Group', help='Group of users whose members will automatically be added to the users'), + 'period': fields.selection([ + ('once', 'Non recurring'), + ('daily', 'Daily'), + ('weekly', 'Weekly'), + ('monthly', 'Monthly'), + ('yearly', 'Yearly') + ], + string='Periodicity', + help='Period of automatic goal assigment. If none is selected, should be launched manually.', + required=True), + 'start_date': fields.date('Start Date', + help="The day a new challenge will be automatically started. If no periodicity is set, will use this date as the goal start date."), + 'end_date': fields.date('End Date', + help="The day a new challenge will be automatically closed. If no periodicity is set, will use this date as the goal end date."), + 'proposed_user_ids': fields.many2many('res.users', 'proposed_user_ids', string="Suggest to users"), @@ -190,16 +201,6 @@ class gamification_goal_plan(osv.Model): 'reward_second_id_many': fields.function(_reward_second_id_many, type="many2many", relation="gamification.badge", string="For 2nd user"), 'reward_third_id_many': fields.function(_reward_third_id_many, type="many2many", relation="gamification.badge", string="For 3rd user"), - 'period': fields.selection([ - ('once', 'Non recurring'), - ('daily', 'Daily'), - ('weekly', 'Weekly'), - ('monthly', 'Monthly'), - ('yearly', 'Yearly') - ], - string='Periodicity', - help='Period of automatic goal assigment. If none is selected, should be launched manually.', - required=True), 'visibility_mode': fields.selection([ ('progressbar', 'Individual Goals'), ('board', 'Leader Board (Group Ranking)'), diff --git a/addons/gamification/plan_view.xml b/addons/gamification/plan_view.xml index 394d70578b6..4f2e71ad0bd 100644 --- a/addons/gamification/plan_view.xml +++ b/addons/gamification/plan_view.xml @@ -242,7 +242,21 @@

+
+ This challenge has no starting and end date specified, it will be closed +
The challenge is running from to + + + + + + + + + + +
There is no reward upon completion of this challenge. diff --git a/addons/gamification/static/src/css/goal.css b/addons/gamification/static/src/css/goal.css index e481a800c79..c113ac6ad2e 100644 --- a/addons/gamification/static/src/css/goal.css +++ b/addons/gamification/static/src/css/goal.css @@ -71,23 +71,49 @@ background: #EDEDF6; padding: 5px 5px 0 15px; } -.openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_reached, +.openerp .oe_mail_wall_aside h3 { + font-size: 1.3em; + margin-left: -7px; + font-variant: small-caps; + text-transform: capitalize; + line-height: 1em; +} +/* 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 { - text-decoration: line-through; + color: rgb(95, 17, 17); } -.openerp .oe_mail_wall .oe_mail_wall_aside ul { +.openerp .oe_mail_wall_aside .oe_goals_list { list-style-type: none; - padding-left: 20px; + padding-left: 15px; margin-bottom: 15px; + width: 200px; } -.openerp .oe_mail_wall .oe_mail_wall_aside li { - margin-bottom: 15px; +.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal_outer_box { + background: rgb(173, 219, 178); + min-height: 32px; +} +.openerp .oe_mail_wall_aside .oe_goals_list .oe_goal_inner_box { + display: inline-block; + width: 200px; + min-height: 32px; + vertical-align: middle; + border: solid 1px white; +} +.openerp .oe_mail_wall_aside table.oe_goals_list .oe_goal_inner_box { + border: none; +} +.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 { margin: 10px 0; } -.oe_mail_wall_aside .oe_list_content tbody tr:nth-child(even) { +.oe_mail_wall_aside .oe_goals_list tbody tr:nth-child(even) { background-color: #fff; } .openerp .oe_mail_wall .oe_mail_wall_aside td, @@ -95,41 +121,33 @@ vertical-align: middle; border: none; } -.openerp .oe_mail_wall_aside .oe_list_content tbody th { +.openerp .oe_mail_wall_aside .oe_goals_list thead th { + padding: 5px; +} +.openerp .oe_mail_wall_aside .oe_goals_list tbody tr { + height: 32px; +} +.openerp .oe_mail_wall_aside .oe_goals_list tbody th { padding-left: 5px; + height: 32px; } .openerp .oe_mail_wall .oe_mail_wall_aside table .col0 { - font-size: 150%; + font-size: 160%; font-weight: bold; + width: 24px; } -.openerp .oe_mail_wall .oe_mail_wall_aside table td.col0 { width: 25px; } -.openerp .oe_mail_wall .oe_mail_wall_aside table td.col1 { width: 32px; } - -.openerp .oe_mail_wall .oe_mail_wall_aside .oe_user_avatar { width: 32px; } - -/* background progress bar */ -.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal_progress { - background: rgb(173, 219, 178); -} -.openerp .oe_mail_wall .oe_mail_wall_aside table progress,.oe_form_field_progressbar { - width: 100%; - display: inline-block; -} -.openerp .oe_mail_wall .oe_mail_wall_aside li progress,.oe_form_field_progressbar { - width: 80%; - display: inline-block; -} -.openerp .oe_mail_wall .oe_mail_wall_aside li p { - margin:5px 0; +.openerp .oe_mail_wall .oe_mail_wall_aside .oe_user_avatar { + width: 32px; + padding-right: 5px; } .openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal .oe_update_plan, -.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal .oe_goal_action { +.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal_inner_box .oe_goal_action { visibility: hidden; display: block; float: right; } .openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal:hover > .oe_update_plan, -.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal:hover .oe_goal_action { +.openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal_inner_box:hover .oe_goal_action { visibility: visible; } .openerp .oe_mail_wall .oe_mail { diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml index 428342e08b6..e3782a7d22b 100644 --- a/addons/gamification/static/src/xml/gamification.xml +++ b/addons/gamification/static/src/xml/gamification.xml @@ -4,42 +4,41 @@
Your goal list is empty
+

Challenges

e -

+

-
    -
  • -
    - - - - & - - - -

    - / - -

    - +
    +
    +
    + + + + & - -

    - (less than - + + + + / - ) -

    +
    + + + (less than + + + ) + + -
    -
  • -
+
+
- +
- - + @@ -74,12 +73,13 @@ -

Suggested challenges

-
-

- reply -

-
+

Suggestions

+ You have been invited to the following challenges: +
@@ -55,14 +54,14 @@
-
-
+
+
+
-
+ -
+