edit colour selector

This commit is contained in:
Dot-Rar 2020-03-31 17:41:03 +01:00
parent 1f843dfb8e
commit d9e42a5553
5 changed files with 23 additions and 13 deletions

View File

@ -91,7 +91,7 @@ func PanelCreateHandler(ctx *gin.Context) {
// Validate colour
validColour := true
panelColourHex := ctx.PostForm("colour")
panelColourHex := strings.Replace(ctx.PostForm("colour"), "#", "", -1)
panelColour, err := strconv.ParseUint(panelColourHex, 16, 32)
if err != nil {
validColour = false

View File

@ -32,3 +32,8 @@ body {
text-align: right;
padding-bottom: 10px;
}
.input-fill {
margin: 0 !important;
padding: 0 !important;
}

View File

@ -45,4 +45,12 @@
<!-- Icons -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<!-- GA -->
<script type="80be96f83bbfbba3d4097e23-text/javascript">
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-161945537-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js' type="80be96f83bbfbba3d4097e23-text/javascript"></script>
{{end}}

View File

@ -15,7 +15,7 @@
<a class="nav-link" href="/manage/{{.guildId}}/tickets">Ticket List</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/manage/{{.guildId}}/panels">Panels</a>
<a class="nav-link" href="/manage/{{.guildId}}/panels">Reaction Panels</a>
</li>
</ul>
</div>

View File

@ -5,7 +5,7 @@
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h4 class="card-title">Panels</h4>
<h4 class="card-title">Reaction Panels</h4>
</div>
<div class="card-body">
<p>Your panel quota: <b>{{.panelcount}} / {{if .premium}}∞{{else}}1{{end}}</b></p>
@ -47,13 +47,13 @@
<div class="row">
<div class="col-md-4 pr-1">
<div class="form-group">
<label>Panel Title</label>
<label class="black">Panel Title</label>
<input name="title" type="text" class="form-control" placeholder="Open a ticket!">
</div>
</div>
<div class="col-md-8 pr-1">
<div class="form-group">
<label>Panel Content</label>
<label class="black">Panel Content</label>
<textarea name="content" type="text" class="form-control"
placeholder="By reacting to this ticket, a ticket will be opened for you."></textarea>
</div>
@ -61,17 +61,14 @@
</div>
<div class="row">
<div class="col-md-3 pr-1">
<label>Panel Colour (Hex)</label>
<label class="black">Panel Colour</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">#</div>
</div>
<input name="colour" type="text" class="form-control" placeholder="23A31A">
<input name="colour" type="color" class="form-control input-fill" value="#23A31A">
</div>
</div>
<div class="col-md-3 pr-1">
<label>Panel Channel</label>
<label class="black">Panel Channel</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">#</div>
@ -85,7 +82,7 @@
</div>
<div class="col-md-3 pr-1">
<label>Ticket Channel Category</label>
<label class="black">Ticket Channel Category</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">#</div>
@ -100,7 +97,7 @@
<div class="col-md-3 pr-1">
<div class="form-group">
<label>Reaction Emote</label>
<label class="black">Reaction Emote</label>
<input name="reaction" type="text" class="form-control" placeholder="envelope_with_arrow">
</div>
</div>