diff options
| author | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-12-24 11:01:25 +0530 |
|---|---|---|
| committer | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-12-24 11:01:25 +0530 |
| commit | 18d8368ee11eef0a74bacdb8f293414331bfa8da (patch) | |
| tree | fc21df70cbd2901396c2bcf2fee0b52d750abd43 /addons/crm/static/src | |
| parent | 5900672160c2bd5ae1d9257f20dbb5c51a193996 (diff) | |
| parent | 123185757f51ee7e146d7295864556999d2a6938 (diff) | |
[MERGE] Merged lp:~openerp-dev/openobject-addons/trunk-website-al
bzr revid: psa@tinyerp.com-20131224053125-3lrogsrgd3ccp0i6
Diffstat (limited to 'addons/crm/static/src')
| -rw-r--r-- | addons/crm/static/src/css/Makefile | 2 | ||||
| -rw-r--r-- | addons/crm/static/src/css/crm.css | 94 | ||||
| -rw-r--r-- | addons/crm/static/src/css/crm.sass | 55 | ||||
| -rw-r--r-- | addons/crm/static/src/js/crm_case_section.js | 37 |
4 files changed, 139 insertions, 49 deletions
diff --git a/addons/crm/static/src/css/Makefile b/addons/crm/static/src/css/Makefile new file mode 100644 index 00000000000..a2ced24a13d --- /dev/null +++ b/addons/crm/static/src/css/Makefile @@ -0,0 +1,2 @@ +crm.css: crm.sass + sass --trace -t expanded crm.sass:crm.css diff --git a/addons/crm/static/src/css/crm.css b/addons/crm/static/src/css/crm.css index ba4473edc26..8999f758e41 100644 --- a/addons/crm/static/src/css/crm.css +++ b/addons/crm/static/src/css/crm.css @@ -1,64 +1,62 @@ +@charset "utf-8"; .openerp .oe_kanban_view .oe_kanban_crm_salesteams { - width: 345px; + /* Customize width and height of kanban according bootstrap3 */ + width: 357px; + min-height: 254px !important; + /* End of customize */ + cursor: default; } -.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_avatars { - text-align: right; - margin: -5px 0 -10px 0; -} - -.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_avatars img { - width: 30px; - height: 30px; - padding-left: 0px; - margin-top: 3px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); - -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); -} - .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list { - position: relative; - margin: 10px; + position: relative; + /* Improved margin to set alignment of list items according bootstrap3 */ + margin: 10px 0 10px 9px; + min-height: 10px; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list div { - width: 160px; - height: 22px; - margin: 0 !important; - position: relative; - display: inline-block; -} -.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list a:hover { - text-decoration: underline !important; + width: 160px; + height: 22px; + margin: 0 !important; + position: relative; + display: inline-block; + float: left; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list div a:nth-child(2n) { - position: absolute; - left: 90px; - top: 0; + position: absolute; + left: 90px; + top: 0; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list div:nth-child(2n) a:nth-child(2n) { - left: 110px; + left: 110px; +} +.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list a:hover { + text-decoration: underline !important; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_center { - text-align: center; - margin: 3px 0; + text-align: center; + margin: 3px 0; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_center .oe_sum { - margin: 0; - font-size: 40px; + margin: 0; + font-size: 40px; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_center .oe_subsum { - font-size: 10px; -} - -.openerp .oe_kanban_view .oe_justgage { - color: black; - display: inline-block; + font-size: 10px; +} +.openerp .oe_kanban_view .oe_salesteams_help { + display: inline-block; +} +.openerp .oe_kanban_view .oe_kanban_salesteams_avatars { + margin-top: 20px; +} +.openerp .oe_kanban_view .oe_kanban_salesteams_avatars img { + width: 30px; + height: 30px; + padding-left: 0px; + margin-top: 3px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); + -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); } - -.openerp .oe_kanban_view .oe_sparkline_bar { - height: 20px; - width: 36px; -}
\ No newline at end of file diff --git a/addons/crm/static/src/css/crm.sass b/addons/crm/static/src/css/crm.sass new file mode 100644 index 00000000000..5c70981e52f --- /dev/null +++ b/addons/crm/static/src/css/crm.sass @@ -0,0 +1,55 @@ +@charset "utf-8" + +.openerp + .oe_kanban_view + .oe_kanban_crm_salesteams + /* Customize width and height of kanban according bootstrap3 */ + width: 357px + min-height: 254px !important + /* End of customize */ + cursor: default + .oe_items_list + position: relative + /* Improved margin to set alignment of list items according bootstrap3 */ + margin: 10px 0 10px 9px + min-height: 10px + div + width: 160px + height: 22px + margin: 0 !important + position: relative + display: inline-block + float: left + a:nth-child(2n) + position: absolute + left: 90px + top: 0 + div:nth-child(2n) + a:nth-child(2n) + left: 110px + a:hover + text-decoration: underline !important + .oe_center + text-align: center + margin: 3px 0 + .oe_sum + margin: 0 + font-size: 40px + .oe_subsum + font-size: 10px + .oe_salesteams_help + display: inline-block + .oe_kanban_salesteams_avatars + margin-top: 20px + .oe_kanban_salesteams_avatars + img + width: 30px + height: 30px + padding-left: 0px + margin-top: 3px + -moz-border-radius: 2px + -webkit-border-radius: 2px + border-radius: 2px + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) + -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) diff --git a/addons/crm/static/src/js/crm_case_section.js b/addons/crm/static/src/js/crm_case_section.js index deb21d38de2..02f42288880 100644 --- a/addons/crm/static/src/js/crm_case_section.js +++ b/addons/crm/static/src/js/crm_case_section.js @@ -1,4 +1,40 @@ openerp.crm = function(openerp) { + openerp.web_kanban.KanbanView.include({ + crm_display_members_names: function() { + /* + * Set avatar title for members. + * In kanban views, many2many fields only return a list of ids. + * We can implement return value of m2m fields like [(1,"Adminstration"),...]. + */ + var self = this; + var members_ids = []; + + // Collect members ids + self.$el.find('img[data-member_id]').each(function() { + members_ids.push($(this).data('member_id')); + }); + + // Find their matching names + var dataset = new openerp.web.DataSetSearch(self, 'res.users', self.session.context, [['id', 'in', _.uniq(members_ids)]]); + dataset.read_slice(['id', 'name']).done(function(result) { + _.each(result, function(v, k) { + // Set the proper value in the DOM + self.$el.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tipsy({ + offset: 10 + }); + }); + }); + }, + on_groups_started: function() { + var self = this; + self._super.apply(self, arguments); + + if (self.dataset.model === 'crm.case.section') { + self.crm_display_members_names(); + } + }, + }); + openerp.web_kanban.KanbanRecord.include({ on_card_clicked: function() { if (this.view.dataset.model === 'crm.case.section') { @@ -8,5 +44,4 @@ openerp.crm = function(openerp) { } }, }); - }; |
