add a slightly more intuitive ui

This commit is contained in:
sentriz
2020-03-11 18:32:58 +00:00
parent e0b790b6ec
commit 3d6a4f5067
4 changed files with 44 additions and 39 deletions

View File

@@ -9,7 +9,9 @@
<body>
<div id="content">
<div id="header">
<img src="{{ path "/admin/static/gonic.png" }}">
<a href="{{ path "/admin/home" }}">
<img src="{{ path "/admin/static/gonic.png" }}">
</a>
</div>
{{ range $flash := .Flashes }}
<div class="padded flash-{{ $flash.Type }}">

View File

@@ -22,11 +22,13 @@
<i class="mdi mdi-lastfm"></i> last.fm
</div>
<div class="text-right">
<p class="light">have gonic scrobble to <a href="https://www.last.fm/">last.fm</a> on your behalf</p>
{{ if .User.IsAdmin }}
<p class="light">you can get an api key <a href="https://www.last.fm/api/account/create" target="_blank">here</a></p>
<a href="{{ path "/admin/update_lastfm_api_key" }}">update api key</a><br/>
<br/>
<a href="{{ path "/admin/update_lastfm_api_key" }}">update api key&#8230;</a><br/>
{{ end }}
{{ if .CurrentLastFMAPIKey }}
<br/>
<span class="light">current status</span>
{{ if .User.LastFMSession }}
linked
@@ -34,12 +36,14 @@
<a href="{{ path "/admin/unlink_lastfm_do" }}">unlink</a><br/>
{{ else }}
<span class="angry">unlinked</span>
{{ $cbPath := path "/admin/link_lastfm_do" }}
{{ $cbURL := printf "%s%s" .RequestRoot $cbPath }}
{{ $cbPath := path "/admin/link_lastfm_do" }}
{{ $cbURL := printf "%s%s" .RequestRoot $cbPath }}
<a href="https://www.last.fm/api/auth/?api_key={{ .CurrentLastFMAPIKey }}&cb={{ $cbURL }}">link</a><br/>
{{ end }}
{{ else if not .User.IsAdmin }}
<span class="light">api key not set. please ask your admin to set it</span>
<br/>
<p class="light">api key not set</p>
<p class="light">please ask your admin to set it</p>
{{ end }}
</div>
</div>
@@ -54,16 +58,17 @@
<i>{{ $user.Name }}</i>
<span class="light no-small">{{ $user.CreatedAt | date }}</span>
<span class="light">&#124;</span>
<a href="{{ printf "/admin/change_password?user=%s" $user.Name | path }}">change password</a>
<a href="{{ printf "/admin/change_password?user=%s" $user.Name | path }}">change password&#8230;</a>
<span class="light">&#124;</span>
{{ if $user.IsAdmin }}
<span class="light">delete</span>
<span class="light">delete&#8230;</span>
{{ else }}
<a href="{{ printf "/admin/delete_user?user=%s" $user.Name | path }}">delete</a>
<a href="{{ printf "/admin/delete_user?user=%s" $user.Name | path }}">delete&#8230;</a>
{{ end }}
<br/>
{{ end }}
<a href="{{ path "/admin/create_user" }}" class="button">create new</a>
<br/>
<a href="{{ path "/admin/create_user" }}" class="button">create new&#8230;</a>
</div>
{{ else }}
{{/* user panel to manage themselves */}}
@@ -71,7 +76,7 @@
<i class="mdi mdi-account"></i> your account
</div>
<div class="text-right">
<a href="{{ path "/admin/change_own_password" }}" class="button">change password</a>
<a href="{{ path "/admin/change_own_password" }}" class="button">change password&#8230;</a>
</div>
{{ end }}
</div>
@@ -117,16 +122,17 @@
</tr>
{{ end }}
</table>
<br/>
<form
id="playlist-upload-form"
enctype="multipart/form-data"
action="{{ path "/admin/upload_playlist_do" }}"
method="post"
id="playlist-upload-form"
enctype="multipart/form-data"
action="{{ path "/admin/upload_playlist_do" }}"
method="post"
>
<label for="playlist-upload-input">
<a>upload m3u8 files</a>
</label>
<input id="playlist-upload-input" name="playlist-files" type="file" multiple />
<div style="position: relative;">
<input id="playlist-upload-input" style="position: absolute; opacity: 0;" name="playlist-files" type="file" multiple />
<input type="button" value="upload m3u8">
</div>
</form>
<script>
document.getElementById("playlist-upload-input").onchange = (e) => {

View File

@@ -4,8 +4,10 @@
<i class="mdi mdi-key-change"></i> updating last.fm keys
</div>
<div class="text-right">
<span class="light">current key</span> <i>{{ default "not set" .CurrentLastFMAPIKey }}</i><br/>
<span class="light">current secret</span> <i>{{ default "not set" .CurrentLastFMAPISecret }}</i>
<p class="light">(you can get an api key <a href="https://www.last.fm/api/account/create" target="_blank">here</a>)</p>
<br/>
<p><span class="light">current key</span> <i>{{ default "not set" .CurrentLastFMAPIKey }}</i></p>
<p><span class="light">current secret</span> <i>{{ default "not set" .CurrentLastFMAPISecret }}</i></p>
</div>
<form action="{{ path "/admin/update_lastfm_api_key_do" }}" method="post">
<input type="text" id="api_key" name="api_key" placeholder="new key">

View File

@@ -35,28 +35,19 @@ table td:not(:last-child)::after {
}
}
form input[type="file"] {
display: none;
}
form input[type],
form select,
form textarea {
margin-bottom: 0;
}
form input {
padding: 3px;
input,
select,
textarea {
border-radius: 0;
border: 1px solid #ccc;
box-sizing: border-box;
margin: 1px 0;
padding: 0;
height: 20px;
}
form input[type="password"],
form input[type="text"] {
margin-bottom: 0.25rem;
}
form input[type="submit"] {
input[type="submit"],
input[type="button"] {
width: 8rem;
background-color: white;
cursor: pointer;
@@ -162,3 +153,7 @@ a:hover {
.light {
color: #00000082;
}
.emp {
font-style: italic;
}