[RM] the dropdown feature isn't a top priority, after all

bzr revid: abo@openerp.com-20120706155826-i271xel4zduvmq6g
This commit is contained in:
Antonin Bourguignon 2012-07-06 17:58:26 +02:00
parent 622c7f2ad4
commit 0ca634e6a4
3 changed files with 2 additions and 63 deletions

View File

@ -26,27 +26,19 @@
<field name="arch" type="xml">
<xpath expr="//div[@class='oe_portal_crm_team']" position="inside">
<h1>Meet the team</h1>
<field name="employee_ids" widget="many2many_kanban_custom">
<field name="employee_ids" widget="many2many_kanban">
<kanban>
<field name="visibility"/>
<templates>
<t t-name="kanban-box">
<div class="oe_employee_vignette">
<span class="oe_dropdown_toggle oe_dropdown_arrow">
<ul class="oe_dropdown_menu">
<li t-if="record.visibility.raw_value != 'private'"><a href="#" t-attf-data-id='{record.id.raw_value}' class="oe_employee_make_private">Hide this employee</a></li>
<li t-if="record.visibility.raw_value != 'public'"><a href="#" t-attf-data-id='{record.id.raw_value}' class="oe_employee_make_public">Make this employee visible for everyone</a></li>
<li t-if="record.visibility.raw_value != 'portal'"><a href="#" t-attf-data-id='{record.id.raw_value}' class="oe_employee_make_portal">Make this employee visible for portal users</a></li>
</ul>
</span>
<div class="oe_employee_image">
<img t-att-src="kanban_image('hr.employee', 'photo', record.id.value)" class="oe_employee_picture"/>
</div>
<div class="oe_employee_details">
<h4>
<field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t>
<a type="edit"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
</h4>
<ul>
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>

View File

@ -9,16 +9,3 @@
width: 65px;
height: 65px;
}
/* Dropdown menu */
.openerp .oe_portal_crm_contact .oe_employee_vignette .oe_dropdown_toggle {
position: absolute;
top: 10px;
right: 5px;
}
.openerp .oe_portal_crm_contact .oe_employee_vignette .oe_dropdown_arrow:after {
border-top: 4px solid transparent;
}
.openerp .oe_portal_crm_contact .oe_employee_vignette:hover .oe_dropdown_arrow:after {
border-top: 4px solid #404040;
}

View File

@ -1,40 +0,0 @@
openerp.portal_hr_employees = function(session) {
/*
* Extend the many2many_kanban widget and add it a few things such
* as delegates.
*/
// phe: short name for "portal hr employees"
var phe = session.portal_hr_employees = {};
phe.many2many_kanban_custom = session.web.form.FieldMany2ManyKanban.extend({
start: function() {
var self = this;
this._super.apply(this, arguments);
// add events
this.add_events();
},
add_events: function() {
var self = this;
// event: make an employee public
this.$element.delegate('a.oe_employee_make_public', 'click', function (e) {
console.log('make employee#'+$(this).attr('data-id')+' public');
});
// event: make an employee private
this.$element.delegate('a.oe_employee_make_private', 'click', function (e) {
console.log('make employee#'+$(this).attr('data-id')+' private');
});
// event: make an employee portal
this.$element.delegate('a.oe_employee_make_portal', 'click', function (e) {
console.log('make employee#'+$(this).attr('data-id')+' portal');
});
},
});
session.web.form.widgets.add('many2many_kanban_custom', 'openerp.portal_hr_employees.many2many_kanban_custom');
}