summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/controller.html8
-rw-r--r--src/templates/footer.html4
-rw-r--r--src/templates/settings.html30
-rw-r--r--src/templates/tap.html2
4 files changed, 28 insertions, 16 deletions
diff --git a/src/templates/controller.html b/src/templates/controller.html
index eb0efab..bd8cbf5 100644
--- a/src/templates/controller.html
+++ b/src/templates/controller.html
@@ -1,9 +1,13 @@
-<div ng-controller="MqttController as mqtt">
- <div ng-controller="BeerDukeControllerController as ctrl">
+<div>
+ <div>
<label>
Code from tap:
<input type="number" ng-model="ctrl.code">
</label>
+ <label>
+ Your email address
+ <input type="email" ng-model="ctrl.email">
+ </label>
<button ng-click="ctrl.requestBeer()">Request Beer!</button>
</div>
diff --git a/src/templates/footer.html b/src/templates/footer.html
index 17483ae..182554d 100644
--- a/src/templates/footer.html
+++ b/src/templates/footer.html
@@ -1,5 +1,5 @@
-<div ng-if="settings.showSettings">
+<div ng-if="settings.showSettings()">
<hr/>
<a href="#/settings">settings</a><br/>
- connected = {{mqtt.connected}}
+ connected = {{mqtt.connected()}}
</div>
diff --git a/src/templates/settings.html b/src/templates/settings.html
index 5147065..f118e47 100644
--- a/src/templates/settings.html
+++ b/src/templates/settings.html
@@ -1,14 +1,22 @@
-<div>
+<div ng-init="clientId = ctrl.settings.clientId(); showSettings = ctrl.settings.showSettings()">
<h2>Settings</h2>
- <a href="#/">back</a>
- <label>
- showSettings
- <input type="checkbox" ng-model="ctrl.settings.showSettings">
- </label>
-
- <label>
- clientId
- <input type="text" ng-model="ctrl.settings.clientId">
- </label>
+
+ <p>
+ <button ng-click="ctrl.save()">back</button>
+ </p>
+
+ <p>
+ <label>
+ showSettings
+ <input type="checkbox" ng-model="ctrl.showSettings">
+ </label>
+ </p>
+
+ <p>
+ <label>
+ clientId
+ <input type="text" ng-model="ctrl.clientId">
+ </label>
+ </p>
</div>
diff --git a/src/templates/tap.html b/src/templates/tap.html
index c266f2d..48d5e37 100644
--- a/src/templates/tap.html
+++ b/src/templates/tap.html
@@ -1,5 +1,5 @@
<div>
- Code: {{ctrl.code}}
+ Last: {{ctrl.message | json}}
<ng-include src="'templates/footer.html'"/>
</div>