Skip to content

Commit e24f651

Browse files
authored
Add template linting via djlint (#25212)
So I found this [linter](https://github.com/Riverside-Healthcare/djlint) which features a mode for go templates, so I gave it a try and it did find a number of valid issue, like unbalanced tags etc. It also has a number of bugs, I had to disable/workaround many issues. Given that this linter is written in python, this does add a dependency on `python` >= 3.8 and `poetry` to the development environment to be able to run this linter locally. - `e.g.` prefixes on placeholders are removed because the linter had a false-positive on `placeholder="e.g. cn=Search"` for the `attr=value` syntax and it's not ideal anyways to write `e.g.` into a placeholder because a placeholder is meant to hold a sample value. - In `templates/repo/settings/options.tmpl` I simplified the logic to not conditionally create opening tags without closing tags because this stuff confuses the linter (and possibly the reader as well).
1 parent a0eaf08 commit e24f651

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+520
-171
lines changed

.github/workflows/files-changed.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
actions:
1616
description: "whether actions files changed"
1717
value: ${{ jobs.detect.outputs.actions }}
18+
templates:
19+
description: "whether templates files changed"
20+
value: ${{ jobs.detect.outputs.templates }}
1821

1922
jobs:
2023
detect:
@@ -27,6 +30,7 @@ jobs:
2730
frontend: ${{ steps.changes.outputs.frontend }}
2831
docs: ${{ steps.changes.outputs.docs }}
2932
actions: ${{ steps.changes.outputs.actions }}
33+
templates: ${{ steps.changes.outputs.templates }}
3034
steps:
3135
- uses: actions/checkout@v3
3236
- uses: dorny/paths-filter@v2
@@ -35,7 +39,7 @@ jobs:
3539
filters: |
3640
backend:
3741
- "**/*.go"
38-
- "**/*.tmpl"
42+
- "templates/**/*.tmpl"
3943
- "go.mod"
4044
- "go.sum"
4145
@@ -51,3 +55,6 @@ jobs:
5155
5256
actions:
5357
- ".github/workflows/*"
58+
59+
templates:
60+
- "templates/**/*.tmpl"

.github/workflows/pull-compliance.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ jobs:
2626
env:
2727
TAGS: bindata sqlite sqlite_unlock_notify
2828

29+
lint-templates:
30+
if: needs.files-changed.outputs.templates == 'true'
31+
needs: files-changed
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-python@v4
36+
with:
37+
python-version: "3.11"
38+
- run: pip install poetry
39+
- run: make deps-py
40+
- run: make lint-templates
41+
2942
lint-go-windows:
3043
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
3144
needs: files-changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ cpu.out
7070
/tests/*.ini
7171
/tests/**/*.git/**/*.sample
7272
/node_modules
73+
/.venv
7374
/yarn.lock
7475
/yarn-error.log
7576
/npm-debug.log*

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ help:
198198
@echo " - deps-frontend install frontend dependencies"
199199
@echo " - deps-backend install backend dependencies"
200200
@echo " - deps-tools install tool dependencies"
201+
@echo " - deps-py install python dependencies"
201202
@echo " - lint lint everything"
202203
@echo " - lint-fix lint everything and fix issues"
203204
@echo " - lint-actions lint action workflow files"
@@ -214,6 +215,7 @@ help:
214215
@echo " - lint-css-fix lint css files and fix issues"
215216
@echo " - lint-md lint markdown files"
216217
@echo " - lint-swagger lint swagger files"
218+
@echo " - lint-templates lint template files"
217219
@echo " - checks run various consistency checks"
218220
@echo " - checks-frontend check frontend files"
219221
@echo " - checks-backend check backend files"
@@ -417,6 +419,10 @@ lint-editorconfig:
417419
lint-actions:
418420
$(GO) run $(ACTIONLINT_PACKAGE)
419421

422+
.PHONY: lint-templates
423+
lint-templates: .venv
424+
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')
425+
420426
.PHONY: watch
421427
watch:
422428
@bash build/watch.sh
@@ -893,7 +899,10 @@ deps-docs:
893899
fi
894900

895901
.PHONY: deps
896-
deps: deps-frontend deps-backend deps-tools deps-docs
902+
deps: deps-frontend deps-backend deps-tools deps-docs deps-py
903+
904+
.PHONY: deps-py
905+
deps-py: .venv
897906

898907
.PHONY: deps-frontend
899908
deps-frontend: node_modules
@@ -920,6 +929,10 @@ node_modules: package-lock.json
920929
npm install --no-save
921930
@touch node_modules
922931

932+
.venv: poetry.lock
933+
poetry install
934+
@touch .venv
935+
923936
.PHONY: npm-update
924937
npm-update: node-check | node_modules
925938
npx updates -cu

docs/content/doc/development/hacking-on-gitea.en-us.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Gitea uses `gofmt` to format source code. However, the results of
4848
recommended to install the version of Go that our continuous integration is
4949
running. As of last update, the Go version should be {{< go-version >}}.
5050

51+
To lint the template files, ensure [Python](https://www.python.org/) and
52+
[Poetry](https://python-poetry.org/) are installed.
53+
5154
## Installing Make
5255

5356
Gitea makes heavy use of Make to automate tasks and improve development. This

poetry.lock

Lines changed: 331 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

poetry.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[virtualenvs]
2+
in-project = true
3+
no-pip = true
4+
no-setuptools = true

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[tool.poetry]
2+
name = "gitea"
3+
version = "0.0.0"
4+
description = ""
5+
authors = []
6+
7+
[tool.poetry.dependencies]
8+
python = "^3.8"
9+
10+
[tool.poetry.group.dev.dependencies]
11+
djlint = "1.31.0"
12+
13+
[tool.djlint]
14+
profile="golang"
15+
ignore="H005,H006,H008,H013,H014,H016,H020,H021,H023,H026,H030,H031,T027"
16+
17+
[build-system]
18+
requires = ["poetry-core"]
19+
build-backend = "poetry.core.masonry.api"

templates/admin/auth/edit.tmpl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
</div>
3737
<div class="required field">
3838
<label for="host">{{.locale.Tr "admin.auths.host"}}</label>
39-
<input id="host" name="host" value="{{$cfg.Host}}" placeholder="e.g. mydomain.com" required>
39+
<input id="host" name="host" value="{{$cfg.Host}}" placeholder="mydomain.com" required>
4040
</div>
4141
<div class="required field">
4242
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
43-
<input id="port" name="port" value="{{$cfg.Port}}" placeholder="e.g. 636" required>
43+
<input id="port" name="port" value="{{$cfg.Port}}" placeholder="636" required>
4444
</div>
4545
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
4646
<div class="ui checkbox">
@@ -51,7 +51,7 @@
5151
{{if .Source.IsLDAP}}
5252
<div class="field">
5353
<label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label>
54-
<input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
54+
<input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="cn=Search,dc=mydomain,dc=com">
5555
</div>
5656
<div class="field">
5757
<label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label>
@@ -60,17 +60,17 @@
6060
{{end}}
6161
<div class="{{if .Source.IsLDAP}}required{{end}} field">
6262
<label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label>
63-
<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
63+
<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
6464
</div>
6565
{{if .Source.IsDLDAP}}
6666
<div class="required field">
6767
<label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label>
68-
<input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com" required>
68+
<input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com" required>
6969
</div>
7070
{{end}}
7171
<div class="required field">
7272
<label for="filter">{{.locale.Tr "admin.auths.filter"}}</label>
73-
<input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="e.g. (&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" required>
73+
<input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" required>
7474
</div>
7575
<div class="field">
7676
<label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label>
@@ -95,15 +95,15 @@
9595
</div>
9696
<div class="required field">
9797
<label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label>
98-
<input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="e.g. mail" required>
98+
<input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="mail" required>
9999
</div>
100100
<div class="field">
101101
<label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
102-
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="e.g. SshPublicKey">
102+
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="SshPublicKey">
103103
</div>
104104
<div class="field">
105105
<label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label>
106-
<input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="e.g. jpegPhoto">
106+
<input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="jpegPhoto">
107107
</div>
108108

109109

@@ -117,23 +117,23 @@
117117
<div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}gt-hidden{{end}}">
118118
<div class="field">
119119
<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
120-
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
120+
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="ou=group,dc=mydomain,dc=com">
121121
</div>
122122
<div class="field">
123123
<label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label>
124-
<input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="e.g. memberUid">
124+
<input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="memberUid">
125125
</div>
126126
<div class="field">
127127
<label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label>
128-
<input name="user_uid" value="{{$cfg.UserUID}}" placeholder="e.g. uid">
128+
<input name="user_uid" value="{{$cfg.UserUID}}" placeholder="uid">
129129
</div>
130130
<div class="field">
131131
<label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label>
132-
<input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
132+
<input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
133133
</div>
134134
<div class="field">
135135
<label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
136-
<textarea name="group_team_map" rows="5" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
136+
<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
137137
</div>
138138
<div class="ui checkbox">
139139
<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
@@ -360,7 +360,7 @@
360360
</div>
361361
<div class="field">
362362
<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
363-
<textarea name="oauth2_group_team_map" rows="5" placeholder='e.g. {"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
363+
<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
364364
</div>
365365
<div class="ui checkbox">
366366
<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>

templates/admin/auth/source/ldap.tmpl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
</div>
1515
<div class="required field">
1616
<label for="host">{{.locale.Tr "admin.auths.host"}}</label>
17-
<input id="host" name="host" value="{{.host}}" placeholder="e.g. mydomain.com">
17+
<input id="host" name="host" value="{{.host}}" placeholder="mydomain.com">
1818
</div>
1919
<div class="required field">
2020
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
21-
<input id="port" name="port" value="{{.port}}" placeholder="e.g. 636">
21+
<input id="port" name="port" value="{{.port}}" placeholder="636">
2222
</div>
2323
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
2424
<div class="ui checkbox">
@@ -28,23 +28,23 @@
2828
</div>
2929
<div class="ldap field {{if not (eq .type 2)}}gt-hidden{{end}}">
3030
<label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label>
31-
<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
31+
<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="cn=Search,dc=mydomain,dc=com">
3232
</div>
3333
<div class="ldap field {{if not (eq .type 2)}}gt-hidden{{end}}">
3434
<label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label>
3535
<input id="bind_password" name="bind_password" type="password" autocomplete="off" value="{{.bind_password}}">
3636
</div>
3737
<div class="binddnrequired {{if (eq .type 2)}}required{{end}} field">
3838
<label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label>
39-
<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com">
39+
<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="ou=Users,dc=mydomain,dc=com">
4040
</div>
4141
<div class="dldap required field {{if not (eq .type 5)}}gt-hidden{{end}}">
4242
<label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label>
43-
<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com">
43+
<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com">
4444
</div>
4545
<div class="required field">
4646
<label for="filter">{{.locale.Tr "admin.auths.filter"}}</label>
47-
<input id="filter" name="filter" value="{{.filter}}" placeholder="e.g. (&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))">
47+
<input id="filter" name="filter" value="{{.filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))">
4848
</div>
4949
<div class="field">
5050
<label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label>
@@ -69,15 +69,15 @@
6969
</div>
7070
<div class="required field">
7171
<label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label>
72-
<input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="e.g. mail">
72+
<input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="mail">
7373
</div>
7474
<div class="field">
7575
<label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
76-
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="e.g. SshPublicKey">
76+
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="SshPublicKey">
7777
</div>
7878
<div class="field">
7979
<label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label>
80-
<input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="e.g. jpegPhoto">
80+
<input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="jpegPhoto">
8181
</div>
8282

8383
<!-- ldap group begin -->
@@ -90,23 +90,23 @@
9090
<div id="ldap-group-options" class="ui segment secondary">
9191
<div class="field">
9292
<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
93-
<input name="group_dn" value="{{.group_dn}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
93+
<input name="group_dn" value="{{.group_dn}}" placeholder="ou=group,dc=mydomain,dc=com">
9494
</div>
9595
<div class="field">
9696
<label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label>
97-
<input name="group_member_uid" value="{{.group_member_uid}}" placeholder="e.g. memberUid">
97+
<input name="group_member_uid" value="{{.group_member_uid}}" placeholder="memberUid">
9898
</div>
9999
<div class="field">
100100
<label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label>
101-
<input name="user_uid" value="{{.user_uid}}" placeholder="e.g. uid">
101+
<input name="user_uid" value="{{.user_uid}}" placeholder="uid">
102102
</div>
103103
<div class="field">
104104
<label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label>
105-
<input name="group_filter" value="{{.group_filter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
105+
<input name="group_filter" value="{{.group_filter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
106106
</div>
107107
<div class="field">
108108
<label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
109-
<textarea name="group_team_map" rows="5" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.group_team_map}}</textarea>
109+
<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.group_team_map}}</textarea>
110110
</div>
111111
<div class="ui checkbox">
112112
<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>

