[REF] gamification: clean next rank motivational implementation
Purpose of this commit is to clean motivational capabilities of gamification
ranks[1]. It makes more sense to store a motivational to achieve on next rank
itself. We therefore rename the field and provide nice demo data that will be
used in elearning use of gamification ranks.
Commit linked to task ID 1941250 and PR #31133.
[1] task ID 1922159 (landed at 91ee6ba5a7)
This commit is contained in:
@@ -13,9 +13,8 @@
|
||||
<record id="rank_newbie" model="gamification.karma.rank">
|
||||
<field name="name">Newbie</field>
|
||||
<field name="description" type="html"><p>You just began the adventure! Welcome!</p></field>
|
||||
<field name="description_reach_next" type="html"><p>Keep going !</p></field>
|
||||
<field name="karma_min">1</field>
|
||||
<field name="image" type="base64" file="gamification/static/img/rank_newbie_badge.svg"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
</odoo>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo><data>
|
||||
<odoo><data noupdate="1">
|
||||
<!-- Set demo karma for test tour as demo user-->
|
||||
<record id="base.user_demo" model="res.users">
|
||||
<field name="karma">20</field>
|
||||
@@ -12,7 +12,11 @@
|
||||
<record id="rank_student" model="gamification.karma.rank">
|
||||
<field name="name">Student</field>
|
||||
<field name="description" type="html"><p>You begin to understand things ! Keep going!</p></field>
|
||||
<field name="description_reach_next" type="html"><p>Keep going !</p></field>
|
||||
<field name="description_motivational" type="html">
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">Reach the next rank and gain a very nice mug !</div>
|
||||
<img class="ml-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_misc_mug.jpg"/>
|
||||
</div></field>
|
||||
<field name="karma_min">100</field>
|
||||
<field name="image" type="base64" file="gamification/static/img/rank_student_badge.svg"/>
|
||||
</record>
|
||||
@@ -20,7 +24,11 @@
|
||||
<record id="rank_bachelor" model="gamification.karma.rank">
|
||||
<field name="name">Bachelor</field>
|
||||
<field name="description" type="html"><p>Hey ! You're not so dumb after all !</p></field>
|
||||
<field name="description_reach_next" type="html"><p>Keep going !</p></field>
|
||||
<field name="description_motivational" type="html">
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">Reach the next rank and gain a very magic wand !</div>
|
||||
<img class="ml-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_misc_wand.jpg"/>
|
||||
</div></field>
|
||||
<field name="karma_min">500</field>
|
||||
<field name="image" type="base64" file="gamification/static/img/rank_bachelor_badge.svg"/>
|
||||
</record>
|
||||
@@ -28,7 +36,11 @@
|
||||
<record id="rank_master" model="gamification.karma.rank">
|
||||
<field name="name">Master</field>
|
||||
<field name="description" type="html"><p>You're good ! Really Good !</p></field>
|
||||
<field name="description_reach_next" type="html"><p>Keep going !</p></field>
|
||||
<field name="description_motivational" type="html">
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">Reach the next rank and gain a very nice hat !</div>
|
||||
<img class="ml-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_misc_hat.jpg"/>
|
||||
</div></field>
|
||||
<field name="karma_min">2000</field>
|
||||
<field name="image" type="base64" file="gamification/static/img/rank_master_badge.svg"/>
|
||||
</record>
|
||||
@@ -36,7 +48,11 @@
|
||||
<record id="rank_doctor" model="gamification.karma.rank">
|
||||
<field name="name">Doctor</field>
|
||||
<field name="description" type="html"><p>Ok, RESPECT !</p></field>
|
||||
<field name="description_reach_next" type="html"><p>Keep going !</p></field>
|
||||
<field name="description_motivational" type="html">
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">Reach the next rank and gain a week-end with a unicorn !</div>
|
||||
<img class="ml-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_misc_unicorn.jpg"/>
|
||||
</div></field>
|
||||
<field name="karma_min">10000</field>
|
||||
<field name="image" type="base64" file="gamification/static/img/rank_doctor_badge.svg"/>
|
||||
</record>
|
||||
|
||||
@@ -19,9 +19,9 @@ class KarmaRank(models.Model):
|
||||
|
||||
name = fields.Text(string='Rank Name', translate=True, required=True)
|
||||
description = fields.Html(string='Description', translate=html_translate, sanitize_attributes=False,)
|
||||
description_reach_next = fields.Html(
|
||||
string='Motivation phrase', translate=html_translate, sanitize_attributes=False,
|
||||
help="Motivation phrase to reach next rank")
|
||||
description_motivational = fields.Html(
|
||||
string='Motivational', translate=html_translate, sanitize_attributes=False,
|
||||
help="Motivational phrase to reach this rank")
|
||||
karma_min = fields.Integer(string='Required Karma', help='Minimum karma needed to reach this rank')
|
||||
user_ids = fields.One2many('res.users', 'rank_id', string='Users', help="Users having this rank")
|
||||
image = fields.Binary('Rank Icon')
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Ranks views -->
|
||||
@@ -35,8 +36,6 @@
|
||||
<tree string="Ranks List">
|
||||
<field name="name"/>
|
||||
<field name="karma_min"/>
|
||||
<field name="description"/>
|
||||
<field name="user_ids"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -58,6 +57,7 @@
|
||||
<group>
|
||||
<field name="karma_min"/>
|
||||
<field name="description" placeholder="e.g. A Master Chief knows quite everything on the forum! You cannot beat him!"/>
|
||||
<field name="description_motivational" placeholder="e.g. Reach this rank to gain a free mug !"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
</group>
|
||||
<group string="Users to that rank" attrs="{'invisible': [('create_date','=',False)]}">
|
||||
|
||||
Reference in New Issue
Block a user