Skip to content

Commit d32af84

Browse files
authored
Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950)
Close #22847 This PR: * introduce Gitea's own `showElem` and related functions * remove jQuery show/hide * remove .hide class * remove inline style=display:none From now on: do not use: * "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex" * ".hidden" class: it has been polluted by Fomantic UI in many cases * inline style="display: none": it's difficult to tweak * jQuery's show/hide/toggle: it can not show/hide elements with "display: xxx !important" only use: * this ".gt-hidden" class * showElem/hideElem/toggleElem functions in "utils/dom.js" cc: @silverwind , this is the all-in-one PR
1 parent 6221a6f commit d32af84

File tree

89 files changed

+369
-281
lines changed

Some content is hidden

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

89 files changed

+369
-281
lines changed

.eslintrc.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ rules:
149149
jquery/no-global-eval: [2]
150150
jquery/no-grep: [2]
151151
jquery/no-has: [2]
152-
jquery/no-hide: [0]
152+
jquery/no-hide: [2]
153153
jquery/no-html: [0]
154154
jquery/no-in-array: [2]
155155
jquery/no-is-array: [2]
@@ -166,13 +166,13 @@ rules:
166166
jquery/no-proxy: [2]
167167
jquery/no-ready: [0]
168168
jquery/no-serialize: [2]
169-
jquery/no-show: [0]
169+
jquery/no-show: [2]
170170
jquery/no-size: [2]
171171
jquery/no-sizzle: [0]
172172
jquery/no-slide: [0]
173173
jquery/no-submit: [0]
174174
jquery/no-text: [0]
175-
jquery/no-toggle: [0]
175+
jquery/no-toggle: [2]
176176
jquery/no-trigger: [0]
177177
jquery/no-trim: [2]
178178
jquery/no-val: [0]

docs/content/doc/developers/guidelines-frontend.en-us.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ However, there are still some special cases, so the current guideline is:
9393
* `node.dataset` should not be used, use `node.getAttribute` instead.
9494
* never bind any user data to a DOM node, use a suitable design pattern to describe the relation between node and data.
9595

96+
### Show/Hide Elements
97+
98+
* Vue components are recommended to use `v-if` and `v-show` to show/hide elements.
99+
* Go template code should use Gitea's `.gt-hidden` and `showElem()/hideElem()/toggleElem()`, see more details in `.gt-hidden`'s comment.
100+
96101
### Legacy Code
97102

98103
A lot of legacy code already existed before this document's written. It's recommended to refactor legacy code to follow the guidelines.

templates/admin/auth/edit.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
4646
<input id="port" name="port" value="{{$cfg.Port}}" placeholder="e.g. 636" required>
4747
</div>
48-
<div class="has-tls inline field {{if not .HasTLS}}hide{{end}}">
48+
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
4949
<div class="ui checkbox">
5050
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
5151
<input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
@@ -152,7 +152,7 @@
152152
<input id="use_paged_search" name="use_paged_search" type="checkbox" {{if $cfg.UsePagedSearch}}checked{{end}}>
153153
</div>
154154
</div>
155-
<div class="field required search-page-size{{if not $cfg.UsePagedSearch}} hide{{end}}">
155+
<div class="field required search-page-size{{if not $cfg.UsePagedSearch}} gt-hidden{{end}}">
156156
<label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label>
157157
<input id="search_page_size" name="search_page_size" value="{{if $cfg.UsePagedSearch}}{{$cfg.SearchPageSize}}{{end}}">
158158
</div>
@@ -209,7 +209,7 @@
209209
</div>
210210
<p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p>
211211
</div>
212-
<div class="has-tls inline field {{if not .HasTLS}}hide{{end}}">
212+
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
213213
<div class="ui checkbox">
214214
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
215215
<input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>

templates/admin/auth/new.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
{{template "admin/auth/source/smtp" .}}
3737

3838
<!-- PAM -->
39-
<div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
39+
<div class="pam required field {{if not (eq .type 4)}}gt-hidden{{end}}">
4040
<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
4141
<input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}" />
4242
<label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label>
4343
<input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}">
4444
</div>
45-
<div class="pam optional field {{if not (eq .type 4)}}hide{{end}}">
45+
<div class="pam optional field {{if not (eq .type 4)}}gt-hidden{{end}}">
4646
<div class="ui checkbox">
4747
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
4848
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
@@ -62,7 +62,7 @@
6262
<input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}>
6363
</div>
6464
</div>
65-
<div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}">
65+
<div class="ldap inline field {{if not (eq .type 2)}}gt-hidden{{end}}">
6666
<div class="ui checkbox">
6767
<label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
6868
<input name="is_sync_enabled" type="checkbox" {{if .is_sync_enabled}}checked{{end}}>

