subsitutions

This commit is contained in:
rxdn 2020-06-16 17:09:09 +01:00
parent 0288628629
commit 0a274ac0c4
6 changed files with 57 additions and 3 deletions

View File

@ -166,6 +166,7 @@ func addManageTemplate(renderer multitemplate.Renderer, name string) multitempla
"./public/templates/includes/head.tmpl", "./public/templates/includes/head.tmpl",
"./public/templates/includes/sidebar.tmpl", "./public/templates/includes/sidebar.tmpl",
"./public/templates/includes/navbar.tmpl", "./public/templates/includes/navbar.tmpl",
"./public/templates/includes/substitutionmodal.tmpl",
fmt.Sprintf("./public/templates/views/%s.tmpl", name), fmt.Sprintf("./public/templates/views/%s.tmpl", name),
) )
return renderer return renderer

View File

@ -121,3 +121,16 @@ body {
max-width: 300px; max-width: 300px;
word-wrap: break-word; word-wrap: break-word;
} }
.pointer {
cursor: pointer;
}
.modal-content {
color: white !important;
background-color: #272727 !important;
}
.modal-footer, .modal-header {
border-color: #2e3136 !important;
}

View File

@ -0,0 +1,34 @@
{{define "substitutions"}}
<div class="modal fade" id="modal-substitutions" tabindex="-1" role="dialog" aria-labelledby="modal-substitutions" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><b>Variables</b></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<code>%user%</code> - Mention the user
<br>
<code>%username%</code> - The user's name
<br>
<code>%ticket_id%</code> - The ticket's numeric ID
<br>
<code>%open_tickets%</code> - The amount of open tickets the server has
<br>
<code>%total_tickets%</code> - The amount of tickets that have ever been opened in the server
<br>
<code>%user_open_tickets%</code> - The amount of open tickets the user has in the server
<br>
<code>%ticket_limit%</code> - The per user ticket limit
<br>
<code>%channel%</code> - Mention the channel
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-fill" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{{end}}

View File

@ -1,10 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
{{template "substitutions" .}} <!-- Has to be here for some reason -->
<div class="main-panel" style="width: 100% !important;"> <div class="main-panel" style="width: 100% !important;">
{{template "navbar" .}} {{template "navbar" .}}
{{template "content" .}} {{template "content" .}}

View File

@ -99,7 +99,9 @@
<div class="collapse" id="advanced" style="width: 100%"> <div class="collapse" id="advanced" style="width: 100%">
<div class="col-md-6 pr-1"> <div class="col-md-6 pr-1">
<div class="form-group"> <div class="form-group">
<label class="black">Welcome Message</label> <label class="black">Welcome Message
<i class="fas fa-question pointer" data-toggle="modal" data-target="#modal-substitutions"></i>
</label>
<textarea type="text" class="form-control" placeholder="If not provided, your server's default welcome message will be used" id="welcome_message"></textarea> <textarea type="text" class="form-control" placeholder="If not provided, your server's default welcome message will be used" id="welcome_message"></textarea>
</div> </div>
</div> </div>
@ -266,4 +268,5 @@
loadData(); loadData();
</script> </script>
</div> </div>
{{end}} {{end}}

View File

@ -77,7 +77,9 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<label>Welcome Message (Max len. 1000)</label> <label>Welcome Message (Max len. 1000)
<i class="fas fa-question pointer" data-toggle="modal" data-target="#modal-substitutions"></i>
</label>
<textarea name="welcomeMessage" class="form-control" rows="3" id="welcome_message"></textarea> <textarea name="welcomeMessage" class="form-control" rows="3" id="welcome_message"></textarea>
</div> </div>
</div> </div>