159 lines
7.0 KiB
Cheetah
159 lines
7.0 KiB
Cheetah
{{define "content"}}
|
|
<div class="content">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4 class="card-title">Settings</h4>
|
|
{{if .empty}}
|
|
<p class="card-category">Select a server to manage below</p>
|
|
{{end}}
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="post">
|
|
<div class="row">
|
|
<div class="col-md-5 pr-1">
|
|
<div class="form-group">
|
|
<label>Prefix (Max len. 8)</label>
|
|
<input name="prefix" type="text" class="form-control" placeholder="t!" value="{{.prefix}}">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-5 px-1">
|
|
<div class="form-group">
|
|
<label>Ticket Limit (1-10)</label>
|
|
<input name="ticketlimit" type="text" class="form-control" placeholder="5" value="{{.ticketLimit}}">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2 px-1">
|
|
<div class="form-group">
|
|
<label>Ping @everyone on ticket open</label>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="pingeveryone" value="on" {{if .pingEveryone}}checked{{end}} style="width:30px;height:30px;">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<label>Welcome Message (Max len. 1000)</label>
|
|
<textarea name="welcomeMessage" class="form-control" rows="3" style="resize: none">{{.welcomeMessage}}</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-5 pr-1">
|
|
<label>Archive Channel</label>
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<div class="input-group-text">#</div>
|
|
</div>
|
|
<select class="form-control" name="archivechannel">
|
|
{{range .channels}}
|
|
<option {{if eq .Id $.archivechannel }}selected{{end}} value="{{.Id}}">{{.Name}}</option>
|
|
{{end}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-5 px-1">
|
|
<div class="form-group">
|
|
<label>Channel Category</label>
|
|
<select class="form-control" name="category">
|
|
{{range .categories}}
|
|
<option {{if eq $.activecategory .Id}}selected{{end}} value="{{.Id}}">{{.Name}}</option>
|
|
{{end}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2 px-1">
|
|
<div class="form-group">
|
|
<label>Allow users to close tickets</label>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="userscanclose" value="on" {{if .usersCanClose}}checked{{end}} style="width:30px;height:30px;">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<label>Ticket Naming Scheme</label>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="namingscheme" id="naming-by-id" value="id" {{if eq .namingScheme "id"}}checked{{end}}>
|
|
<label class="form-check-label" for="naming-by-id">
|
|
Ticket ID
|
|
</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="namingscheme" id="naming-by-username" value="username" {{if eq .namingScheme "username"}}checked{{end}}>
|
|
<label class="form-check-label" for="naming-by-username">
|
|
Username
|
|
</label>
|
|
</div>
|
|
|
|
<input name="csrf" type="hidden" value="{{.csrf}}">
|
|
<div class="row">
|
|
<div class="col-md-1 pr-1">
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary"><i class="fas fa-paper-plane"></i> Submit</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div aria-live="polite" aria-atomic="true" style="position: relative; min-height: 200px;">
|
|
<div style="position: absolute; right: 10px; min-width: 300px">
|
|
{{if .invalidPrefix}}
|
|
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="false">
|
|
<div class="toast-header">
|
|
<strong class="mr-auto">Warning</strong>
|
|
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="toast-body">
|
|
The prefix you specified was invalid
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{if .invalidWelcomeMessage}}
|
|
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="false">
|
|
<div class="toast-header">
|
|
<strong class="mr-auto">Warning</strong>
|
|
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="toast-body">
|
|
The welcome message you specified was invalid
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{if .invalidTicketLimit}}
|
|
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="false">
|
|
<div class="toast-header">
|
|
<strong class="mr-auto">Warning</strong>
|
|
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="toast-body">
|
|
The ticket limit you specified was invalid
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$('.toast').toast('show');
|
|
$('#pingeveryone').prop('indeterminate', {{.pingEveryone}});
|
|
</script>
|
|
</div>
|
|
{{end}} |