Files
cheesy-arena-lite/templates/setup_settings.html
2016-08-28 18:49:27 -07:00

306 lines
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{/*
Copyright 2014 Team 254. All Rights Reserved.
Author: pat@patfairbank.com (Patrick Fairbank)
UI for configuring event settings.
*/}}
{{define "title"}}Settings{{end}}
{{define "body"}}
<div class="row">
{{if .ErrorMessage}}
<div class="alert alert-dismissable alert-danger">
<button type="button" class="close" data-dismiss="alert">×</button>
{{.ErrorMessage}}
</div>
{{end}}
<div class="col-lg-6 col-lg-offset-1">
<div class="well">
<form class="form-horizontal" action="/setup/settings" method="POST">
<fieldset>
<legend>Event Settings</legend>
<div class="form-group">
<label class="col-lg-5 control-label">Name</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="name" value="{{.Name}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Code</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="code" value="{{.Code}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Display Background Color</label>
<div class="col-lg-7">
<div class="input-group" id="displayBackgroundColor">
<input type="text" class="form-control" name="displayBackgroundColor"
value="{{.DisplayBackgroundColor}}">
<span class="input-group-addon"><i></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Number of Alliances</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="numElimAlliances" value="{{.NumElimAlliances}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Round 2 Selection Order</label>
<div class="col-lg-7">
<div class="radio">
<label>
<input type="radio" name="selectionRound2Order" value="F"
{{if eq .SelectionRound2Order "F"}}checked{{end}}>
First to Last
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="selectionRound2Order" value="L"
{{if eq .SelectionRound2Order "L"}}checked{{end}}>
Last to First
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Round 3 Selection Order</label>
<div class="col-lg-7">
<div class="radio">
<label>
<input type="radio" name="selectionRound3Order" value="F"
{{if eq .SelectionRound3Order "F"}}checked{{end}}>
First to Last
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="selectionRound3Order" value="L"
{{if eq .SelectionRound3Order "L"}}checked{{end}}>
Last to First
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="selectionRound3Order" value=""
{{if eq .SelectionRound3Order ""}}checked{{end}}>
None
</label>
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Automatic Team Info Download</legend>
<div class="form-group">
<label class="col-lg-9 control-label">Enable Automatic Team Info Download (From TBA)</label>
<div class="col-lg-1 checkbox">
<input type="checkbox" name="TBADownloadEnabled"{{if .TBADownloadEnabled}} checked{{end}}>
</div>
</div>
</fieldset>
<fieldset>
<legend>Publishing</legend>
<p>Contact The Blue Alliance to obtain an event code and credentials.</p>
<div class="form-group">
<label class="col-lg-7 control-label">Enable The Blue Alliance publishing</label>
<div class="col-lg-1 checkbox">
<input type="checkbox" name="tbaPublishingEnabled"{{if .TbaPublishingEnabled}} checked{{end}}>
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">TBA Event Code</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="tbaEventCode" value="{{.TbaEventCode}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">TBA Auth ID</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="tbaSecretId" value="{{.TbaSecretId}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">TBA Secret</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="tbaSecret" value="{{.TbaSecret}}">
</div>
</div>
<p>Contact STEMtv to obtain an event code.</p>
<div class="form-group">
<label class="col-lg-7 control-label">Enable STEMtv publishing</label>
<div class="col-lg-1 checkbox">
<input type="checkbox" name="stemTvPublishingEnabled"{{if .StemTvPublishingEnabled}} checked{{end}}>
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">STEMtv Event Code</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="stemTvEventCode" value="{{.StemTvEventCode}}">
</div>
</div>
</fieldset>
<fieldset>
<legend>Authentication</legend>
<p>Configure passwords to enable HTTP Basic authentication, or leave blank to disable.</p>
<div class="form-group">
<label class="col-lg-5 control-label">Password for 'admin' user</label>
<div class="col-lg-7">
<input type="password" class="form-control" name="adminPassword" value="{{.AdminPassword}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Password for 'reader' user</label>
<div class="col-lg-7">
<input type="password" class="form-control" name="readerPassword" value="{{.ReaderPassword}}">
</div>
</div>
</fieldset>
<fieldset>
<legend>Networking</legend>
<p>Enable this setting if you have a Cisco Aironet AP1252AG access point and Catalyst 3500-series
switch available, for isolating each team to its own SSID and VLAN.</p>
<div class="form-group">
<label class="col-lg-7 control-label">Enable advanced network security</label>
<div class="col-lg-1 checkbox">
<input type="checkbox" name="networkSecurityEnabled"{{if .NetworkSecurityEnabled}} checked{{end}}>
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">AP Address</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="apAddress" value="{{.ApAddress}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">AP Username</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="apUsername" value="{{.ApUsername}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">AP Password</label>
<div class="col-lg-7">
<input type="password" class="form-control" name="apPassword" value="{{.ApPassword}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Switch Address</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="switchAddress" value="{{.SwitchAddress}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Switch Password</label>
<div class="col-lg-7">
<input type="password" class="form-control" name="switchPassword" value="{{.SwitchPassword}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-7 control-label">Enable bandwidth monitoring</label>
<div class="col-lg-1 checkbox">
<input type="checkbox" name="bandwidthMonitoringEnabled"{{if .BandwidthMonitoringEnabled}} checked{{end}}>
</div>
</div>
</fieldset>
<fieldset>
<legend>LED Controllers</legend>
<div class="form-group">
<label class="col-lg-5 control-label">Red defense address/port</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="redDefenseLightsAddress" value="{{.RedDefenseLightsAddress}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-5 control-label">Blue defense address/port</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="blueDefenseLightsAddress" value="{{.BlueDefenseLightsAddress}}">
</div>
</div>
</fieldset>
<fieldset>
<legend>2016 Game Rules</legend>
<div class="form-group">
<label class="col-lg-5 control-label">Initial tower strength</label>
<div class="col-lg-7">
<input type="text" class="form-control" name="initialTowerStrength" value="{{.InitialTowerStrength}}">
</div>
</div>
</fieldset>
<div class="form-group">
<div class="col-lg-7 col-lg-offset-5">
<button type="submit" class="btn btn-info">Save</button>
</div>
</div>
</form>
</div>
</div>
<div class="col-lg-4">
<div class="well">
<legend>Database</legend>
<p>
<a href="/setup/db/save"><button class="btn btn-info">Save Copy of Database</button></a>
</p>
<p>
<button type="button" class="btn btn-primary" onclick="$('#uploadDatabase').modal('show');">
Load Database from Backup
</button>
</p>
<p>
<button type="button" class="btn btn-primary" onclick="$('#confirmClearData').modal('show');">
Clear All Match Data
</button>
</p>
</div>
</div>
</div>
<div id="uploadDatabase" 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">Choose Backup File</h4>
</div>
<form class="form-horizontal" action="/setup/db/restore" enctype="multipart/form-data" method="POST">
<div class="modal-body">
<p>Select the database file to load from. <b>This will overwrite any existing data.</b></p>
<input type="file" name="databaseFile">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Load Database from Backup</button>
</div>
</form>
</div>
</div>
</div>
<div id="confirmClearData" 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 all match, ranking, and alliance selection data?</p>
</div>
<div class="modal-footer">
<form class="form-horizontal" action="/setup/db/clear" method="POST">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Clear All Match Data</button>
</form>
</div>
</div>
</div>
</div>
{{end}}
{{define "script"}}
<script>
$(function() {
$("#displayBackgroundColor").colorpicker();
});
</script>
{{end}}