[MODERATION] Prepare moderation for context locale changes (squash)

- Resolves https://codeberg.org/forgejo/forgejo/issues/1711

(cherry picked from commit 2e289baea9)
(cherry picked from commit 07ecf49c05)
This commit is contained in:
Gusted 2023-11-01 20:47:40 +01:00 committed by Earl Warren
parent 94b6046c52
commit e06190b394
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
7 changed files with 15 additions and 15 deletions

View file

@ -7,11 +7,11 @@
<div class="ui left">
<div id="search-user-box" class="ui search">
<div class="ui input">
<input class="prompt" name="uname" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required>
<input class="prompt" name="uname" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required>
</div>
</div>
</div>
<button type="submit" class="ui red button">{{.locale.Tr "user.block"}}</button>
<button type="submit" class="ui red button">{{ctx.Locale.Tr "user.block"}}</button>
</form>
</div>
<div class="ui attached segment">

View file

@ -39,7 +39,7 @@
</details>
{{end}}
<a class="{{if .PageIsSettingsBlockedUsers}}active {{end}}item" href="{{.OrgLink}}/settings/blocked_users">
{{.locale.Tr "settings.blocked_users"}}
{{ctx.Locale.Tr "settings.blocked_users"}}
</a>
<a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete">
{{ctx.Locale.Tr "org.settings.delete"}}

View file

@ -9,20 +9,20 @@
{{template "shared/user/name" .}}
</div>
<div class="flex-item-body">
<span>{{$.locale.Tr "settings.blocked_since" (DateTime "short" .CreatedUnix) | Safe}}</span>
<span>{{ctx.Locale.Tr "settings.blocked_since" (DateTime "short" .CreatedUnix) | Safe}}</span>
</div>
</div>
<div class="flex-item-trailing">
<form action="{{$.Link}}/unblock" method="post">
{{$.CsrfTokenHtml}}
<input type="hidden" name="user_id" value="{{.ID}}">
<button class="ui red button">{{$.locale.Tr "user.unblock"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "user.unblock"}}</button>
</form>
</div>
</div>
{{else}}
<div class="flex-item">
<span class="text grey italic">{{$.locale.Tr "settings.blocked_users_none"}}</span>
<span class="text grey italic">{{ctx.Locale.Tr "settings.blocked_users_none"}}</span>
</div>
{{end}}
</div>

View file

@ -120,12 +120,12 @@
<li class="block">
{{if $.IsBlocked}}
<button class="ui basic red button link-action" data-url="{{.ContextUser.HomeLink}}?action=unblock&redirect_to={{$.Link}}">
{{svg "octicon-person"}} {{.locale.Tr "user.unblock"}}
{{svg "octicon-person"}} {{ctx.Locale.Tr "user.unblock"}}
</button>
{{else}}
<button type="submit" class="ui basic orange button delete-button"
data-modal-id="block-user" data-url="{{.ContextUser.HomeLink}}?action=block">
{{svg "octicon-blocked"}} {{.locale.Tr "user.block"}}
{{svg "octicon-blocked"}} {{ctx.Locale.Tr "user.block"}}
</button>
{{end}}
</li>

View file

@ -43,14 +43,14 @@
<div class="ui g-modal-confirm delete modal" id="block-user">
<div class="header">
{{$.locale.Tr "user.block_user"}}
{{ctx.Locale.Tr "user.block_user"}}
</div>
<div class="content">
<p>{{$.locale.Tr "user.block_user.detail"}}</p>
<p>{{ctx.Locale.Tr "user.block_user.detail"}}</p>
<ul>
<li>{{$.locale.Tr "user.block_user.detail_1"}}</li>
<li>{{$.locale.Tr "user.block_user.detail_2"}}</li>
<li>{{$.locale.Tr "user.block_user.detail_3"}}</li>
<li>{{ctx.Locale.Tr "user.block_user.detail_1"}}</li>
<li>{{ctx.Locale.Tr "user.block_user.detail_2"}}</li>
<li>{{ctx.Locale.Tr "user.block_user.detail_3"}}</li>
</ul>
</div>
{{template "base/modal_actions_confirm" .}}

View file

@ -1,7 +1,7 @@
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings blocked-users")}}
<div class="user-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "settings.blocked_users"}}
{{ctx.Locale.Tr "settings.blocked_users"}}
</h4>
<div class="ui attached segment">
{{template "shared/blocked_users_list" .}}

View file

@ -52,7 +52,7 @@
{{ctx.Locale.Tr "settings.repos"}}
</a>
<a class="{{if .PageIsBlockedUsers}}active {{end}}item" href="{{AppSubUrl}}/user/settings/blocked_users">
{{.locale.Tr "settings.blocked_users"}}
{{ctx.Locale.Tr "settings.blocked_users"}}
</a>
</div>
</div>