diff --git a/addons/gamification/data/gamification_karma_rank_demo.xml b/addons/gamification/data/gamification_karma_rank_demo.xml index 45b57ae34f3..26c639a8cc9 100644 --- a/addons/gamification/data/gamification_karma_rank_demo.xml +++ b/addons/gamification/data/gamification_karma_rank_demo.xml @@ -1,5 +1,5 @@ - + 20 @@ -15,7 +15,7 @@
Reach the next rank and gain a very nice mug !
- +
100 @@ -27,7 +27,7 @@
Reach the next rank and gain a very magic wand !
- +
500 @@ -39,7 +39,7 @@
Reach the next rank and gain a very nice hat !
- +
2000 @@ -51,7 +51,7 @@
Reach the next rank and gain a week-end with a unicorn !
- +
10000 diff --git a/addons/gamification/static/img/rank_misc_hat.jpg b/addons/gamification/static/img/rank_misc_hat.jpg deleted file mode 100644 index 68abf33bc14..00000000000 Binary files a/addons/gamification/static/img/rank_misc_hat.jpg and /dev/null differ diff --git a/addons/gamification/static/img/rank_misc_hat.png b/addons/gamification/static/img/rank_misc_hat.png new file mode 100644 index 00000000000..172219569c0 Binary files /dev/null and b/addons/gamification/static/img/rank_misc_hat.png differ diff --git a/addons/gamification/static/img/rank_misc_mug.jpg b/addons/gamification/static/img/rank_misc_mug.jpg deleted file mode 100644 index 09cc5567b0e..00000000000 Binary files a/addons/gamification/static/img/rank_misc_mug.jpg and /dev/null differ diff --git a/addons/gamification/static/img/rank_misc_mug.png b/addons/gamification/static/img/rank_misc_mug.png new file mode 100644 index 00000000000..08e1fae9a1f Binary files /dev/null and b/addons/gamification/static/img/rank_misc_mug.png differ diff --git a/addons/gamification/static/img/rank_misc_unicorn.jpg b/addons/gamification/static/img/rank_misc_unicorn.jpg deleted file mode 100644 index 5612d5f7855..00000000000 Binary files a/addons/gamification/static/img/rank_misc_unicorn.jpg and /dev/null differ diff --git a/addons/gamification/static/img/rank_misc_unicorn.png b/addons/gamification/static/img/rank_misc_unicorn.png new file mode 100644 index 00000000000..c22056dcabe Binary files /dev/null and b/addons/gamification/static/img/rank_misc_unicorn.png differ diff --git a/addons/gamification/static/img/rank_misc_wand.jpg b/addons/gamification/static/img/rank_misc_wand.jpg deleted file mode 100644 index 4e2ec0457f3..00000000000 Binary files a/addons/gamification/static/img/rank_misc_wand.jpg and /dev/null differ diff --git a/addons/gamification/static/img/rank_misc_wand.png b/addons/gamification/static/img/rank_misc_wand.png new file mode 100644 index 00000000000..0101c36f8d9 Binary files /dev/null and b/addons/gamification/static/img/rank_misc_wand.png differ diff --git a/addons/website_profile/static/src/scss/website_profile.scss b/addons/website_profile/static/src/scss/website_profile.scss index 1a00803b1b9..e9fd045da45 100644 --- a/addons/website_profile/static/src/scss/website_profile.scss +++ b/addons/website_profile/static/src/scss/website_profile.scss @@ -120,6 +120,73 @@ $bronze: #eea91e; } } +/// Progress Circle +.o_wprofile_progress_circle { + position: relative; + + $circle-size: 220px; + $circle-background: rgba(black, 0.1); + $circle-color: theme-color('primary'); + $inset-size: $circle-size - 20; + $transition-length: 1s; + + .o_progress_circle_container, .o_pc, .o_pc div { + @include size($circle-size); + } + + .o_pc_overlay, .o_pc, .o_pc div { + border-radius: 50%; + } + + .o_progress_circle_container { + position: relative; + margin: 0 auto; + background-color: inherit; + } + + .o_pc_overlay { + $tmp-gap: ($circle-size - $inset-size)/2; + @include o-position-absolute($tmp-gap, $left: $tmp-gap); + @include size($inset-size); + + background-color: inherit; + } + + .o_pc { + background-color: $circle-background; + + div { + position: absolute; + -webkit-backface-visibility: hidden; + transition: transform $transition-length; + + &.o_pc_slice { + clip: rect(0px, $circle-size, $circle-size, $circle-size/2); + + .o_pc_fill { + clip: rect(0px, $circle-size/2, $circle-size, 0px); + background-color: $circle-color; + } + } + } + + $i: 0; + $increment: 180deg / 100; + @while $i <= 100 { + &[data-progress='#{$i}'] { + .o_pc_slice.full, .o_pc_fill { + transform: rotate($increment * $i); + } + .o_pc_fill.o_pc_bar { + transform: rotate($increment * $i * 2); + } + $i: $i + 1; + } + } + } +} + + .o_wprofile_next_rank_card { div { text-align: center; diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml index 8831b93e351..b7ab4704115 100644 --- a/addons/website_profile/views/website_profile.xml +++ b/addons/website_profile/views/website_profile.xml @@ -252,19 +252,29 @@ @@ -305,10 +315,10 @@ Ranks & Badges

