Cleaned up HTML templates.

This commit is contained in:
Patrick Fairbank
2014-09-06 17:38:21 -07:00
parent 65d5602d9e
commit 1467c9e9cb
26 changed files with 122 additions and 12 deletions

132
templates/setup_teams.html Normal file
View File

@@ -0,0 +1,132 @@
{{/*
Copyright 2014 Team 254. All Rights Reserved.
Author: pat@patfairbank.com (Patrick Fairbank)
UI for configuring the team list for an event.
*/}}
{{define "title"}}Team List{{end}}
{{define "body"}}
{{if .ShowErrorMessage}}
<div class="alert alert-dismissable alert-danger">
<button type="button" class="close" data-dismiss="alert">×</button>
You can't modify the team list once the qualification schedule has been generated. If you need to change
the team list, clear all other data first on the Settings page.
</div>
{{end}}
<div class="row">
<div class="col-lg-2">
<form class="form-horizontal" action="/setup/teams" method="POST">
<fieldset>
<legend>Import Teams</legend>
<div class="form-group">
<textarea class="form-control" rows="10" name="teamNumbers"
placeholder="One team number per line"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-info">Add Teams</button>
</div>
<div class="form-group">
<button type="button" class="btn btn-primary" onclick="$('#confirmClearTeams').modal('show');">
Clear Team List
</button>
</div>
{{if .EventSettings.TbaPublishingEnabled}}
<div class="form-group">
<button type="button" class="btn btn-info" onclick="$('#confirmPublishTeams').modal('show');">
Publish Team List to TBA
</button>
</div>
{{end}}
{{if .EventSettings.NetworkSecurityEnabled}}
<div class="form-group">
<a href="/setup/teams/generate_wpa_keys?all=true" class="btn btn-primary">Generate All WPA Keys</a>
</div>
<div class="form-group">
<a href="/setup/teams/generate_wpa_keys?all=false" class="btn btn-primary">Generate Missing WPA Keys</a>
</div>
{{end}}
</fieldset>
</form>
</div>
<div class="col-lg-10">
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Nickname</th>
<th>Location</th>
<th>Rookie Year</th>
<th>Robot Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{{range $team := .Teams}}
<tr>
<td>{{$team.Id}}</td>
<td>{{$team.Name}}</td>
<td>{{$team.Nickname}}</td>
<td>{{$team.City}}, {{$team.StateProv}}, {{$team.Country}}</td>
<td>{{$team.RookieYear}}</td>
<td>{{$team.RobotName}}</td>
<td class="text-center nowrap">
<form action="/setup/teams/{{$team.Id}}/delete" method="POST">
<a href="/setup/teams/{{$team.Id}}/edit">
<button type="button" class="btn btn-info btn-xs">
<i class="glyphicon glyphicon-edit"></i>
</button>
</a>
<button type="submit" class="btn btn-primary btn-xs">
<i class="glyphicon glyphicon-trash"></i>
</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
<b>{{len .Teams}} teams</b>
</div>
</div>
<div id="confirmClearTeams" class="modal" style="top: 20%;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Confirm</h4>
</div>
<div class="modal-body">
<p>Are you sure you want to clear the team list?</p>
</div>
<div class="modal-footer">
<form class="form-horizontal" action="/setup/teams/clear" method="POST">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Clear Team List</button>
</form>
</div>
</div>
</div>
</div>
<div id="confirmPublishTeams" class="modal" style="top: 20%;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Confirm</h4>
</div>
<div class="modal-body">
<p>Are you sure you want to publish the team list to The Blue Alliance? This will overwrite any
existing team list data.</p>
</div>
<div class="modal-footer">
<form class="form-horizontal" action="/setup/teams/publish" method="POST">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Publish Team List</button>
</form>
</div>
</div>
</div>
</div>
{{end}}
{{define "script"}}{{end}}