aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/base.tmpl25
-rw-r--r--templates/index.tmpl15
-rw-r--r--templates/login.tmpl3
-rw-r--r--templates/settings.tmpl37
4 files changed, 80 insertions, 0 deletions
diff --git a/templates/base.tmpl b/templates/base.tmpl
new file mode 100644
index 0000000..2ee087a
--- /dev/null
+++ b/templates/base.tmpl
@@ -0,0 +1,25 @@
+{{define "header"}}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>ListenDiary</title>
+ <link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">
+ <link rel="stylesheet" href="static/style.css">
+ </head>
+ <body>
+<header>
+ <div id="center">
+ <h1><a href="/">ListenDiary</a></h1>
+ <a href="/settings" class="user">{{ .Session.UserName }}</a>
+ </div>
+</header>
+<div id="main">
+{{end}}
+
+{{define "footer"}}
+</div>
+ </body>
+</html>
+{{end}}
diff --git a/templates/index.tmpl b/templates/index.tmpl
new file mode 100644
index 0000000..7ee1801
--- /dev/null
+++ b/templates/index.tmpl
@@ -0,0 +1,15 @@
+{{template "header" . }}
+<h2>Recent Listens</h2>
+<ul class="scrobbles">
+{{range .Scrobbles}}
+ <li>
+ <img src="{{or .Image "https://lastfm-img2.akamaized.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.png"}}"
+ height="40"/>
+ <div>
+ {{.Artist}} — {{.TrackName}}<br/>
+ <span class="album">in {{.Album}}</span>
+ </div>
+ </li>
+{{end}}
+</ul>
+{{template "footer" }}
diff --git a/templates/login.tmpl b/templates/login.tmpl
new file mode 100644
index 0000000..1510242
--- /dev/null
+++ b/templates/login.tmpl
@@ -0,0 +1,3 @@
+{{template "header"}}
+<a href="{{.}}"><img src="static/google.png"/></a>
+{{template "footer"}}
diff --git a/templates/settings.tmpl b/templates/settings.tmpl
new file mode 100644
index 0000000..5c757ee
--- /dev/null
+++ b/templates/settings.tmpl
@@ -0,0 +1,37 @@
+{{template "header" .}}
+<form method=post action="/settings">
+<section>
+<h2>Profile</h2>
+ <div class="row">
+ <div class="form-element">
+ <input name="name" id="name" type="text" value={{.UserName}}>
+ <label for="name">Name</label>
+ </div>
+
+ <div class="form-element">
+ <input name="email" id="email" type="text" value={{.Email}}>
+ <label for="email">Email</label>
+ </div>
+ </div>
+</section>
+
+<section>
+<h2>Last.fm</h2>
+ <div class="row">
+ <div class="form-element">
+ <input name="lfm_name" id="lfm_name" type="text" value={{.LfmName}}>
+ <label for="lfm_name">Username</label>
+ </div>
+
+ <div class="form-element">
+ <input name="lfm_password" id="lfm_password" type="password" value={{.LfmPassword}}>
+ <label for="lfm_password">Password</label>
+ </div>
+ </div>
+
+</section>
+<div class="row">
+<input type="submit" value="SAVE">
+</div>
+</form>
+{{template "footer"}}