templates/admin/auth/source/ldap.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}hide{{end}}">
1+
<div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}gt-hidden{{end}}">
22
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
33
<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
44
<div class="ui selection security-protocol dropdown">
@@ -20,25 +20,25 @@
2020
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
2121
<input id="port" name="port" value="{{.port}}" placeholder="e.g. 636">
2222
</div>
23-
<div class="has-tls inline field {{if not .HasTLS}}hide{{end}}">
23+
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
2424
<div class="ui checkbox">
2525
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
2626
<input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}>
2727
</div>
2828
</div>
29-
<div class="ldap field {{if not (eq .type 2)}}hide{{end}}">
29+
<div class="ldap field {{if not (eq .type 2)}}gt-hidden{{end}}">
3030
<label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label>
3131
<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
3232
</div>
33-
<div class="ldap field {{if not (eq .type 2)}}hide{{end}}">
33+
<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>
3939
<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com">
4040
</div>
41-
<div class="dldap required field {{if not (eq .type 5)}}hide{{end}}">
41+
<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>
4343
<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com">
4444
</div>
@@ -115,13 +115,13 @@
115115
</div>
116116
<!-- ldap group end -->
117117

118-
<div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}">
118+
<div class="ldap inline field {{if not (eq .type 2)}}gt-hidden{{end}}">
119119
<div class="ui checkbox">
120120
<label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label>
121121
<input id="use_paged_search" name="use_paged_search" class="use-paged-search" type="checkbox" {{if .use_paged_search}}checked{{end}}>
122122
</div>
123123
</div>
124-
<div class="ldap field search-page-size required {{if or (not (eq .type 2)) (not .use_paged_search)}}hide{{end}}">
124+
<div class="ldap field search-page-size required {{if or (not (eq .type 2)) (not .use_paged_search)}}gt-hidden{{end}}">
125125
<label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label>
126126
<input id="search_page_size" name="search_page_size" value="{{.search_page_size}}">
127127
</div>

templates/admin/auth/source/oauth.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="oauth2 field {{if not (eq .type 6)}}hide{{end}}">
1+
<div class="oauth2 field {{if not (eq .type 6)}}gt-hidden{{end}}">
22
<div class="inline required field">
33
<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
44
<div class="ui selection type dropdown">

templates/admin/auth/source/smtp.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="smtp field {{if not (eq .type 3)}}hide{{end}}">
1+
<div class="smtp field {{if not (eq .type 3)}}gt-hidden{{end}}">
22
<div class="inline required field">
33
<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
44
<div class="ui selection type dropdown">

templates/admin/auth/source/sspi.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="sspi field {{if not (eq .type 7)}}hide{{end}}">
1+
<div class="sspi field {{if not (eq .type 7)}}gt-hidden{{end}}">
22
<div class="field">
33
<div class="ui checkbox">
44
<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>

templates/admin/user/edit.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</div>
5757
</div>
5858

59-
<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}hide{{end}}">
59+
<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}gt-hidden{{end}}">
6060
<label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label>
6161
<input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus>
6262
</div>
@@ -68,7 +68,7 @@
6868
<label for="email">{{.locale.Tr "email"}}</label>
6969
<input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required>
7070
</div>
71-
<div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}hide{{end}}">
71+
<div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}gt-hidden{{end}}">
7272
<label for="password">{{.locale.Tr "password"}}</label>
7373
<input id="password" name="password" type="password" autocomplete="new-password">
7474
<p class="help">{{.locale.Tr "admin.users.password_helper"}}</p>
@@ -116,7 +116,7 @@
116116
<input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}>
117117
</div>
118118
</div>
119-
<div class="inline field"{{if DisableGitHooks}} hidden{{end}}>
119+
<div class="inline field {{if DisableGitHooks}}gt-hidden{{end}}">
120120
<div class="ui checkbox tooltip" data-content="{{.locale.Tr "admin.users.allow_git_hook_tooltip"}}">
121121
<label><strong>{{.locale.Tr "admin.users.allow_git_hook"}}</strong></label>
122122
<input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}>

