general improvements

This commit is contained in:
ston1th 2018-10-27 21:28:19 +02:00
commit ddb11f0619
25 changed files with 305 additions and 140 deletions

17
templates/forbidden.html Normal file
View file

@ -0,0 +1,17 @@
{{define "body"}}
<div class="page-header">
<div class="row">
<div class="col-xs-4 offset-4">
<div class="card border-danger mx-auto">
<div class="card-header">
<strong>403 - Forbidden</strong>
</div>
<div class="card-body">
<h5>Access to this page is restricted</h5>
<a href="/" class="btn btn-sm btn-primary">Back</a>
</div>
</div>
</div>
</div>
</div>
{{end}}

View file

@ -11,7 +11,7 @@
<input type="hidden" name="token" value="{{.Token}}">
<div class="form-group">
<label class="col-form-label" for="user">Username</label>
<input class="form-control input-sm" type="text" id="user" name="user" autofocus required>
<input class="form-control input-sm" type="text" id="user" name="user" value="{{.Data}}" autofocus required>
</div>
<div class="form-group">
<label class="col-form-label" for="password">Password</label>

View file

@ -4,10 +4,10 @@
<div class="col-xs-4 offset-4">
<div class="card border-danger mx-auto">
<div class="card-header">
<strong>404</strong>
<strong>404 - Page Not Found</strong>
</div>
<div class="card-body">
<h4>Page not found</h4>
<h5>The requested page could not be found</h5>
<a href="/" class="btn btn-sm btn-primary">Back</a>
</div>
</div>

View file

@ -36,7 +36,7 @@
<a href="/{{.Data.StoreTitle}}/share" class="btn btn-sm btn-primary">Share</a>
{{end}}
{{if ne .Data.StoreTitle "wiki/Index"}}
<a href="/{{.Data.StoreTitle}}/del" class="btn btn-sm btn-primary">Delete</a>
<a href="/{{.Data.StoreTitle}}/del" class="btn btn-sm btn-danger">Delete</a>
{{end}}
{{end}}
</div>

View file

@ -28,6 +28,7 @@
<label class="custom-control-label" for="perm3">Private</label>
</div>
</div>
<button class="btn btn-sm btn-primary" type="submit">Submit</button>
<button class="btn btn-sm btn-primary" type="submit">Update</button>
<a href="/{{.Data.StoreTitle}}" class="btn btn-sm btn-primary">Back</a>
</form>
{{end}}

View file

@ -1,7 +1,7 @@
{{define "body"}}
<div class="page-header">
<div class="row">
<h2>{{.BodyTitle}}</h2>
<a href="{{if .Key}}/view/{{.Key}}{{else}}/{{.Data.StoreTitle}}{{end}}"><h2>{{.BodyTitle}}</h2></a>
</div>
</div>
<div class="row mt-3">

View file

@ -35,6 +35,6 @@
<label class="custom-control-label" for="perm3">Private</label>
</div>
</div>
<button class="btn btn-sm btn-primary" type="submit">Submit</button>
<button class="btn btn-sm btn-primary" type="submit">Create</button>
</form>
{{end}}

View file

@ -1,5 +1,4 @@
{{define "body"}}
{{if not .Msg}}
<div class="page-header">
<div class="row">
<div class="col-xs-4 offset-4">
@ -13,15 +12,27 @@
<label class="col-form-label" for="key">Key</label>
<input class="form-control input-sm" type="text" id="key" value="{{.Key}}" disabled>
</div>
<a href="/view/{{.Key}}">Share Link</a>
<a href="/view/{{.Key}}" class="btn btn-sm btn-danger">Share Link</a>
<a href="/{{.Data}}/share" class="btn btn-sm btn-primary">Back</a>
{{else}}
<form class="form-horizontal" action="/{{.Data}}/share" method="post">
<input type="hidden" name="token" value="{{.Token}}">
<div class="form-group">
<label class="col-form-label" for="duration">Lifetime</label>
<input class="form-control input-sm" type="text" id="duration" name="duration" placeholder="1d (day) 10m (minutes)" autofocus required>
<input class="form-control input-sm" type="text" id="duration" name="duration" placeholder="min: 30s max: 90d" autocomplete="off" autofocus required>
</div>
<div class="form-group">
<div class="custom-control custom-radio">
<input type="radio" id="mode1" name="mode" value="1" class="custom-control-input" checked="">
<label class="custom-control-label" for="mode1">Parse (15m, 10h)</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="mode2" name="mode" value="2" class="custom-control-input">
<label class="custom-control-label" for="mode2">Day</label>
</div>
</div>
<button class="btn btn-sm btn-primary" type="submit">Share</button>
<a href="/{{.Data}}" class="btn btn-sm btn-primary">Back</a>
</form>
{{end}}
</div>
@ -30,4 +41,3 @@
</div>
</div>
{{end}}
{{end}}

View file

@ -18,7 +18,7 @@
<thead>
<tr>
<th>Username</th>
<th>Admin</th>
<th>Flags</th>
<th>Options</th>
</tr>
</thead>
@ -27,8 +27,12 @@
{{$admin := .Admin}}
{{range $item := .Data}}
<tr>
<td>{{$item.Username}} {{if $item.Secret}}<span class="badge badge-success">TOTP</span>{{end}}</td>
{{if $item.Admin}}<td>yes</td>{{else}}<td>no</td>{{end}}
<td>{{$item.Username}}</td>
<td>
{{if $item.Secret}}<span class="badge badge-success">TOTP</span>{{end}}
{{if eq $item.Locked 3}}<span class="badge badge-warning">Locked</span>{{end}}
{{if $item.Admin}}<span class="badge badge-danger">Admin</span>{{end}}
</td>
<td>
<div class="btn-group">
{{if $admin}}

View file

@ -36,12 +36,13 @@
{{end}}
</div>
{{end}}
<button class="btn btn-sm btn-primary" type="submit">Submit</button>
<button class="btn btn-sm btn-primary" type="submit">Update</button>
{{if .Admin}}
<a href="/user" class="btn btn-sm btn-primary">Back</a>
{{else}}
<a href="/" class="btn btn-sm btn-primary">Back</a>
{{end}}
<a class="btn btn-sm btn-danger" href="/user/del/{{.Data.Username}}">Delete</a>
</form>
{{if .Admin}}
{{if eq .Data.Locked 3}}

View file

@ -24,7 +24,7 @@
<label class="col-form-label" for="admin">Admin Privileges</label>
<input type="checkbox" id="admin" name="admin" value="0">
</div>
<button class="btn btn-sm btn-primary" type="submit">Submit</button>
<button class="btn btn-sm btn-primary" type="submit">Create</button>
<a href="/user" class="btn btn-sm btn-primary">Back</a>
</form>
</div>

View file

@ -16,7 +16,7 @@
</div>
<div class="form-group">
<label class="col-form-label" for="secret">Secret</label>
<p id="secret">{{.Data.Secret}}</p>
<pre><code id="secret">{{.Data.Secret}}</code></pre>
</div>
{{end}}
<div class="form-group">