close tickets from web ui
This commit is contained in:
parent
f644682a17
commit
73c103a391
@ -70,7 +70,13 @@ func TicketCloseHandler(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
go cache.Client.PublishTicketClose(ticket.Uuid, userId, "") // TODO: Add option for reason
|
||||
// Get the reason
|
||||
reason := ctx.PostForm("reason")
|
||||
if len(reason) > 255 {
|
||||
reason = reason[:255]
|
||||
}
|
||||
|
||||
go cache.Client.PublishTicketClose(ticket.Uuid, userId, reason)
|
||||
|
||||
ctx.Redirect(302, fmt.Sprintf("/manage/%d/tickets", guildId))
|
||||
} else {
|
||||
|
@ -123,6 +123,7 @@ func TicketViewHandler(ctx *gin.Context) {
|
||||
"error": errorMessage,
|
||||
"messages": messagesFormatted,
|
||||
"ticketId": ticket.TicketId,
|
||||
"uuid": ticket.Uuid,
|
||||
"include_mock": true,
|
||||
"premium": <-premium,
|
||||
})
|
||||
|
@ -27,3 +27,8 @@ body {
|
||||
.table td, .table th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.close-container {
|
||||
text-align: right;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
@ -5,6 +5,18 @@
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Close Ticket</h4>
|
||||
<div class="close-container">
|
||||
<form class="form-inline" action="/manage/{{.guildId}}/tickets/view/{{.uuid}}/close" method="post">
|
||||
<input type="text" class="form-control" id="reason" name="reason" placeholder="No reason specified" style="width: 80%">
|
||||
<input name="csrf" type="hidden" value="{{.csrf}}">
|
||||
<div style="padding-left: 10px">
|
||||
<button type="submit" class="btn btn-primary">Close Ticket</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="card-title">View Ticket</h4>
|
||||
<div class="discord-container">
|
||||
<div class="channel-header">
|
||||
<span class="channel-name">#ticket-{{.ticketId}}</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user