templates/install.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
</div>
3030

31-
<div class="hide" data-db-setting-for="common-host">
31+
<div class="gt-hidden" data-db-setting-for="common-host">
3232
<div class="inline required field {{if .Err_DbSetting}}error{{end}}">
3333
<label for="db_host">{{.locale.Tr "install.host"}}</label>
3434
<input id="db_host" name="db_host" value="{{.db_host}}">
@@ -48,7 +48,7 @@
4848
</div>
4949
</div>
5050

51-
<div class="hide" data-db-setting-for="postgres">
51+
<div class="gt-hidden" data-db-setting-for="postgres">
5252
<div class="inline required field">
5353
<label>{{.locale.Tr "install.ssl_mode"}}</label>
5454
<div class="ui selection database type dropdown">
@@ -69,7 +69,7 @@
6969
</div>
7070
</div>
7171

72-
<div class="hide" data-db-setting-for="mysql">
72+
<div class="gt-hidden" data-db-setting-for="mysql">
7373
<div class="inline required field">
7474
<label>{{.locale.Tr "install.charset"}}</label>
7575
<div class="ui selection database type dropdown">
@@ -83,7 +83,7 @@
8383
</div>
8484
</div>
8585

86-
<div class="hide" data-db-setting-for="sqlite3">
86+
<div class="gt-hidden" data-db-setting-for="sqlite3">
8787
<div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
8888
<label for="db_path">{{.locale.Tr "install.path"}}</label>
8989
<input id="db_path" name="db_path" value="{{.db_path}}">
@@ -346,5 +346,5 @@
346346
</div>
347347
</div>
348348
</div>
349-
<img style="display: none" src="{{AssetUrlPrefix}}/img/loading.png"/>
349+
<img class="gt-hidden" src="{{AssetUrlPrefix}}/img/loading.png"/>
350350
{{template "base/footer" .}}

templates/org/settings/options.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
{{.CsrfTokenHtml}}
1515
<div class="required field {{if .Err_Name}}error{{end}}">
1616
<label for="org_name">{{.locale.Tr "org.org_name_holder"}}
17-
<span class="text red hide" id="org-name-change-prompt"> {{.locale.Tr "org.settings.change_orgname_prompt"}}</span>
18-
<span class="text red hide" id="org-name-change-redirect-prompt"> {{.locale.Tr "org.settings.change_orgname_redirect_prompt"}}</span>
17+
<span class="text red gt-hidden" id="org-name-change-prompt"> {{.locale.Tr "org.settings.change_orgname_prompt"}}</span>
18+
<span class="text red gt-hidden" id="org-name-change-redirect-prompt"> {{.locale.Tr "org.settings.change_orgname_redirect_prompt"}}</span>
1919
</label>
2020
<input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required>
2121
</div>

templates/org/team/new.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</div>
7272
<div class="ui divider"></div>
7373

74-
<div class="team-units required grouped field"{{if eq .Team.AccessMode 3}} style="display: none"{{end}}>
74+
<div class="team-units required grouped field {{if eq .Team.AccessMode 3}}gt-hidden{{end}}">
7575
<label>{{.locale.Tr "org.team_unit_desc"}}</label>
7676
<table class="ui celled table">
7777
<thead>

templates/repo/blame.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<a class="ui tiny button" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.normal_view"}}</a>
1313
<a class="ui tiny button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.file_history"}}</a>
1414
<a class="ui tiny button unescape-button">{{.locale.Tr "repo.unescape_control_characters"}}</a>
15-
<a class="ui tiny button escape-button" style="display: none;">{{.locale.Tr "repo.escape_control_characters"}}</a>
15+
<a class="ui tiny button escape-button gt-hidden">{{.locale.Tr "repo.escape_control_characters"}}</a>
1616
</div>
1717
</div>
1818
</h4>

templates/repo/branch_dropdown.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</span>
2828
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
2929
</button>
30-
<div class="data" style="display: none" data-mode="{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}">
30+
<div class="data gt-hidden" data-mode="{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}">
3131
{{if $showBranchesInDropdown}}
3232
{{range .root.Branches}}
3333
<div class="item branch {{if eq $defaultBranch .}}selected{{end}}" data-url="{{PathEscapeSegments .}}">{{.}}</div>

