Import templates.
authorFlorian Forster <ff@octo.it>
Tue, 30 Jan 2018 08:32:06 +0000 (09:32 +0100)
committerFlorian Forster <ff@octo.it>
Tue, 30 Jan 2018 08:32:06 +0000 (09:32 +0100)
templates/foot.html [new file with mode: 0644]
templates/head.html [new file with mode: 0644]
templates/loggedin.html [new file with mode: 0644]
templates/main.html [new file with mode: 0644]
templates/navbar.html [new file with mode: 0644]

diff --git a/templates/foot.html b/templates/foot.html
new file mode 100644 (file)
index 0000000..dad5dd5
--- /dev/null
@@ -0,0 +1,14 @@
+    </div> <!-- main -->
+    <div class="navbar footer">
+      <div class="left">
+        All right reserved.<br />
+        Copyright &copy; 2018 <a href="https://octo.it/">Florian Forster</a>
+      </div>
+      <div class="right">
+        Fitbit&reg; is a registered trademark of Fitbit, Inc.<br />
+        Google Fit&reg; is a registered trademark of Google LLC
+      </div>
+      <div class="clear"></div>
+    </div>
+  </body>
+</html>
diff --git a/templates/head.html b/templates/head.html
new file mode 100644 (file)
index 0000000..dff1fb1
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="">
+    <meta name="author" content="Florian Forster">
+    <title>Kraftakt</title>
+    <link href="/static/style.css" rel="stylesheet">
+  </head>
+
+  <body>
+    {{template "navbar.html" .}}
+    <div class="main">
+      <h1>Kraftakt</h1>
+      <div class="slogan">
+        Working out is hard enough
+      </div>
+
+      <hr />
diff --git a/templates/loggedin.html b/templates/loggedin.html
new file mode 100644 (file)
index 0000000..24dd19a
--- /dev/null
@@ -0,0 +1,47 @@
+{{template "head.html" .}}
+      <table class="connections">
+        <caption>Connections</caption>
+        <tr>
+{{if .HaveFitbit}}
+          <td class="authorized">
+            <img class="icon" src="/static/fitbit.png" width="19" height="19" />
+            <span class="name">Fitbit</span>
+            <span class="status">Connected</span>
+          </td>
+          <td class="action">
+            <a href="/fitbit/disconnect" class="button flat">Disconnect</a>
+          </td>
+{{else}}
+          <td class="unauthorized">
+            <img class="icon" src="/static/fitbit.png" width="19" height="19" />
+            <span class="name">Fitbit</span>
+            <span class="status">Disconnected</span>
+          </td>
+          <td class="action">
+            <a href="/fitbit/login" class="button flat">Connect</a>
+          </td>
+{{end}}
+        </tr>
+        <tr>
+{{if .HaveGoogleFit}}
+          <td class="authorized">
+            <img class="icon" src="/static/gfit.png" width="19" height="19" />
+            <span class="name">Google Fit</span>
+            <span class="status">Connected</span>
+          </td>
+          <td class="action">
+            <a href="/google/disconnect" class="button flat">Disconnect</a>
+          </td>
+{{else}}
+          <td class="unauthorized">
+            <img class="icon" src="/static/gfit.png" width="19" height="19" />
+            <span class="name">Google Fit</span>
+            <span class="status">Disconnected</span>
+          </td>
+          <td class="action">
+            <a href="/google/login" class="button flat">Connect</a>
+          </td>
+{{endif}}
+        </tr>
+      </table>
+{{template "foot.html" .}}
diff --git a/templates/main.html b/templates/main.html
new file mode 100644 (file)
index 0000000..1029b8f
--- /dev/null
@@ -0,0 +1,19 @@
+{{template "head.html" .}}
+      <p><strong>Kraftakt</strong> is a service that copies your
+      <em>Fitbit</em> data to <em>Google Fit</em>.</p>
+
+      <p><em>Kraftakt</em> connects with your <em>Fitbit</em> account and
+      subscribes to updates of your fitness data.</p>
+
+      <p>After signing in, you need to link <em>Kraftakt</em> with your
+      <em>Fitbit</em> and <em>Google Fit</em> accounts. This allows
+      <em>Kraftakt</em> to read your fitness data from <em>Fitbit</em> and
+      write fitness data to <em>Google Fit</em>.</p>
+
+      <div style="text-align: right; margin-right: 1em;">
+        <a href="loggedin.html" class="button raised">
+          Sign in
+        </a>
+      </div>
+    </div>
+{{template "foot.html" .}}
diff --git a/templates/navbar.html b/templates/navbar.html
new file mode 100644 (file)
index 0000000..a361d83
--- /dev/null
@@ -0,0 +1,12 @@
+    <div class="navbar heading">
+      <div class="right">
+{{if .User == nil}}
+        <a href="/login" class="button flat">Login</a>
+{{else}}
+        <div class="button flat">
+          {{.User}}
+        </div>
+{{end}}
+      </div>
+      <div class="clear"></div>
+    </div>