update style

This commit is contained in:
sentriz
2019-04-22 15:34:52 +01:00
parent 5f37427918
commit 85f7563cc5
9 changed files with 83 additions and 55 deletions

View File

@@ -1,9 +1,9 @@
/* reset from awsm */ form input[type],
form input[type], form select, form textarea { form select,
form textarea {
margin-bottom: 0; margin-bottom: 0;
} }
/* reset from awsm */
form { form {
max-width: 400px; max-width: 400px;
margin-left: auto; margin-left: auto;
@@ -13,7 +13,15 @@ form {
align-items: flex-end; align-items: flex-end;
} }
/* reset from awsm */ form input[type=password],
form input[type=text] {
margin-bottom: 0.25rem;
}
form input[type=submit] {
width: 8rem;
}
div { div {
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -28,22 +36,40 @@ body {
justify-content: space-between; justify-content: space-between;
} }
a, a:visited { a,
color: #0064c1; a:visited {
color: #0064c1;
text-decoration: none;
} }
form input[type=password], form input[type=text] { a:hover {
margin-bottom: 0.25rem; text-decoration: underline;
} }
form input[type=submit] {
width: 8rem;
}
#content > * { #content>* {
margin: 2rem 0; margin: 2rem 0;
} }
#header {
border-bottom: 1px solid grey;
padding-top: 3rem;
}
#header img {
max-width: 580px;
position: relative;
}
#footer {
text-align: right;
}
#flashes {
background-color: #fd1b1b1c;
}
.right { .right {
text-align: right; text-align: right;
} }
@@ -78,24 +104,6 @@ form input[type=submit] {
padding: 0 1rem; padding: 0 1rem;
} }
#header {
border-bottom: 1px solid grey;
padding-top: 3rem;
}
#header img {
max-width: 580px;
position: relative;
}
#footer {
text-align: right;
}
#flashes {
background-color: #fd1b1b1c;
}
.angry { .angry {
background-color: #f4433669; background-color: #f4433669;
} }
@@ -103,3 +111,7 @@ form input[type=submit] {
.happy { .happy {
background-color: #4caf5069; background-color: #4caf5069;
} }
i.mdi {
font-size: 14px;
}

View File

@@ -4,6 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{ template "title" }}</title> <title>{{ template "title" }}</title>
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css">
<link rel="stylesheet" href="/admin/static/stylesheets/awsm.css"> <link rel="stylesheet" href="/admin/static/stylesheets/awsm.css">
<link rel="stylesheet" href="/admin/static/stylesheets/main.css"> <link rel="stylesheet" href="/admin/static/stylesheets/main.css">
<link rel="shortcut icon" href="/admin/static/images/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/admin/static/images/favicon.ico" type="image/x-icon">
@@ -24,8 +25,12 @@
{{ template "content" . }} {{ template "content" . }}
</div> </div>
</div> </div>
<div id="footer" class="padded"> <div id="footer" class="padded mono">
<p>senan kelly, 2019 &#124; <a href="https://github.com/sentriz/gonic">github</a></p> <p>
senan kelly, 2019
<span class="light">&#124;</span>
<a href="https://github.com/sentriz/gonic">github</a>
</p>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -3,7 +3,7 @@
{{ define "user" }} {{ define "user" }}
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>changing account password</u> <i class="mdi mdi-account-key"></i> changing account password
</div> </div>
<form action="/admin/change_own_password_do" method="post"> <form action="/admin/change_own_password_do" method="post">
<input type="password" id="password_one" name="password_one" placeholder="new password"> <input type="password" id="password_one" name="password_one" placeholder="new password">

View File

@@ -3,7 +3,7 @@
{{ define "user" }} {{ define "user" }}
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>changing {{ .SelectedUser.Name }}'s password</u> <i class="mdi mdi-account-key"></i> changing {{ .SelectedUser.Name }}'s password
</div> </div>
<form action="/admin/change_password_do?user={{ .SelectedUser.Name }}" method="post"> <form action="/admin/change_password_do?user={{ .SelectedUser.Name }}" method="post">
<input type="password" id="password_one" name="password_one" placeholder="new password"> <input type="password" id="password_one" name="password_one" placeholder="new password">

View File

@@ -3,7 +3,7 @@
{{ define "user" }} {{ define "user" }}
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>create new user</u> <i class="mdi mdi-account-plus"></i> creating new user
</div> </div>
<form action="/admin/create_user_do" method="post"> <form action="/admin/create_user_do" method="post">
<input type="text" id="username" name="username" placeholder="username"> <input type="text" id="username" name="username" placeholder="username">

View File