templates/repo/commits_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
{{end}}
7373
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
7474
{{if IsMultilineCommitMessage .Message}}
75-
<pre class="commit-body" style="display: none;">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
75+
<pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
7676
{{end}}
7777
</td>
7878
{{if .Committer}}

templates/repo/commits_list_small.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<button class="ui button ellipsis-button" aria-expanded="false">...</button>
5353
{{end}}
5454
{{if IsMultilineCommitMessage .Message}}
55-
<pre class="commit-body" style="display: none;">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</pre>
55+
<pre class="commit-body gt-hidden">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</pre>
5656
{{end}}
5757
</div>
5858
{{end}}

templates/repo/create.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474
</div>
7575

76-
<div id="template_units" style="display: none;">
76+
<div id="template_units" class="gt-hidden">
7777
<div class="inline field">
7878
<label>{{.locale.Tr "repo.template.items"}}</label>
7979
<div class="ui checkbox">

templates/repo/diff/box.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</script>
6868
<div id="diff-file-list"></div>
6969
<div id="diff-container">
70-
<div id="diff-file-tree" class="hide"></div>
70+
<div id="diff-file-tree" class="gt-hidden"></div>
7171
<div id="diff-file-boxes" class="sixteen wide column">
7272
{{range $i, $file := .Diff.Files}}
7373
{{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}}
@@ -116,7 +116,7 @@
116116
{{end}}
117117
{{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}}
118118
<a class="ui basic tiny button unescape-button">{{$.locale.Tr "repo.unescape_control_characters"}}</a>
119-
<a class="ui basic tiny button escape-button" style="display: none;">{{$.locale.Tr "repo.escape_control_characters"}}</a>
119+
<a class="ui basic tiny button escape-button gt-hidden">{{$.locale.Tr "repo.escape_control_characters"}}</a>
120120
{{end}}
121121
{{if and (not $file.IsSubmodule) (not $.PageIsWiki)}}
122122
{{if $file.IsDeleted}}
@@ -136,7 +136,7 @@
136136
</div>
137137
</h4>
138138
<div class="diff-file-body ui attached unstackable table segment" {{if $file.IsViewed}}data-folded="true"{{end}}>
139-
<div id="diff-source-{{$file.NameHash}}" class="file-body file-code unicode-escaped code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}{{if $showFileViewToggle}} hide{{end}}">
139+
<div id="diff-source-{{$file.NameHash}}" class="file-body file-code unicode-escaped code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}{{if $showFileViewToggle}} gt-hidden{{end}}">
140140
{{if or $file.IsIncomplete $file.IsBin}}
141141
<div class="diff-file-body binary" style="padding: 5px 10px;">
142142
{{if $file.IsIncomplete}}
@@ -187,7 +187,7 @@
187187
</div>
188188

189189
{{if not $.Repository.IsArchived}}
190-
<div class="hide" id="edit-content-form">
190+
<div class="gt-hidden" id="edit-content-form">
191191
<div class="ui comment form">
192192
<div class="ui top attached tabular menu">
193193
<a class="active write item">{{$.locale.Tr "write"}}</a>

templates/repo/diff/comment_form.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{if and $.root.SignedUserID (not $.Repository.IsArchived)}}
2-
<form class="ui form {{if $.hidden}}hide comment-form comment-form-reply{{end}}" action="{{$.root.Issue.Link}}/files/reviews/comments" method="post">
2+
<form class="ui form {{if $.hidden}}gt-hidden comment-form comment-form-reply{{end}}" action="{{$.root.Issue.Link}}/files/reviews/comments" method="post">
33
{{$.root.CsrfTokenHtml}}
44
<input type="hidden" name="origin" value="{{if $.root.PageIsPullFiles}}diff{{else}}timeline{{end}}">
55
<input type="hidden" name="latest_commit_id" value="{{$.root.AfterCommitID}}"/>

templates/repo/diff/comments.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
<span class="no-content">{{$.root.locale.Tr "repo.issues.no_content"}}</span>
5555
{{end}}
5656
</div>
57-
<div id="issuecomment-{{.ID}}-raw" class="raw-content hide">{{.Content}}</div>
58-
<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}"></div>
57+
<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
58+
<div class="edit-content-zone gt-hidden" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}"></div>
5959
</div>
6060
{{$reactions := .Reactions.GroupByType}}
6161
{{if $reactions}}

0 commit comments

Comments
 (0)