summaryrefslogtreecommitdiff
path: root/addons/gamification/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-08-20 15:29:54 +0200
committerAaron Bohy <aab@odoo.com>2015-09-01 20:57:13 +0200
commita0cbf891af58f029e2c52779617ad7eeb8d26eb3 (patch)
tree92091e11e51a025f91427d51d1abc614090369ea /addons/gamification/static/src
parent58a46c90cd896772a0b462379bd0a5a440877993 (diff)
[REM] *: remove chat menu and timeline view
Diffstat (limited to 'addons/gamification/static/src')
-rw-r--r--addons/gamification/static/src/css/gamification.css173
-rw-r--r--addons/gamification/static/src/css/gamification.sass115
-rw-r--r--addons/gamification/static/src/js/gamification.js122
-rw-r--r--addons/gamification/static/src/xml/gamification.xml114
4 files changed, 46 insertions, 478 deletions
diff --git a/addons/gamification/static/src/css/gamification.css b/addons/gamification/static/src/css/gamification.css
index a2c416ffc2d..68479e58760 100644
--- a/addons/gamification/static/src/css/gamification.css
+++ b/addons/gamification/static/src/css/gamification.css
@@ -1,146 +1,65 @@
-@charset "UTF-8";
.openerp .oe_kanban_view .oe_kanban_card.oe_kanban_goal {
width: 230px;
- min-height: 200px; }
+ min-height: 200px;
+}
.openerp .oe_kanban_view .oe_kanban_card.oe_kanban_badge {
width: 250px;
- min-height: 150px; }
+ min-height: 150px;
+}
.openerp .oe_kanban_badge_avatars {
- margin-top: 8px; }
- .openerp .oe_kanban_badge_avatars img {
- width: 30px;
- height: 30px;
- padding-left: 0;
- margin-top: 3px;
- border-radius: 2px;
- -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
+ margin-top: 8px;
+}
+.openerp .oe_kanban_badge_avatars img {
+ width: 30px;
+ height: 30px;
+ padding-left: 0;
+ margin-top: 3px;
+ border-radius: 2px;
+ -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
+}
.openerp .oe_margin_top_8 {
- margin-top: 8px; }
+ margin-top: 8px;
+}
.openerp .oe_margin_top_16 {
- margin-top: 16px; }
+ margin-top: 16px;
+}
.openerp .oe_kanban_goal .oe_goal_state_block {
width: 200px;
height: 130px;
margin: auto;
- margin-bottom: -20px; }
- .openerp .oe_kanban_goal .oe_goal_state_block .oe_goal_state {
- font-size: 2.5em;
- font-weight: bold;
- padding-top: 30px; }
- .openerp .oe_kanban_goal .oe_goal_state_block .oe_goal_state .fa {
- font-size: 3em;
- margin-top: -17px;
- margin-left: 17px; }
+ margin-bottom: -20px;
+}
+.openerp .oe_kanban_goal .oe_goal_state_block .oe_goal_state {
+ font-size: 2.5em;
+ font-weight: bold;
+ padding-top: 30px;
+}
+.openerp .oe_kanban_goal .oe_goal_state_block .oe_goal_state .fa {
+ font-size: 3em;
+ margin-top: -17px;
+ margin-left: 17px;
+}
.openerp .oe_kanban_goal .oe_goal_state_block, .openerp .oe_kanban_goal p {
- text-align: center; }
+ text-align: center;
+}
.openerp .oe_kanban_content .oe_goal_gauge:first-child {
- margin: auto; }
+ margin: auto;
+}
.openerp .oe_kanban_content .oe_goal_gauge svg {
- margin-top: -20px; }
+ margin-top: -20px;
+}
.openerp .oe_no_overflow {
- overflow: hidden; }
+ overflow: hidden;
+}
.openerp .oe_red {
- color: red; }
+ color: red;
+}
.openerp .oe_green {
- color: green; }
+ color: green;
+}
.openerp .oe_orange {
- color: orange; }
+ color: orange;
+}
.openerp .oe_form td .oe_no_padding {
- margin-left: -6px; }
-.openerp .oe_timeline .oe_tl_inbox_aside .oe_gamification_suggestion {
- background-color: #d3def1; }
- .openerp .oe_timeline .oe_tl_inbox_aside .oe_gamification_suggestion ul {
- padding-left: 15px; }
- .openerp .oe_timeline .oe_tl_inbox_aside .oe_gamification_suggestion span {
- background-color: #f0eeee;
- display: inline-block;
- height: 25px;
- vertical-align: middle;
- font-size: 14px;
- font-weight: bold;
- margin-top: -20px;
- padding-left: 0 5px 0px 5px; }
-.openerp .oe_timeline .oe_goal {
- background-color: #f0eeee;
- border: solid 1px #cacaca;
- margin-top: 20px;
- padding-left: 10px; }
- .openerp .oe_timeline .oe_goal .oe_update_challenge.fa, .openerp .oe_timeline .oe_goal .oe_goal_action.fa {
- visibility: hidden;
- font-size: 16px;
- float: right;
- position: relative; }
- .openerp .oe_timeline .oe_goal div:hover > .oe_update_challenge, .openerp .oe_timeline .oe_goal div:hover > .oe_goal_action, .openerp .oe_timeline .oe_goal th:hover > .oe_goal_action {
- visibility: visible; }
- .openerp .oe_timeline .oe_goal .oe_goals_list {
- padding-left: 0;
- margin-top: 5px;
- margin-bottom: 10px;
- width: 100%; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_no_progress div {
- display: inline-block; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_no_progress::before {
- content: "•";
- padding-right: 4px; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_no_progress.oe_goal_reached::before {
- content: "✓";
- padding-right: 0;
- margin-left: -2px; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_no_progress.oe_goal_reached .oe_cell {
- text-decoration: line-through; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_cell.oe_goal_current {
- font-size: 150%;
- font-weight: bold;
- min-width: 50px;
- padding: 0 5px; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_goal_outer_box {
- display: inline-block;
- position: relative;
- z-index: 0;
- vertical-align: middle;
- width: 100%;
- border: solid 1px rgba(0, 0, 0, 0.03);
- border-radius: 2px; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_goal_outer_box.oe_no_progress {
- border: none; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_goal_progress_background {
- background-color: white;
- position: absolute;
- height: 100%;
- width: 100%;
- z-index: -2;
- top: 0;
- left: 0; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_goal_progress {
- background-color: #d4e9de;
- position: absolute;
- height: 100%;
- width: 0;
- z-index: -1;
- top: 0;
- left: 0; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_thead {
- font-weight: normal;
- padding: 5px;
- text-align: center; }
- .openerp .oe_timeline .oe_goal .oe_goals_list .oe_cell {
- padding: 3px 0; }
-.openerp .oe_timeline .oe_table.oe_goals_list .col0 {
- font-size: 200%;
- font-weight: bold;
- width: 25px;
- text-align: center; }
-.openerp .oe_timeline .oe_table.oe_goals_list .col1 {
- padding: 0 5px; }
-.openerp .oe_timeline .oe_table.oe_goals_list .col2 {
- width: auto; }
-.openerp .oe_timeline .oe_user_avatar {
- width: 24px;
- padding-right: 5px; }
-.openerp .oe_timeline .oe_table {
- display: table; }
-.openerp .oe_timeline .oe_row {
- display: table-row; }
-.openerp .oe_timeline .oe_cell {
- display: table-cell;
- vertical-align: middle; }
+ margin-left: -6px;
+}
diff --git a/addons/gamification/static/src/css/gamification.sass b/addons/gamification/static/src/css/gamification.sass
index b524c9486b8..cbba41e05fb 100644
--- a/addons/gamification/static/src/css/gamification.sass
+++ b/addons/gamification/static/src/css/gamification.sass
@@ -61,118 +61,3 @@
// compensate padding from .openerp .oe_form td.oe_form_group_cell + .oe_form_group_cell
.oe_form td .oe_no_padding
margin-left: -6px
-
- .oe_timeline
- .oe_tl_inbox_aside
- .oe_gamification_suggestion
- background-color: #d3def1
-
- ul
- padding-left: 15px
-
- span
- background-color: #f0eeee
- display: inline-block
- height: 25px
- vertical-align: middle
- font-size: 14px
- font-weight: bold
- margin-top: -20px
- padding-left: 0 5px 0px 5px
-
- .oe_goal
- background-color: #f0eeee
- border: solid 1px #CACACA
- margin-top: 20px
- padding-left: 10px
- .oe_update_challenge.fa, .oe_goal_action.fa
- visibility: hidden
- font-size: 16px
- float: right
- position: relative
- div:hover > .oe_update_challenge, div:hover > .oe_goal_action, th:hover > .oe_goal_action
- visibility: visible
- .oe_goals_list
- padding-left: 0
- margin-top: 5px
- margin-bottom: 10px
- width: 100%
-
- .oe_no_progress
- div
- display: inline-block
- .oe_no_progress::before
- content: "•"
- padding-right: 4px
- .oe_no_progress.oe_goal_reached::before
- content: "✓"
- padding-right: 0
- margin-left: -2px
- .oe_no_progress.oe_goal_reached
- .oe_cell
- text-decoration: line-through
-
- .oe_cell.oe_goal_current
- font-size: 150%
- font-weight: bold
- min-width: 50px
- padding: 0 5px
-
- .oe_goal_outer_box
- display: inline-block
- position: relative
- z-index: 0
- vertical-align: middle
- width: 100%
- border: solid 1px rgba(0,0,0,0.03)
- border-radius: 2px
- .oe_goal_outer_box.oe_no_progress
- border: none
-
- .oe_goal_progress_background
- background-color: white
- position: absolute
- height: 100%
- width: 100%
- z-index: -2
- top: 0
- left: 0
-
- .oe_goal_progress
- background-color: rgb(212, 233, 222)
- position: absolute
- height: 100%
- width: 0
- z-index: -1
- top: 0
- left: 0
-
- .oe_thead
- font-weight: normal
- padding: 5px
- text-align: center
- .oe_cell
- padding: 3px 0
-
- .oe_table.oe_goals_list
- .col0
- font-size: 200%
- font-weight: bold
- width: 25px
- text-align: center
- .col1
- padding: 0 5px
- .col2
- width: auto
-
- .oe_user_avatar
- width: 24px
- padding-right: 5px
-
- .oe_table
- display: table
- .oe_row
- display: table-row
- .oe_cell
- display: table-cell
- vertical-align: middle \ No newline at end of file
diff --git a/addons/gamification/static/src/js/gamification.js b/addons/gamification/static/src/js/gamification.js
deleted file mode 100644
index 1a096d2e681..00000000000
--- a/addons/gamification/static/src/js/gamification.js
+++ /dev/null
@@ -1,122 +0,0 @@
-odoo.define('gamification.gamification', function(require) {
-"use strict";
-
-var mail = require('mail.mail');
-var core = require('web.core');
-var form_common = require('web.form_common');
-var Model = require('web.DataModel');
-var session = require('web.session');
-var Widget = require('web.Widget');
-
-var QWeb = core.qweb;
-
-var Sidebar = Widget.extend({
- template: 'gamification.UserWallSidebar',
- init: function (parent, action) {
- this._super(parent, action);
- this.deferred = $.Deferred();
- this.goals_info = {};
- this.challenge_suggestions = {};
- $(document).off('keydown.klistener');
- },
- events: {
- // update a challenge and related goals
- 'click i.oe_update_challenge': function(event) {
- var self = this;
- var challenge_id = parseInt(event.currentTarget.id, 10);
- var goals_updated = new Model('gamification.challenge').call('quick_update', [challenge_id]);
- $.when(goals_updated).done(function() {
- self.get_goal_todo_info();
- });
- },
- // action to modify a goal
- 'click a.oe_goal_action': function(event) {
- var self = this;
- var goal_id = parseInt(event.currentTarget.id, 10);
- var goal_action = new Model('gamification.goal').call('get_action', [goal_id]).then(function(res) {
- goal_action.action = res;
- });
- $.when(goal_action).done(function() {
- var action = self.do_action(goal_action.action);
- $.when(action).done(function () {
- new Model('gamification.goal').call('update', [[goal_id]]).then(function(res) {
- self.get_goal_todo_info();
- });
- });
- });
- },
- // get more info about a challenge request
- 'click a.oe_challenge_reply': function(event) {
- var self = this;
- var challenge_id = parseInt(event.currentTarget.id, 10);
- var challenge_action = new Model('gamification.challenge').call('reply_challenge_wizard', [challenge_id]).then(function(res) {
- challenge_action.action = res;
- });
- $.when(challenge_action).done(function() {
- self.do_action(challenge_action.action).done(function () {
- self.get_goal_todo_info();
- });
- });
- }
- },
- start: function() {
- var self = this;
- this._super.apply(this, arguments);
- self.get_goal_todo_info();
- self.get_challenge_suggestions();
- },
- get_goal_todo_info: function() {
- var self = this;
- var challenges = new Model('res.users').call('get_serialised_gamification_summary', []).then(function(result) {
- if (result.length === 0) {
- self.$el.find(".oe_gamification_challenge_list").hide();
- } else {
- self.$el.find(".oe_gamification_challenge_list").empty();
- _.each(result, function(item){
- var $item = $(QWeb.render("gamification.ChallengeSummary", {challenge: item}));
- self.render_money_fields($item);
- self.render_user_avatars($item);
- self.$el.find('.oe_gamification_challenge_list').append($item);
- });
- }
- });
- },
- get_challenge_suggestions: function() {
- var self = this;
- var challenge_suggestions = new Model('res.users').call('get_challenge_suggestions', []).then(function(result) {
- if (result.length === 0) {
- self.$el.find(".oe_gamification_suggestion").hide();
- } else {
- var $item = $(QWeb.render("gamification.ChallengeSuggestion", {challenges: result}));
- self.$el.find('.oe_gamification_suggestion').append($item);
- }
- });
- },
- render_money_fields: function(item) {
- var self = this;
- var FieldMonetary = core.form_widget_registry.get('monetary');
- self.dfm = new form_common.DefaultFieldManager(self);
- // Generate a FieldMonetary for each .oe_goal_field_monetary
- item.find(".oe_goal_field_monetary").each(function() {
- var currency_id = parseInt( $(this).attr('data-id'), 10);
- var money_field = new FieldMonetary(self.dfm, {
- attrs: {
- modifiers: '{"readonly": true}'
- }
- });
- money_field.set('currency', currency_id);
- money_field.get_currency_info();
- money_field.set('value', parseInt($(this).text(), 10));
- money_field.replace($(this));
- });
- },
- render_user_avatars: function(item) {
- item.find(".oe_user_avatar").each(function() {
- var user_id = parseInt( $(this).attr('data-id'), 10);
- var url = session.url('/web/image', {model: 'res.users', field: 'image_small', id: user_id});
- $(this).attr("src", url);
- });
- }
-});
-
-});
diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml
deleted file mode 100644
index 570cfe936d1..00000000000
--- a/addons/gamification/static/src/xml/gamification.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<templates>
- <t t-name="gamification.UserWallSidebar" class="oe_gamification_user_wall_sidebar">
- <div>
- <div class="oe_gamification_suggestion"></div>
- <div class="oe_gamification_challenge_list"></div>
- </div>
- </t>
- <t t-name="gamification.ChallengeSummary">
- <div class="oe_goal">
- <div class="oe_gamification_title">
- <i class="oe_update_challenge fa fa-refresh" rol="button" t-attf-id="{challenge.id}"/>
- <span><t t-esc="challenge.name" /></span>
- </div>
-
- <t t-if="challenge.visibility_mode == 'personal'">
- <div class="oe_table oe_goals_list">
- <div t-foreach="challenge.lines" t-as="line" t-attf-class="oe_row oe_goal_outer_box #{line.state == 'reached' ? 'oe_goal_reached' : ''} #{line.display_mode != 'progress' ? 'oe_no_progress' : ''}">
- <t t-if="line.display_mode == 'progress'">
- <div class="oe_goal_progress_background"></div>
- <div class="oe_goal_progress" t-attf-style="#{line.display_mode == 'progress' ? 'width: '+line.completeness+'%;' : 'width:0;'}"></div>
- <div class="oe_cell oe_goal_current"><t t-esc="line.current" /></div>
- </t>
- <div class="oe_cell">
- <t t-if="line.computation_mode != 'manually' and !line.action">
- <span t-att-title="line.description"><t t-esc="line.name" /></span>
- </t>
- <t t-if="line.action or line.computation_mode == 'manually'">
- <span t-att-title="line.description"><a class="oe_goal_action" t-att-id="line.id"><t t-esc="line.name" /></a></span>
- </t>
- <t t-if="line.display_mode == 'progress'"><br/>
- <div class="oe_grey">
- <t t-if="line.definition_condition == 'higher'">
- Target:
- </t>
- <t t-if="line.definition_condition == 'lower'">
- Target: &lt;=
- </t>
- <span t-attf-class="#{line.monetary ? 'oe_goal_field_monetary' : ''}" t-attf-data-id="#{line.monetary ? challenge.currency : ''}"><t t-esc="line.target"/></span>
- <t t-if="line.suffix"><t t-esc="line.suffix"/></t>
- </div>
- </t>
- </div>
- </div>
- </div>
- </t>
-
- <t t-if="challenge.visibility_mode == 'ranking'">
- <div t-foreach="challenge.lines" t-as="line" class="oe_goals_list oe_table">
- <div class="oe_row">
- <div class="oe_cell oe_thead" colspan="3" t-attf-title="#{line.description ? line.description : ''}">
- <strong><t t-esc="line.name"/></strong>
- <br/>
- <div class="oe_grey">
- <t t-if="line.definition_condition == 'higher'">
- Target:
- </t>
- <t t-if="line.definition_condition == 'lower'">
- Target: &lt;=
- </t>
- <span t-attf-class="#{line.monetary ? 'oe_goal_field_monetary' : ''}" t-attf-data-id="#{line.monetary ? challenge.currency : ''}"><t t-esc="line.target" /></span><t t-if="line.suffix"> <t t-esc="line.suffix"/></t>
- </div>
- </div>
- </div>
- <div t-foreach="line.goals" t-as="goal" t-attf-class="#{goal.id == line.own_goal_id ? 'oe_bold' : ''}">
- <div t-attf-class="oe_row oe_goal_outer_box #{goal.state == 'reached' ? 'oe_goal_reached' : ''} #{line.display_mode != 'progress' ? 'oe_no_progress' : ''}">
- <t t-if="line.display_mode == 'progress'">
- <div class="oe_goal_progress_background"></div>
- <div class="oe_goal_progress" t-attf-style="#{line.display_mode == 'progress' ? 'width: '+goal.completeness+'%;' : 'width:0;'}"></div>
- </t>
-
- <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.name}" t-attf-data-id="#{goal.user_id}"/></div>
- <div class="oe_cell col2">
- <t t-if="line.display_mode == 'progress'">
- <!-- progress, action on current value -->
- <t t-esc="goal.name"/><br/>
- <t t-if="goal.id != line.own_goal_id or (line.computation_mode != 'manually' and !line.action)">
- <span t-attf-class="#{line.monetary ? 'oe_goal_field_monetary' : ''}" t-attf-data-id="#{line.monetary ? challenge.currency : ''}"><t t-esc="goal.current" /></span><t t-if="line.suffix"> <t t-esc="line.suffix"/></t>
- </t>
- <t t-if="goal.id == line.own_goal_id and (line.action or line.computation_mode == 'manually')">
- <a class="oe_goal_action" t-att-id="line.own_goal_id">
- <span t-attf-class="#{line.monetary ? 'oe_goal_field_monetary' : ''}" t-attf-data-id="#{line.monetary ? challenge.currency : ''}"><t t-esc="goal.current" /></span><t t-if="line.suffix"> <t t-esc="line.suffix"/></t>
- </a>
- </t>
- </t>
- <t t-if="line.display_mode != 'progress'">
- <!-- not progress, action on user name -->
- <t t-if="goal.id != line.own_goal_id or (line.computation_mode != 'manually' and !line.action)">
- <t t-esc="goal.name"/>
- </t>
- <t t-if="goal.id == line.own_goal_id and (line.action or line.computation_mode == 'manually')">
- <a class="oe_goal_action" t-att-id="line.own_goal_id"><t t-esc="goal.name"/></a>
- </t>
- </t>
- </div>
- </div>
- </div>
- </div>
- </t>
- </div>
- </t>
-
- <t t-name="gamification.ChallengeSuggestion">
- <div class="oe_goal">
- <h4>Invited Challenges</h4>
- <ul t-foreach="challenges" t-as="challenge" class="oe_goals_list">
- <li>
- <strong><a class="oe_challenge_reply" t-attf-title="#{challenge.description.value ? challenge.description.value : ''}" t-attf-id="{challenge.id}" title="more details..."><t t-esc="challenge.name"/></a></strong>
- </li>
- </ul>
- </div>
- </t>
-
-</templates>