[IMP] hr_attendance: improve presence indicator

Employee presence indicator in kanban view could previously be confused with
other status indicators from other models that indicated that it was ready for
next stage (green dot).
improved by using fa-user symbol instead of dot.
This commit is contained in:
Denis Vermylen (dve)
2016-08-12 14:30:22 +02:00
parent 93f60ff0ef
commit 856f2e87e6
3 changed files with 15 additions and 23 deletions
@@ -19,11 +19,11 @@ var FormPresenceIndicator = form_common.AbstractField.extend({
return this._super();
},
render_value: function() {
this.$('.oe_hr_attendance_form_status').toggleClass("oe_hr_attendance_form_status_green", this.get_value() == 'checked_in');
this.$('.oe_hr_attendance_form_status').toggleClass("oe_hr_attendance_form_status_red", this.get_value() == 'checked_out');
this.$('.oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_green", this.get_value() == 'checked_in');
this.$('.oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_red", this.get_value() == 'checked_out');
},
display_field: function() {
this.$el.html(QWeb.render("FormPresenceIndicator"));
this.$el.html(QWeb.render("PresenceIndicator"));
},
});
@@ -38,11 +38,11 @@ var KanbanPresenceIndicator = kanban_widgets.AbstractField.extend({
return this._super();
},
render_value: function() {
this.$('.oe_kanban_status').toggleClass("oe_kanban_status_green", this.field.raw_value == 'checked_in');
this.$('.oe_kanban_status').toggleClass("oe_kanban_status_red", this.field.raw_value == 'checked_out');
this.$('.oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_green", this.field.raw_value == 'checked_in');
this.$('.oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_red", this.field.raw_value == 'checked_out');
},
display_field: function() {
this.$el.html(QWeb.render("KanbanPresenceIndicator"));
this.$el.html(QWeb.render("PresenceIndicator"));
},
});
@@ -7,20 +7,17 @@
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
}
.oe_hr_attendance_form_status {
height: .6em;
width: .6em;
border-radius: 50%;
.oe_hr_attendance_status {
font-size: 1.2em;
margin-right: .3em;
display: inline-block;
color: @odoo-brand-secondary;
background-color: @odoo-brand-secondary;
&.oe_hr_attendance_form_status_green {
background-color: @brand-success;
&.oe_hr_attendance_status_green {
color: @brand-success;
}
&.oe_hr_attendance_form_status_red {
background-color: @brand-danger;
&.oe_hr_attendance_status_red {
color: @brand-danger;
}
}
@@ -1,12 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<template xml:space="preserve">
<t t-name="KanbanPresenceIndicator">
<div class="oe_kanban_status">
</div>
</t>
<t t-name="FormPresenceIndicator">
<div class="oe_hr_attendance_form_status">
<t t-name="PresenceIndicator">
<div class="oe_hr_attendance_status fa fa-user">
</div>
</t>