ictgj-voting/templates/admin-editteam.html

91 lines
3.3 KiB
HTML
Raw Normal View History

2017-06-12 23:23:46 +00:00
{{ $uuid := .TemplateData.UUID }}
2017-04-21 18:17:18 +00:00
<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>
2017-06-08 20:43:11 +00:00
<input id="teamname" name="teamname" value="{{ .TemplateData.Name }}" placeholder="Team Name">
2017-04-21 18:17:18 +00:00
</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>
2017-06-08 20:43:11 +00:00
<h2>Members</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Slack ID</th>
<th>Twitter</th>
<th>Email</th>
2017-06-12 23:23:46 +00:00
<th>Edit</th>
<th>Remove</th>
2017-06-08 20:43:11 +00:00
</tr>
</thead>
<tbody>
{{ range $i, $v := .TemplateData.Members }}
<tr>
<td>{{ $v.Name }}</td>
2017-06-12 23:23:46 +00:00
<td>{{ $v.SlackId }}</td>
2017-06-08 20:43:11 +00:00
<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>
2017-06-12 23:23:46 +00:00
</td>
<td>
<form action="/admin/teams/{{ $uuid }}/deletemember" method="POST">
<input type="hidden" name="memberid" value="{{ $v.UUID }}"/>
<button type="submit" class="pure-button pure-button-plain"><i class="fa fa-trash"></i></button>
</form>
2017-06-08 20:43:11 +00:00
</td>
</tr>
{{ end }}
<tr>
2017-06-12 23:23:46 +00:00
<td colspan="6" class="center">Add a new member</td>
2017-06-08 20:43:11 +00:00
</tr>
<tr>
2017-06-12 23:23:46 +00:00
<td colspan="6">
<form action="/admin/teams/{{ $uuid }}/savemember" method="POST">
<input id="newmembername" name="newmembername" value="" placeholder="Member Name" />
<input id="newmemberslackid" name="newmemberslackid" value="" placeholder="@SlackID" />
<input id="newmembertwitter" name="newmembertwitter" value="" placeholder="@Twitter" />
<input id="newmemberemail" name="newmemberemail" value="" placeholder="user@email.com" />
<button type="submit" class="pull-right space pure-button pure-button-primary">Add</button>
</form>
</td>
2017-06-08 20:43:11 +00:00
</tr>
</tbody>
</table>
2017-04-21 18:17:18 +00:00
</div>
<script>
snack.listener(
{node:document.getElementById('btnDeleteTeam'),event:'click'},
function() {
showModal({
title: 'Delete Team',
2017-06-12 23:23:46 +00:00
subtitle: '({{ .TemplateData.Name }} - {{ $uuid}})',
2017-04-21 18:17:18 +00:00
body: 'Are you sure? This cannot be undone.',
buttons: [{
title:'Cancel',
position:'left',
click: hideModal
},{
title:'Delete',
position:'right',
class: 'pure-button-error',
2017-06-12 23:23:46 +00:00
href: '/admin/teams/{{ $uuid }}/delete'
2017-04-21 18:17:18 +00:00
}]
});
}
);
</script>