mirror of
1
Fork 0

[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 class="ui left">
<div id="search-user-box" class="ui search"> <div id="search-user-box" class="ui search">
<div class="ui input"> <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> </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> </form>
</div> </div>
<div class="ui attached segment"> <div class="ui attached segment">

View File

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

View File

@ -9,20 +9,20 @@
{{template "shared/user/name" .}} {{template "shared/user/name" .}}
</div> </div>
<div class="flex-item-body"> <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> </div>
<div class="flex-item-trailing"> <div class="flex-item-trailing">
<form action="{{$.Link}}/unblock" method="post"> <form action="{{$.Link}}/unblock" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<input type="hidden" name="user_id" value="{{.ID}}"> <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> </form>
</div> </div>
</div> </div>
{{else}} {{else}}
<div class="flex-item"> <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> </div>
{{end}} {{end}}
</div> </div>

View File

@ -120,12 +120,12 @@
<li class="block"> <li class="block">
{{if $.IsBlocked}} {{if $.IsBlocked}}
<button class="ui basic red button link-action" data-url="{{.ContextUser.HomeLink}}?action=unblock&redirect_to={{$.Link}}"> <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> </button>
{{else}} {{else}}
<button type="submit" class="ui basic orange button delete-button" <button type="submit" class="ui basic orange button delete-button"
data-modal-id="block-user" data-url="{{.ContextUser.HomeLink}}?action=block"> 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> </button>
{{end}} {{end}}
</li> </li>

View File

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

View File

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

View File

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