1.0.0 beta

This commit is contained in:
2020-03-10 18:52:30 -07:00
parent 691d54ee3e
commit c4ef8d0e96
13 changed files with 302 additions and 85 deletions

17
views/adminpagebase.tpl Normal file
View File

@@ -0,0 +1,17 @@
% rebase('base.tpl', refresh=None, title='tvid administration')
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4">
<a class="navbar-brand" href="/admin">TVID Admin</a>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="btn btn-secondary" href="/logout">Log Out</a>
</li>
</ul>
</nav>
<div class="container" id="adminpanel">
{{!base}}
<p><small>Powered by tvid v{{version}}</small></p>
</div>

View File

@@ -1,4 +1,27 @@
% rebase('base.tpl', refresh=None, title='tvid administration')
% rebase('adminpagebase.tpl', refresh=None, title='tvid administration')
<h1>TVs</h1>
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th scope="col">Display ID</th>
<th scope="col">Descriptive Memo</th>
<th scope="col">Last Seen</th>
<th scope="col">Target URL</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
<p><small>Powered by tvid v{{version}}</small></p>
% for tv in tvs:
<tr>
<th scope="row">{{tv.displayid}}</th>
<td>{{tv.memo or '(none)'}}</td>
<td>{{tv.lastSeen}}</td>
<td>{{tv.target}}</td>
<td><a href="/admin/edit/{{tv.displayid}}" class="btn btn-success btn-sm">Edit</a></td>
</tr>
% end
</tbody>
</table>

View File

@@ -7,8 +7,11 @@
% if defined('refresh'):
<meta http-equiv="refresh" content="{{ get('refresh',60) }}">
% end
% include('htmlheader.tpl')
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/style.css" type="text/css">
</head>
<body>
{{!base}}

33
views/displayeditform.tpl Normal file
View File

@@ -0,0 +1,33 @@
% rebase('adminpagebase.tpl', refresh=None, title='tvid administration')
<h1>Edit {{tv.displayid}}</h1>
<div class="container" style="width: 50%">
<form action="/admin/edit" method="post">
<div class="form-group">
<label for="displayid">Display ID</label>
<input type="text" class="form-control" id="displayid"
value="{{tv.displayid}}"
name="displayid"
placeholder="{{tv.displayid}}"
readonly>
</div>
<div class="form-group">
<label for="formmemo">Descriptive Memo</label>
<input type="text" class="form-control" id="formmemo"
value="{{tv.memo}}"
name="formmemo"
placeholder="description/location"
>
</div>
<div class="form-group">
<label for="targeturl">Target URL</label>
<input type="text" class="form-control" id="targeturl" name="target" placeholder="https://example.com">
</div>
<button type="submit" class="btn btn-primary">Save</button>
</form>
</div>

View File

@@ -4,9 +4,34 @@
<i>Display ID:</i>
</p>
<h1>{{id}}</h1>
<small>(They're only letters. I like India, O like
Oscar.)</small>
<p><small>Powered by tvid v{{version}}</small></p>
<small>(Letters only: I like INDIA, O like
OSCAR.)<br/>
Powered by tvid v{{version}}</small>
</div>
<script>
var x = 0;
var factor = 1;
function animate() {
console.log("animate called");
var elem = document.getElementById("main");
console.log(elem);
console.log(elem.style);
elem.style.marginTop = x + 'px';
x = x + factor;
if(x > 1080) {
factor = -1;
}
if(x < 0) {
factor = 1;
x = 0;
}
}
$(document).ready(function() {
var b = document.getElementsByTagName("BODY")[0]
b.style.background = '#666666';
console.log("starting...");
setInterval(animate, 20);
});
</script>

View File

@@ -1,8 +1,6 @@
% rebase('base.tpl', refresh=None, title=None)
% if defined('msg') and msg:
<div class="card card-body bg-light">{{msg}}</div>
% end
<div class="container">
<div class="wrapper fadeInDown">
<div id="formContent">
@@ -12,6 +10,14 @@
<h2>tvid administration</h2>
</div>
% if defined('msg') and msg:
<p>
<div class="card card-body bg-light">{{msg}}</div>
</p>
% end
<!-- Login Form -->
<form action="/checklogin" method="post">
<input type="password" id="password" class="fadeIn third"
@@ -22,3 +28,5 @@
</div>
</div>
<p><small>Powered by tvid v{{version}}</small></p>
</div>

41
views/navbar.tpl Normal file
View File

@@ -0,0 +1,41 @@
% rebase('base.tpl', refresh=None, title='tvid administration')
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4">
<a class="navbar-brand" href="/admin">TVID Admin</a>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="btn btn-secondary" href="/logout">Log Out</a>
</li>
</ul>
</nav>
<div class="container" id="adminpanel">
<h1>TVs</h1>
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th scope="col">Display ID</th>
<th scope="col">Last Seen</th>
<th scope="col">Target URL</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
% for tv in tvs:
<tr>
<th scope="row">{{tv.displayid}}</th>
<td>{{tv.lastSeen}}</td>
<td>{{tv.target}}</td>
<td><a href="/admin/edit/{{tv.displayid}}" class="btn btn-success btn-sm">Edit</a></td>
</tr>
% end
</tbody>
</table>
<p><small>Powered by tvid v{{version}}</small></p>
</div>

View File

@@ -1,12 +1,17 @@
body {
font-family: sans-serif;
#main {
background: #fff;
width: 100%;
text-align: center;
font-size: 20pt
font-size: 36pt;
margin-top: 5em;
}
h1 {
font-size: 48pt;
#main h1 {
font-size: 72pt;
}
#main small {
font-size: 14pt;
}
a {