templates/admin/auth/source/oauth.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</div>
101101
<div class="field">
102102
<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
103-
<textarea name="oauth2_group_team_map" rows="5" placeholder='e.g. {"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.oauth2_group_team_map}}</textarea>
103+
<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.oauth2_group_team_map}}</textarea>
104104
</div>
105105
<div class="ui checkbox">
106106
<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>

templates/admin/queue.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<td>{{$q.GetItemTypeName}}</td>
2424
<td>{{$sum := $q.GetWorkerNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
2525
<td>{{$sum = $q.GetQueueItemNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
26-
<td><a href="{{$.Link}}/{{$qid}}" class="button">{{if lt $sum 0}}{{$.locale.Tr "admin.monitor.queue.review"}}{{else}}{{$.locale.Tr "admin.monitor.queue.review_add"}}{{end}}</a>
26+
<td><a href="{{$.Link}}/{{$qid}}" class="button">{{if lt $sum 0}}{{$.locale.Tr "admin.monitor.queue.review"}}{{else}}{{$.locale.Tr "admin.monitor.queue.review_add"}}{{end}}</a></td>
2727
</tr>
2828
{{end}}
2929
</tbody>

templates/admin/queue_manage.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</h4>
4545
<div class="ui attached segment">
4646
<p>{{.locale.Tr "admin.monitor.queue.settings.desc"}}</p>
47-
<form method="POST" action="{{.Link}}/set">
47+
<form method="post" action="{{.Link}}/set">
4848
{{$.CsrfTokenHtml}}
4949
<div class="ui form">
5050
<div class="inline field">

templates/admin/repo/unadopted.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<div class="content">
3232
<p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
3333
</div>
34-
<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
34+
<form class="ui form" method="post" action="{{AppSubUrl}}/admin/repos/unadopted">
3535
{{$.CsrfTokenHtml}}
3636
<input type="hidden" name="id" value="{{$dir}}">
3737
<input type="hidden" name="action" value="adopt">
@@ -48,7 +48,7 @@
4848
<div class="content">
4949
<p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p>
5050
</div>
51-
<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
51+
<form class="ui form" method="post" action="{{AppSubUrl}}/admin/repos/unadopted">
5252
{{$.CsrfTokenHtml}}
5353
<input type="hidden" name="id" value="{{$dir}}">
5454
<input type="hidden" name="action" value="delete">

0 commit comments

Comments
 (0)