From cb863ed0bb72d9df3eeb412ac0cf57662438c25e Mon Sep 17 00:00:00 2001 From: rar-odoo Date: Mon, 17 Jul 2017 18:07:48 +0200 Subject: [PATCH] [FIX] gamification: email template for challenges (#18265) * [IMP] Gamification: email template - new template for challenges for both personal and ranking mode. --- addons/gamification/data/goal_base.xml | 302 +++++++++++++++++++------ 1 file changed, 234 insertions(+), 68 deletions(-) diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml index 06aede03c49..3b983ebd256 100644 --- a/addons/gamification/data/goal_base.xml +++ b/addons/gamification/data/goal_base.xml @@ -20,76 +20,242 @@ Simple Challenge Report Progress - - ${object.name} -

-

The following message contains the current progress for the challenge ${object.name}

- -% if object.visibility_mode == 'personal': - - - - - - - - % for line in ctx["challenge_lines"]: - = 100: - style="font-weight:bold;" - % endif - > - - - - - - % endfor -
GoalTargetCurrentCompleteness
${line['name']}${line['target']} - % if line['suffix']: - ${line['suffix']} - % endif - ${line['current']} - % if line['suffix']: - ${line['suffix']} - % endif - ${line['completeness']} %
-% else: - % for line in ctx["challenge_lines"]: - - - - - - - - - - - % for goal in line['goals']: - = 100: - style="font-weight:bold;" - % endif - > - - - - - - % endfor + + + + + +
${line['name']}
#PersonCompletenessCurrent
${goal['rank']}${goal['name']}${goal['completeness']}%${goal['current']}/${line['target']} - % if line['suffix']: - ${line['suffix']} - % endif -
+ +
+ + + + % if object.visibility_mode == 'ranking': + + % endif + +
+ + +

Leaderboard

+
+ + +
+ % if object.visibility_mode == 'personal': + Here is your current progress in the challenge ${object.name}. + + + + +
+

Personal Performance

+
+ + + + + + + + + + + + + + % for line in challenge_lines: + = 100: + style="font-weight:bold;" + % endif + > + + + + + + + + + % endfor + +
GoalsTargetCurrentCompleteness
+ ${line['name']} + % if line['suffix'] or line['monetary']: + (${line['full_suffix']}) + % endif + ${"%.2f" % line['target']} + % if line['suffix']: + ${line['suffix']} + % endif + ${"%.2f" % line['current']} + % if line['suffix']: + ${line['suffix']} + % endif + ${line['completeness']| int}%
+ % else: + + The following message contains the current progress for the challenge ${object.name}. + + % for line in challenge_lines: + + + + + +
+

Top Achievers for goal ${line['name']}

+
+ + % if len(line['goals'])>2: + + + +
+ + + % set top_goals = [line['goals'][1], line['goals'][0], line['goals'][2]] + % for goal in top_goals: + + % endfor + +
+ % if loop.index == 1: + % set extra_div = '
' + % set heightA = 95 + % set heightB = 75 + % set bgColor = '#b898b0' + % set fontSize = 50 + % set podiumPosition = '2' + % elif loop.index == 2: + % set extra_div = '' + % set heightA = 55 + % set heightB = 115 + % set bgColor = '#9A6C8E' + % set fontSize = 85 + % set podiumPosition = '1' + % elif loop.index == 3: + % set extra_div = '
' + % set heightA = 115 + % set heightB = 55 + % set bgColor = '#c8afc1' + % set fontSize = 35 + % set podiumPosition = '3' + % endif +
+
+ ${extra_div | safe} +
+ +
+
+ ${goal['name']} +
+
+ ${podiumPosition | safe} +
+
+

+ ${"%.2f" % goal['current']} + % if line['suffix'] or line['monetary']: + ${line['full_suffix']} + % endif +

+
+
+
+
+ % endif + + + + + +
+ + + + + + + + + + + + + + % for goal in line['goals']: + + % set tdBgColor = '#fff' + % set tdColor = 'gray' + % set mutedColor = '#AAAAAA' + % set tdPercentageColor = '#9A6C8E' + + + + + + + + + % endfor + +
RankNamePerformance + % if line['suffix']: + (${line['suffix']}) + % elif line['monetary']: + (${company.currency_id.symbol}) + % endif + Completeness
${goal['rank']+1} + ${goal['name']}${"%.2f" % goal['current']}
on ${"%.2f" % line['target']} +
${goal['completeness'] | int}%
+
+ % endfor + % endif +
+ + + + + + + +
+ + + + + +
+ ${company.name}
+ ${company.phone or ''} +
+ % if company.email: + ${company.email}
+ % endif + % if company.website: + + ${company.website} + + % endif +
+
+ Powered by Odoo. +
+
+
+ ]]> -

- - % endfor -% endif - ]]>
+