[IMP] hr_attendance: Changed style of sign in/sign out
bzr revid: nicolas.vanhoren@openerp.com-20120907115120-dg8xn97oh9pek7k5
This commit is contained in:
parent
6e2b27e7a9
commit
2698e6dd27
|
@ -1,7 +1,7 @@
|
|||
|
||||
.openerp .oe_attendance_status {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
width: 64px;
|
||||
display: inline-block;
|
||||
}
|
||||
.openerp .oe_attendance_signin {
|
||||
|
@ -12,7 +12,7 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
.openerp .oe_attendance_status.oe_attendance_signed .oe_attendance_signin {
|
||||
display: none;
|
||||
background: url(/hr_attendance/static/src/img/emp-in-disable32.png);
|
||||
}
|
||||
|
||||
.openerp .oe_attendance_signout {
|
||||
|
@ -23,5 +23,5 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
.openerp .oe_attendance_status.oe_attendance_nosigned .oe_attendance_signout {
|
||||
display: none;
|
||||
background: url(/hr_attendance/static/src/img/emp-out-disable32.png);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,6 @@ openerp.hr_attendance = function (instance) {
|
|||
var QWeb = instance.web.qweb;
|
||||
var _t = instance.web._t;
|
||||
var _lt = instance.web._lt;
|
||||
|
||||
var tips = {
|
||||
"true": _lt("You are currently signed in. Click here to sign out."),
|
||||
"false": _lt("You are currently signed out. Click here to sign in."),
|
||||
}
|
||||
|
||||
instance.hr_attendance.AttendanceSlider = instance.web.Widget.extend({
|
||||
template: 'AttendanceSlider',
|
||||
|
@ -21,7 +16,6 @@ openerp.hr_attendance = function (instance) {
|
|||
var tmp = function() {
|
||||
this.$el.toggleClass("oe_attendance_nosigned", ! this.get("signed_in"));
|
||||
this.$el.toggleClass("oe_attendance_signed", this.get("signed_in"));
|
||||
this.$el.attr("title", tips["" + this.get("signed_in")].toString());
|
||||
};
|
||||
this.on("change:signed_in", this, tmp);
|
||||
_.bind(tmp, this)();
|
||||
|
@ -31,6 +25,15 @@ openerp.hr_attendance = function (instance) {
|
|||
this.$(".oe_attendance_signout").click(function() {
|
||||
self.do_update_attendance();
|
||||
});
|
||||
this.$el.tipsy({
|
||||
title: function() {
|
||||
if (self.get("signed_in")) {
|
||||
return _t("You are currently signed in. Click here to sign out.");
|
||||
} else {
|
||||
return _t("You are currently signed out. Click here to sign in.");
|
||||
}
|
||||
}
|
||||
});
|
||||
return this.check_attendance();
|
||||
},
|
||||
do_update_attendance: function () {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<t t-name="AttendanceSlider">
|
||||
<div class="oe_attendance_status oe_attendance_nosigned" title=" ">
|
||||
<div class="oe_attendance_status oe_attendance_nosigned" data-tipsy="true">
|
||||
<div class="oe_attendance_signin"></div>
|
||||
<div class="oe_attendance_signout"></div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue