diff options
Diffstat (limited to 'addons/project/static')
| -rw-r--r-- | addons/project/static/src/css/project.css | 220 | ||||
| -rw-r--r-- | addons/project/static/src/img/tasks_icon.png | bin | 0 -> 2545 bytes | |||
| -rw-r--r-- | addons/project/static/src/js/dropdown.js | 92 | ||||
| -rw-r--r-- | addons/project/static/src/js/project.js | 48 |
4 files changed, 360 insertions, 0 deletions
diff --git a/addons/project/static/src/css/project.css b/addons/project/static/src/css/project.css new file mode 100644 index 00000000000..93437c878ba --- /dev/null +++ b/addons/project/static/src/css/project.css @@ -0,0 +1,220 @@ +.project_fields { + margin-top: 1px; + margin-bottom: 1px; + font-size: 11px; + padding-left: 0px; + } +.project_fields td { + border: none; + padding: 2px 0 2px 8px; } +.project_fields th { + padding: 0; + border-right: 1px solid #dddddd; + vertical-align: top; + margin-right: 8px; } +.project_vignettes{ + padding: 4px !important } + .project_vignettes li { + float: left; + } + .project_vignettes .project_avatar { + width: 30px; + height: 30px; + padding-left: 0px; } + .project_vignettes .project_fields { + width: 100%; } + .project_vignettes .project_fields th { + width: 120px; + font-weight: normal; } + .project_vignettes .project_fields td { + color: #888888; } + .project_vignettes h4 a { + color: #4c4c4c; } + .project_vignettes > li h4 { + margin-bottom: 2px; + padding-left: 2px; } + +.oe_project_buttons { + padding: 2px 2px !important; + background: none !important; + background-color: transparent !important; + border: hidden !important; + color: #8A89BA !important; +} +.oe_project_buttons:hover { + cursor: pointer; + color: #0000FF; +} +.project_avatar { + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -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); + } +.click_button { + background: none !important; + background-color: transparent !important; + border: hidden !important; + min-height: 155px; + min-width: 265px; + border: hidden; + /*margin-left: 6px !important;*/ + margin-top: 3px !important; + text-align: left; + vertical-align: super; + font-size: 11px; + -webkit-box-align: baseline; +} + + +.click_button:hover { + cursor: default !important; +} +.dropdown-menu { + display: none; + position: absolute; } +.dropdown { + position: relative; } +.dropdown-toggle:after { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-top: 8px; + margin-left: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid white; + filter: alpha(opacity=50); + -khtml-opacity: 0.5; + -moz-opacity: 0.5; + opacity: 0.5; } + .oe_project_kanban_vignette .dropdown-menu .color-chooser { + padding: 0 3px; } + .oe_project_kanban_vignette .dropdown-menu .color-chooser li { + float: left; } + .oe_project_kanban_vignette .dropdown-menu .color-chooser li a { + padding: 2px; } +a.oe_project_kanban_action { + position: absolute; + right: 0; + display: none; + } + a.oe_project_kanban_action:hover { + text-decoration: none; } + a.oe_project_kanban_action .oe_i { + color: #4c4c4c; } + +.square { + display: inline-block; + width: 18px; + height: 18px; + border:1px solid grey; + } + +.oe_kanban_color_0 { + background: white; +} +.oe_kanban_color_1 { + background: #B1DCFE; +} +.oe_kanban_color_2 { + background: #FF8E8E; +} +.oe_kanban_color_3 { + background: khaki; +} +.oe_kanban_color_4 { + background: thistle; +} +.oe_kanban_color_5 { + background: orange; +} + +.open { + display: block; + } + .open .dropdown-menu { + display: block; } + +a.oe_project_kanban_action { + position: absolute; + right: 0; + } + a.oe_project_kanban_action:hover { + text-decoration: none; + } + a.oe_project_kanban_action .eo_i { + color: #4c4c4c; } + +.oe_project_kanban_vignette { + position: relative; + min-height: 50px; + /*background: white;*/ + border: 1px solid #d8d8d8; + border-bottom-color: #b9b9b9; + padding: 6px; + margin: 6px 0; + display: inline-block; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + +} + .oe_project_kanban_vignette:last-child { + margin-bottom: 0; } + .oe_project_kanban_vignette:hover { + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); + -box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); } + .oe_project_kanban_vignette h4 { + margin: 0 0 2px; } + +.oe_project_kanban_vignette .dropdown-menu { + top: 30px; + right: -140px; + padding: 4px; + border: 1px solid #afafb6; + width: 160px; + overflow-x: hidden; + z-index: 900; + background: white; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); } + .oe_project_kanban_vignette .dropdown-menu p { + margin-left: 12px; } + .oe_project_kanban_vignette .dropdown-menu li { + float: none; + display: block; + background-color: none; } + .oe_project_kanban_vignette .dropdown-menu li a { + display: block; + padding: 3px 6px; + clear: both; + font-weight: normal; + line-height: 14px; + color: #4c4c4c; + text-decoration: none; } + .oe_project_kanban_vignette .dropdown-menu li a:hover { + background: #f0f0fa; + background: -moz-linear-gradient(#f0f0fa, #eeeef6); + background: -webkit-gradient(linear, left top, left bottom, from(#f0f0fa), to(#eeeef6)); + background: -webkit-linear-gradient(#f0f0fa, #eeeef6); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; } + +.oe_project_kanban_vignette .dropdown-menu .color-chooser { + padding: 0 3px; } + .oe_project_kanban_vignette .dropdown-menu .color-chooser li { + float: left; } + .oe_project_kanban_vignette .dropdown-menu .color-chooser li a { + padding: 2px; } diff --git a/addons/project/static/src/img/tasks_icon.png b/addons/project/static/src/img/tasks_icon.png Binary files differnew file mode 100644 index 00000000000..5c5073b1633 --- /dev/null +++ b/addons/project/static/src/img/tasks_icon.png diff --git a/addons/project/static/src/js/dropdown.js b/addons/project/static/src/js/dropdown.js new file mode 100644 index 00000000000..54b61c5e9d0 --- /dev/null +++ b/addons/project/static/src/js/dropdown.js @@ -0,0 +1,92 @@ +/* ============================================================ + * bootstrap-dropdown.js v2.0.2 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function( $ ){ + + "use strict" + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle="dropdown"]' + , Dropdown = function ( element ) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function ( e ) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + , isActive + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + isActive = $parent.hasClass('open') + + clearMenus() + !isActive && $parent.toggleClass('open') + + return false + } + + } + + function clearMenus() { + $(toggle).parent().removeClass('open') + } + + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + $.fn.dropdown = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(function () { + $('html').on('click.dropdown.data-api', clearMenus) + $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) + }) + +}( window.jQuery );
\ No newline at end of file diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js new file mode 100644 index 00000000000..09a7c9eb256 --- /dev/null +++ b/addons/project/static/src/js/project.js @@ -0,0 +1,48 @@ +openerp.project = function(openerp) { + openerp.web_kanban.ProjectKanban = openerp.web_kanban.KanbanRecord.include({ + bind_events: function() { + var self = this; + self._super(); + if(this.view.dataset.model == 'project.project') { + + /*set avatar title for members. + In many2many fields, returns only list of ids. + we can implement return value of m2m fields like [(1,"Adminstration"),...]. + */ + _.each($(this.$element).find('.project_avatar'),function(avatar){ + var dataset = new openerp.web.DataSetSearch(this, 'res.users', self.session.context, [['id','=',avatar.id]]); + dataset.read_slice(['name']).then(function(result){ + avatar.setAttribute("title",result[0].name) + }); + }); + + // set sequence like Tasks,Issues,Timesheets and Phases + var my_list = $("#list a") + my_list.sort(function (a, b) { + var aValue = parseInt(a.id); + var bValue = parseInt(b.id); + return aValue == bValue ? 0 : aValue < bValue ? -1 : 1; + }); + $('#list').replaceWith(my_list); + + // when vignette is clicked, it opens the first action in sequence + if (my_list.length != 0) { + var click_button = $(this.$element).find('.click_button') + click_button.attr('data-name', my_list[0].getAttribute('data-name')); + click_button.attr('data-type', "action"); + } + + /* set background color. + we can do other way to implement new widget. + because we need to rpc call for that. + */ + this.$element.find('.bgcolor').click(function(){ + var color = parseInt($(this).find('span').attr('class').split(' ')[0].substring(16)) + var color_class = $(this).find('span').attr('class').split(' ')[0] + $(this).closest('#oe_project_kanban_vignette').removeClass().addClass(color_class + ' oe_project_kanban_vignette'); + self.view.dataset.write(parseInt(this.id), {color:color}); + }); + } + } + }); +} |
