ictgj-voting/templates/admin-editteam.html

85 lines
3.1 KiB
HTML

<div class="center">
<form class="pure-form pure-form-aligned" action="/admin/teams/{{ .TemplateData.UUID }}/save" method="POST">
<fieldset>
<div class="pure-control-group">
<span>{{ .TemplateData.Name }}</span>
</div>
<div class="pure-control-group">
<label class="control-label" for="teamname">Team Name</label>
<input id="teamname" name="teamname" value="{{ .TemplateData.Name }}" placeholder="Team Name">
</div>
<div class="pure-control-group reset-pull">
<a href="/admin/teams" class="pull-left space pure-button pure-button-plain">Cancel</a>
<button type="submit" class="pull-right space pure-button pure-button-primary">Update</button>
<button type="button" id="btnDeleteUser" class="pull-right space pure-button pure-button-error">Delete</button>
</div>
</fieldset>
</form>
<h2>Members</h2>
<form class="pure-form pure-form-aligned" action="/admin/teams/{{ .TemplateData.UUID }}/savemember" method="POST">
<fieldset>
<table>
<thead>
<tr>
<th>Name</th>
<th>Slack ID</th>
<th>Twitter</th>
<th>Email</th>
<th></th>
</tr>
</thead>
<tbody>
{{ range $i, $v := .TemplateData.Members }}
<tr>
<td>{{ $v.Name }}</td>
<td>{{ $v.SlackID }}</td>
<td>{{ $v.Twitter }}</td>
<td>{{ $v.Email }}</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>
</td>
</tr>
{{ end }}
<tr>
<td colspan="5" class="center">Add a new member</td>
</tr>
<tr>
<td><input id="newmembername" name="newmembername" value="" placeholder="Member Name" /></td>
<td><input id="newmemberslackid" name="newmemberslackid" value="" placeholder="@SlackID" /></td>
<td><input id="newmembertwitter" name="newmembertwitter" value="" placeholder="@Twitter" /></td>
<td><input id="newmemberemail" name="newmemberemail" value="" placeholder="user@email.com" /></td>
<td><button type="submit" class="pull-right space pure-button pure-button-primary">Add</button></td>
</tr>
</tbody>
</table>
</fieldset>
</form>
</div>
<script>
snack.listener(
{node:document.getElementById('btnDeleteTeam'),event:'click'},
function() {
showModal({
title: 'Delete Team',
subtitle: '({{ .TemplateData.Name }} - {{ .TemplateData.UUID }})',
body: 'Are you sure? This cannot be undone.',
buttons: [{
title:'Cancel',
position:'left',
click: hideModal
},{
title:'Delete',
position:'right',
class: 'pure-button-error',
href: '/admin/teams/{{ .TemplateData.UUID }}/delete'
}]
});
}
);
</script>