server side done
This commit is contained in:
@@ -23,5 +23,14 @@ Template.log.events({
|
||||
Template.sensorData.helpers({
|
||||
created_at_formatted: function() {
|
||||
return moment(this.created_at).format("DD.MM.YYYY, HH:mm")
|
||||
},
|
||||
all_temperatures: function(temperatures) {
|
||||
var result = '';
|
||||
if (temperatures.length > 0) {
|
||||
for (var i in temperatures) {
|
||||
result += '' + parseFloat(temperatures[i]).toFixed(1) + ' °C ';
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<template name="sensorData">
|
||||
<li>{{owner}} / <strong>{{temperatureValue}}°C</strong> / <strong>{{humidityValue}}%</strong> / Bačva puna: <strong>{{tankFull}}</strong> (L0:{{tankLevel0}}-L1:{{tankLevel1}}-L2:{{tankLevel2}}-L3:{{tankLevel3}}-L4:{{tankLevel4}}-full:{{tankFull}}) / {{created_at_formatted}}</li>
|
||||
<li>{{owner}} / <strong>{{temperatureValue}}°C {{all_temperatures temperatures}}</strong> / <strong>{{humidityValue}}%</strong> / Bačva puna: <strong>{{tankFull}}</strong> (L0:{{tankLevel0}}-L1:{{tankLevel1}}-L2:{{tankLevel2}}-L3:{{tankLevel3}}-L4:{{tankLevel4}}-full:{{tankFull}}) / {{created_at_formatted}}</li>
|
||||
</template>
|
||||
|
||||
@@ -16,5 +16,9 @@ Router.route('/', function() {
|
||||
});
|
||||
|
||||
Router.route('/farmalarm', function() {
|
||||
|
||||
if (Meteor.zoblak.client.accessible('alarm')) {
|
||||
Session.set('templateName', 'alarm');
|
||||
} else {
|
||||
Session.set('templateName', 'no_access')
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user