@@ -3,7 +3,7 @@
{{ define "user" }} {{ define "user" }}
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>stats</u> <i class="mdi mdi-chart-arc"></i> stats
</div> </div>
<div class="right"> <div class="right">
<span class="pre">artists: {{ printf "%7v" .ArtistCount }}</span><br/> <span class="pre">artists: {{ printf "%7v" .ArtistCount }}</span><br/>
@@ -13,39 +13,46 @@
</div> </div>
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>last.fm</u> <i class="mdi mdi-lastfm"></i> last.fm
</div> </div>
<div class="right"> <div class="right">
{{ if .User.IsAdmin }} {{ if .User.IsAdmin }}
<a href="/admin/update_lastfm_api_key">update api key</a><br/> <a href="/admin/update_lastfm_api_key">update api key</a><br/>
{{ end }} {{ end }}
{{ if .CurrentLastFMAPIKey }} {{ if .CurrentLastFMAPIKey }}
{{ if .User.LastFMSession }} {{ if .User.LastFMSession }}
<span class="light">current status</span> <span class="happy">linked</span> <a href="/admin/unlink_lastfm_do">unlink</a><br/> <span class="light">current status</span>
{{ else }} <span class="happy">linked</span>
<span class="light">current status</span> <span class="angry">unlinked</span> <a href="https://www.last.fm/api/auth/?api_key={{ .CurrentLastFMAPIKey }}&cb={{ .RequestRoot }}/admin/link_lastfm_do">link</a><br/> <a href="/admin/unlink_lastfm_do">unlink</a><br/>
{{ end }} {{ else }}
{{ else if not .User.IsAdmin }} <span class="light">current status</span>
<span class="light">api key not set. please ask your admin to set it</span> <span class="angry">unlinked</span>
{{ end }} <a href="https://www.last.fm/api/auth/?api_key={{ .CurrentLastFMAPIKey }}&cb={{ .RequestRoot }}/admin/link_lastfm_do">link</a><br/>
{{ end }}
{{ else if not .User.IsAdmin }}
<span class="light">api key not set. please ask your admin to set it</span>
{{ end }}
</div> </div>
</div> </div>
<div class="padded box mono"> <div class="padded box mono">
{{ if .User.IsAdmin }} {{ if .User.IsAdmin }}
{{/* admin panel to manage all users */}} {{/* admin panel to manage all users */}}
<div class="box-title"> <div class="box-title">
<u>users</u> <i class="mdi mdi-account-multiple"></i> users
</div> </div>
<div class="right"> <div class="right">
{{ range $user := .AllUsers }} {{ range $user := .AllUsers }}
<i>{{ $user.Name }}</i> <span class="light">created</span> {{ $user.CreatedAt.Format "Jan 02, 2006" }} <a href="/admin/change_password?user={{ $user.Name }}">change password</a><br/> <i>{{ $user.Name }}</i>
<span class="light">created</span>
{{ $user.CreatedAt.Format "jan 02, 2006" }}
<a href="/admin/change_password?user={{ $user.Name }}">change password</a><br/>
{{ end }} {{ end }}
<a href="/admin/create_user" class="button">create new</a> <a href="/admin/create_user" class="button">create new</a>
</div> </div>
{{ else }} {{ else }}
{{/* user panel to manage themselves */}} {{/* user panel to manage themselves */}}
<div class="box-title"> <div class="box-title">
<u>your account</u> <i class="mdi mdi-account"></i> your account
</div> </div>
<div class="right"> <div class="right">
<a href="/admin/change_own_password" class="button">change password</a> <a href="/admin/change_own_password" class="button">change password</a>

View File

@@ -3,7 +3,7 @@
{{ define "content" }} {{ define "content" }}
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>please login</u> <i class="mdi mdi-login-variant"></i> login
</div> </div>
<form action="/admin/login_do" method="post"> <form action="/admin/login_do" method="post">
<input type="text" id="username" name="username" placeholder="username"> <input type="text" id="username" name="username" placeholder="username">

View File

@@ -3,7 +3,7 @@
{{ define "user" }} {{ define "user" }}
<div class="padded box mono"> <div class="padded box mono">
<div class="box-title"> <div class="box-title">
<u>updating last.fm api key</u> <i class="mdi mdi-key-change"></i> updating last.fm keys
</div> </div>
<div class="right"> <div class="right">
<span class="light">current key</span> <i>{{ if .CurrentLastFMAPIKey }}{{ .CurrentLastFMAPIKey }}{{ else }}not set{{ end }}</i><br/> <span class="light">current key</span> <i>{{ if .CurrentLastFMAPIKey }}{{ .CurrentLastFMAPIKey }}{{ else }}not set{{ end }}</i><br/>

View File

@@ -1,8 +1,12 @@
{{ define "title" }}home{{ end }} {{ define "title" }}home{{ end }}
{{ define "content" }} {{ define "content" }}
<div class="side-padded light right"> <div class="side-padded light right mono">
welcome <u>{{ .User.Name }}</u> &#124; <a href="/admin/home">home</a> &#124; <a href="/admin/logout">logout</a> welcome {{ .User.Name }}
&#124;
<a href="/admin/home">home</a>
&#124;
<a href="/admin/logout">logout <i class="mdi mdi-logout-variant"></i></a>
</div> </div>
{{ template "user" . }} {{ template "user" . }}
{{ end }} {{ end }}