diff --git a/app/.meteor/packages b/app/.meteor/packages index 256e87a..58f9ed9 100644 --- a/app/.meteor/packages +++ b/app/.meteor/packages @@ -22,3 +22,5 @@ less huttonr:bootstrap3 nimble:restivus momentjs:moment +selaias:meteor-simpleweather +u2622:persistent-session diff --git a/app/.meteor/versions b/app/.meteor/versions index 2ef1884..e911e96 100644 --- a/app/.meteor/versions +++ b/app/.meteor/versions @@ -1,4 +1,5 @@ accounts-base@1.2.2 +amplify@1.0.0 autopublish@1.0.4 autoupdate@1.2.4 babel-compiler@5.8.24_1 @@ -27,6 +28,7 @@ ejson@1.0.7 es5-shim@4.1.14 fastclick@1.0.7 geojson-utils@1.0.4 +handlebars@1.0.4 hot-code-push@1.0.0 html-tools@1.0.5 htmljs@1.0.5 @@ -36,6 +38,7 @@ huttonr:bootstrap3-assets@3.3.5_6 id-map@1.0.4 insecure@1.0.4 jquery@1.11.4 +json@1.0.3 launch-screen@1.0.4 less@2.5.1 livedata@1.0.15 @@ -62,6 +65,7 @@ reactive-var@1.0.6 reload@1.1.4 retry@1.0.4 routepolicy@1.0.6 +selaias:meteor-simpleweather@0.6.8 service-configuration@1.0.5 session@1.1.1 simple:json-routes@1.0.4 @@ -71,6 +75,7 @@ standard-minifiers@1.0.2 templating@1.1.5 templating-tools@1.0.0 tracker@1.0.9 +u2622:persistent-session@0.4.4 ui@1.0.8 underscore@1.0.4 url@1.0.5 diff --git a/app/client/app.html b/app/client/app.html index bb3a8e5..62dbde6 100644 --- a/app/client/app.html +++ b/app/client/app.html @@ -1,25 +1,20 @@ - - - - - TFM - - - - + + TFM + + + + - + - + {{> tabs}} -
-
- {{> display}} -
-
+
+ {{> Template.dynamic template=template_name }} +
- + + + + diff --git a/app/client/app.js b/app/client/app.js index 007998c..a54400f 100644 --- a/app/client/app.js +++ b/app/client/app.js @@ -1,17 +1,8 @@ -if (Meteor.isClient) { +// at the beginning +Session.set("templateName", "start"); - Template.display.helpers({ - sensorDataCollection: function () { - return SensorData.find({}, {sort: {created_at: -1}}) - } - }); - - Template.display.events({ - }); - - Template.sensorData.helpers({ - created_at_formatted: function() { - return moment(this.created_at).format("DD.MM.YYYY, HH:mm") - } - }); -} +Template.body.helpers({ + template_name: function() { + return Session.get("templateName"); + } +}); diff --git a/app/client/app.less b/app/client/app.less index 6e207e3..2f32c35 100644 --- a/app/client/app.less +++ b/app/client/app.less @@ -2,3 +2,7 @@ padding: 40px 15px; text-align: center; } + +.controller_selection { + padding-top: 10px; +} diff --git a/app/client/display.html b/app/client/display.html deleted file mode 100644 index f58e5f3..0000000 --- a/app/client/display.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/app/client/log.html b/app/client/log.html new file mode 100644 index 0000000..f08070b --- /dev/null +++ b/app/client/log.html @@ -0,0 +1,13 @@ + diff --git a/app/client/log.js b/app/client/log.js new file mode 100644 index 0000000..ae000b7 --- /dev/null +++ b/app/client/log.js @@ -0,0 +1,21 @@ +Template.log.helpers({ + sensorDataCollection: function() { + return SensorData.find({}, { + sort: { + created_at: -1 + } + }); + } +}); + +Template.log.events({ + 'click clear_log': function() { + Meteor.call('clearLog'); + } +}); + +Template.sensorData.helpers({ + created_at_formatted: function() { + return moment(this.created_at).format("DD.MM.YYYY, HH:mm") + } +}); diff --git a/app/client/start.html b/app/client/start.html new file mode 100644 index 0000000..7aa6e9d --- /dev/null +++ b/app/client/start.html @@ -0,0 +1,5 @@ + diff --git a/app/client/start.js b/app/client/start.js new file mode 100644 index 0000000..30e824b --- /dev/null +++ b/app/client/start.js @@ -0,0 +1,17 @@ +var options = { + location: 40.7127+','+ 74.0059, // New York + unit: 'c', + success: function(weather) { + html = '

' + html += weather.temp+'°'+weather.units.temp+'

'; + html += '