Skip to content

Commit 6250fe1

Browse files
authored
Fix .locale.Tr function not found in delete modal (#23468)
Caught by @wxiaoguang in #23337 (comment). Additionally, there were three instances that have the same content as `templates/base/deletion_modal_actions.tmpl` but that are not intended to delete something. Instead of renaming the template above, these instances were simply re-hard-coded again. Renaming/improving the template above is left for future PRs.
1 parent f83246e commit 6250fe1

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

templates/admin/repo/unadopted.tmpl

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@
4343
<input type="hidden" name="action" value="adopt">
4444
<input type="hidden" name="q" value="{{$.Keyword}}">
4545
<input type="hidden" name="page" value="{{$.CurrentPage}}">
46-
{{template "base/delete_modal_actions" .}}
46+
<div class="actions">
47+
<button class="ui red basic inverted cancel button">
48+
{{svg "octicon-trash" 16 "gt-mr-2"}}
49+
{{$.locale.Tr "modal.no"}}
50+
</button>
51+
<button class="ui green basic inverted ok button">
52+
{{svg "octicon-check" 16 "gt-mr-2"}}
53+
{{$.locale.Tr "modal.yes"}}
54+
</button>
55+
</div>
4756
</form>
4857
</div>
4958
<button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button>
@@ -61,7 +70,16 @@
6170
<input type="hidden" name="action" value="delete">
6271
<input type="hidden" name="q" value="{{$.Keyword}}">
6372
<input type="hidden" name="page" value="{{$.CurrentPage}}">
64-
{{template "base/delete_modal_actions" .}}
73+
<div class="actions">
74+
<button class="ui red basic inverted cancel button">
75+
{{svg "octicon-trash" 16 "gt-mr-2"}}
76+
{{$.locale.Tr "modal.no"}}
77+
</button>
78+
<button class="ui green basic inverted ok button">
79+
{{svg "octicon-check" 16 "gt-mr-2"}}
80+
{{$.locale.Tr "modal.yes"}}
81+
</button>
82+
</div>
6583
</form>
6684
</div>
6785
</div>

templates/user/settings/repos.tmpl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@
5050
{{$.CsrfTokenHtml}}
5151
<input type="hidden" name="id" value="{{$dir}}">
5252
<input type="hidden" name="action" value="adopt">
53-
{{template "base/delete_modal_actions" .}}
53+
<div class="actions">
54+
<button class="ui red basic inverted cancel button">
55+
{{svg "octicon-x"}}
56+
{{$.locale.Tr "modal.no"}}
57+
</button>
58+
<button class="ui green basic inverted ok button">
59+
{{svg "octicon-check"}}
60+
{{$.locale.Tr "modal.yes"}}
61+
</button>
62+
</div>
5463
</form>
5564
</div>
5665
{{end}}
@@ -68,7 +77,7 @@
6877
{{$.CsrfTokenHtml}}
6978
<input type="hidden" name="id" value="{{$dir}}">
7079
<input type="hidden" name="action" value="delete">
71-
{{template "base/delete_modal_actions" .}}
80+
{{template "base/delete_modal_actions" $}}
7281
</form>
7382
</div>
7483
{{end}}

0 commit comments

Comments
 (0)