2017-06-22 Build
* Use 'https://github.com/mjibson/esc' for embedded assets * Pull database name out of siteData object * Load site config from database, if available * Allow customizing site config from command line arguments * Clean up some templates * Update Readme (it still needs a lot of updating) * Started work on vote accumulation/management
This commit is contained in:
@@ -5,45 +5,6 @@
|
||||
<label for="teamname">Team Name</label>
|
||||
<input id="teamname" name="teamname" type="text" placeholder="Team Name" value="" autofocus>
|
||||
</div>
|
||||
|
||||
<h2>Members</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Slack ID</th>
|
||||
<th>Twitter</th>
|
||||
<th>Email</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="team-member">
|
||||
<div class="pure-control-group">
|
||||
<label for="membername">Name</label>
|
||||
<input id="membername" name="membername" type="text" placeholder="Name" value="">
|
||||
</div>
|
||||
<div class="pure-control-group">
|
||||
<label for="memberslackid">Slack ID</label>
|
||||
<input id="memberslackid" name="memberslackid" type="text" placeholder="@SlackID" value="">
|
||||
</div>
|
||||
<div class="pure-control-group">
|
||||
<label for="membertwitter">Twitter</label>
|
||||
<input id="membertwitter" name="membertwitter" type="text" placeholder="@TwitterID" value="">
|
||||
</div>
|
||||
<div class="pure-control-group">
|
||||
<label for="memberemail">Email</label>
|
||||
<input id="memberemail" name="memberemail" type="text" placeholder="user@email.com" value="">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="pure-button pure-button-primary">Add Team</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@@ -1,3 +1,7 @@
|
||||
<div>The hosting server is always an authenticated client</div>
|
||||
{{ if not .TemplateData.Clients }}
|
||||
<div>No additional clients have been authenticated</div>
|
||||
{{ else }}
|
||||
<table id="clients-table" class="hidden sortable pure-table pure-table-bordered center">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -17,12 +21,4 @@
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
<script>
|
||||
snack.ready(function() {
|
||||
var tableBody = document.querySelector("#clients-table>tbody");
|
||||
if(tableBody.children.length>0) {
|
||||
// Show the table
|
||||
document.getElementById('clients-table').classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
<table id="games-table" class="hidden sortable pure-table pure-table-bordered center">
|
||||
{{ if not .TemplateData.Games }}
|
||||
<div>No games have been created</div>
|
||||
{{ else }}
|
||||
<table id="games-table" class="sortable pure-table pure-table-bordered center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Game Name</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Game Name</th>
|
||||
<th>Team Name</th>
|
||||
<th>Screenshots</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $i, $v := .TemplateData.Games }}
|
||||
<tr>
|
||||
<td>{{ $v.Name }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{ range $i, $v := .TemplateData.Games }}
|
||||
<tr>
|
||||
<td>{{ $v.Name }}</td>
|
||||
<td></td>
|
||||
<td>{{ len $v.Screenshots }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
<script>
|
||||
snack.ready(function() {
|
||||
var tableBody = document.querySelector("#games-table>tbody");
|
||||
if(tableBody.children.length>0) {
|
||||
// Show the table
|
||||
document.getElementById('games-table').classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
@@ -1,6 +1,14 @@
|
||||
<div class="content">
|
||||
<button onclick="window.location.href='/admin/votes'">Votes</button>
|
||||
<button onclick="window.location.href='/admin/teams'">Teams</button>
|
||||
<button onclick="window.location.href='/admin/games'">Games</button>
|
||||
<button onclick="window.location.href='/admin/users'">Users</button>
|
||||
<div>
|
||||
<h3>Public Mode</h3>
|
||||
<button onclick="window.location.href='/admin/mode/0'" class="pure-button-toggle-first pure-button {{ if eq .PublicMode 0 }}pure-button-primary{{ end }}">Waiting</button>
|
||||
<button onclick="window.location.href='/admin/mode/1'" class="pure-button-toggle-last pure-button {{ if eq .PublicMode 1 }}pure-button-primary{{ end }}">Voting</button>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Admin Sections</h3>
|
||||
<button class="pure-button" onclick="window.location.href='/admin/votes'">Votes</button>
|
||||
<button class="pure-button" onclick="window.location.href='/admin/teams'">Teams</button>
|
||||
<button class="pure-button" onclick="window.location.href='/admin/games'">Games</button>
|
||||
<button class="pure-button" onclick="window.location.href='/admin/users'">Users</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<div id="menu" class="{{if .HideAdminMenu}}hidden{{end}}">
|
||||
<div class="pure-menu">
|
||||
<a class="pure-menu-heading" href="/admin/">Admin</a>
|
||||
<a href="#menu" class="menu-button">
|
||||
<i class="fa fa-bars"></i>
|
||||
</a>
|
||||
@@ -13,9 +12,7 @@
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ if .ClientIsAuth }}
|
||||
{{ if .ClientIsServer }}
|
||||
<span class="pure-menu-nonlink"><i class="fa fa-server"></i> Server Mode</span>
|
||||
{{ else }}
|
||||
{{ if not .ClientIsServer }}
|
||||
<a href="/admin/clients/{{.ClientID}}/remove" class="pure-menu-link"><i class="fa fa-key"></i> DeAuth Client</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
|
@@ -1,12 +1,16 @@
|
||||
<div class="bottom-space center">
|
||||
<a id="btnAddTeam" class="pure-button pure-button-success" href="/admin/teams/new"><i class="fa fa-plus"></i> Add Team</a>
|
||||
</div>
|
||||
<table id="teams-table" class="hidden sortable pure-table pure-table-bordered center">
|
||||
{{ if not .TemplateData.Teams }}
|
||||
<div>No teams have been created</div>
|
||||
{{ else }}
|
||||
<table id="teams-table" class="sortable pure-table pure-table-bordered center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Key</th>
|
||||
<th>Members</th>
|
||||
<th>Game</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -16,6 +20,7 @@
|
||||
<td>{{ $v.Name }}</td>
|
||||
<td>{{ $v.UUID }}</td>
|
||||
<td>{{ len $v.Members }}</td>
|
||||
<td>{{ $v.Game.Name }}</td>
|
||||
<td>
|
||||
<a href="/admin/teams/{{ $v.UUID }}/edit" class="pure-button pure-button-plain"><i class="fa fa-pencil"></i></a>
|
||||
<a href="/admin/teams/{{ $v.UUID }}/delete" class="pure-button pure-button-plain"><i class="fa fa-trash"></i></a>
|
||||
@@ -24,12 +29,4 @@
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
<script>
|
||||
snack.ready(function() {
|
||||
var tableBody = document.querySelector("#teams-table>tbody");
|
||||
if(tableBody.children.length>0) {
|
||||
// Show the table
|
||||
document.getElementById('teams-table').classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
14
templates/admin-votes.html
Normal file
14
templates/admin-votes.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<table id="votes-table" class="sortable pure-table pure-table-bordered center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Timestamp</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $i, $v, := .TemplateData.Votes }}
|
||||
<tr>
|
||||
<td>{{ $v.Timestamp }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
@@ -8,6 +8,8 @@ var clientID = "{{.ClientID}}";
|
||||
<div class="header">
|
||||
devICT Game Jam - {{.CurrentJam}}
|
||||
</div>
|
||||
{{ if .SubTitle }}
|
||||
<div class="header-menu">
|
||||
<h2>{{.SubTitle}}</h2>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@@ -1 +0,0 @@
|
||||
<div>Default Public Facing Page</div>
|
1
templates/public-voting.html
Normal file
1
templates/public-voting.html
Normal file
@@ -0,0 +1 @@
|
||||
<h1>VOTING TIME</h1>
|
1
templates/public-waiting.html
Normal file
1
templates/public-waiting.html
Normal file
@@ -0,0 +1 @@
|
||||
<div>ICT Game Jam</div>
|
Reference in New Issue
Block a user