- Do not stop learning with . Collects points on the forum or the eLearning platform. Those points will make you reach new ranks. + Keep learning with . Collect points on the forum or on the eLearning platform. Those points will make you reach new ranks.

- How do I earn badges? When you finish a course, reach milestones, you're awarded badges. + How do I earn badges? When you finish a course or reach milestones, you're awarded badges.

How do I score more points? You can score more points by answering quizzes at the end of each course content. Points can also be earned on the forum. Follow this link to the guidelines of the forum. diff --git a/addons/website_rating/static/src/js/website_mail.js b/addons/website_rating/static/src/js/website_mail.js index 8f21f740c98..6fd9a305e95 100644 --- a/addons/website_rating/static/src/js/website_mail.js +++ b/addons/website_rating/static/src/js/website_mail.js @@ -33,6 +33,11 @@ odoo.define('website_rating.thread', function(require) { init: function(parent, options){ this._super.apply(this, arguments); + // apply ratio to default rating value + if (options.default_rating_value) { + options.default_rating_value = parseFloat(options.default_rating_value) / STAR_RATING_RATIO; + } + // default options this.options = _.defaults(this.options, { 'default_message': false, @@ -50,7 +55,7 @@ odoo.define('website_rating.thread', function(require) { '5': _t("I love it"), }; this.user_click = false; // user has click or not - this.set("star_value", this.options.rating_default_value); + this.set("star_value", this.options.default_rating_value); this.on("change:star_value", this, this._onChangeStarValue); }, start: function(){ @@ -59,7 +64,7 @@ odoo.define('website_rating.thread', function(require) { // rating stars self.$input = self.$('input[name="rating_value"]'); self.$star_list = self.$('.stars').find('i'); - self.set("star_value", self.options.rating_default_value); // set the default value to trigger the display of star widget + self.set("star_value", self.options.default_rating_value); // set the default value to trigger the display of star widget }); }, @@ -265,7 +270,7 @@ odoo.define('website_rating.thread', function(require) { _onChangeRatingDomain: function(){ var domain = []; if(this.get('rating_value')){ - domain = [['rating_value', '=', this.get('rating_value')]]; + domain = [['rating_value', '=', this.get('rating_value') * STAR_RATING_RATIO]]; } this._changeCurrentPage(1, domain); }, diff --git a/addons/website_rating/static/src/xml/website_mail.xml b/addons/website_rating/static/src/xml/website_mail.xml index 11534a768c2..d4e8dd83218 100644 --- a/addons/website_rating/static/src/xml/website_mail.xml +++ b/addons/website_rating/static/src/xml/website_mail.xml @@ -79,7 +79,7 @@

- + diff --git a/addons/website_rating/views/website_rating_templates.xml b/addons/website_rating/views/website_rating_templates.xml index 32dc3d3c573..8ce20495b32 100644 --- a/addons/website_rating/views/website_rating_templates.xml +++ b/addons/website_rating/views/website_rating_templates.xml @@ -18,7 +18,7 @@ Rating widget static: show 5 stars (full or empty) regarding the given rating_avg and rating_count -->