15 lines
387 B
JavaScript
15 lines
387 B
JavaScript
Template.state_details.helpers({
|
|
pretty_valve: function(state) {
|
|
if (state === 'open') return "Otvoren";
|
|
if (state === 'opening') return "Otvara se";
|
|
if (state === 'closing') return "Zatvara se";
|
|
if (state === 'closed') return "Zatvoren";
|
|
},
|
|
last_communication_time: function() {
|
|
return moment(this.time).fromNow();
|
|
}
|
|
});
|
|
|
|
Template.state_details.events({
|
|
});
|