Skip to content

Commit

Permalink
fix(style): improve formatting for bulk removal
Browse files Browse the repository at this point in the history
  • Loading branch information
vednoc committed Oct 18, 2023
1 parent 33af62c commit b3ed283
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions handlers/style/bulkban.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func BulkBanPost(c *fiber.Ctx) error {
for index, style := range styles {
event, err := BanStyle(tx, style, u, user, c)
if err != nil {
log.Database.Printf("Failed to remove %d: %s\n", style.ID, err)
return err
}

Expand Down
2 changes: 1 addition & 1 deletion web/views/email/regardsmod.text.tmpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Regards,
The <a target="_blank" clicktracking="off" href="https://userstyles.world/">UserStyles.world</a> Moderation Team
The UserStyles.world Moderation Team
15 changes: 5 additions & 10 deletions web/views/email/style/bulkban.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
{{ .Log.Reason }}
</p>

<p>
Styles that were removed:
<ul>
{{ range .Styles -}}
<li>
{{ .Name }}
</li>
{{ end }}
</ul>
</p>
<p>Styles that were removed:</p>

<ul>
{{ range .Styles -}}<li>{{ .Name }}</li>{{ end }}
</ul>

{{ with .Log.Message -}}
<p>Additional message from the moderator:<br> {{ . }}</p>
Expand Down
10 changes: 7 additions & 3 deletions web/views/email/style/bulkban.text.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ Some of your styles have been removed from our platform for the following reason
{{ .Log.Reason }}

Styles that were removed:

{{ range .Styles -}}
- {{ .Name }}
{{ end }}
{{- printf "- %s\n" .Name -}}
{{ end -}}

{{ with .Log.Message }} Additional message from the moderator: {{ . }}{{ end }}
{{ with .Log.Message }}
Additional message from the moderator:
{{ . }}
{{ end }}

{{ template "email/actionrecorded.text" . }}

Expand Down
11 changes: 7 additions & 4 deletions web/views/style/bulkban.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
</section>

<style>
.tnum { font-feature-settings: 'tnum' 1 }
.tnum {
width: 100%;
font-feature-settings: 'tnum' 1;
}
</style>

<section class="limit">
Expand All @@ -24,9 +27,9 @@
<label for="reason" class="mt:m">Reason for ban</label>
<i class="fg:3">Be aware that this reason will be made public alongside this action.</i>
<input
required
type="text" name="reason"
placeholder="Your reason to ban these styles">
required
type="text" name="reason"
placeholder="Your reason to ban these styles">

<label for="message">Private message for the author</label>
<i class="fg:3">For example, a hint about was done wrong and what can be done now. Will be included in the email.</i>
Expand Down

0 comments on commit b3ed283

Please sign in to comment.