Skip to content

Commit eb5e1bc

Browse files
wxiaoguangzeripath
andauthored
Remove Fomantic-UI's .hidden CSS class for checkbox elements (#22851)
Fomantic-UI's `.hidden` CSS class is badly designed. * Checkbox elements do not need it in HTML, so this PR removes it (JS adds the `.hidden` class back by `$('.ui.checkbox').checkbox()`) * `menu transaction hidden` is still needed, and it should be the only usage for the `.hidden` from now on (until they get refactored properly) Co-authored-by: zeripath <[email protected]>
1 parent c8093a1 commit eb5e1bc

File tree

8 files changed

+50
-50
lines changed

8 files changed

+50
-50
lines changed

templates/org/create.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
<span class="inline required field"><label for="visibility">{{.locale.Tr "org.settings.visibility"}}</label></span>
2020
<div class="inline-grouped-list">
2121
<div class="ui radio checkbox">
22-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}/>
22+
<input class="enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}/>
2323
<label>{{.locale.Tr "org.settings.visibility.public"}}</label>
2424
</div>
2525
<div class="ui radio checkbox">
26-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}/>
26+
<input class="enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}/>
2727
<label>{{.locale.Tr "org.settings.visibility.limited"}}</label>
2828
</div>
2929
<div class="ui radio checkbox">
30-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}/>
30+
<input class="enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}/>
3131
<label>{{.locale.Tr "org.settings.visibility.private"}}</label>
3232
</div>
3333
</div>
@@ -37,7 +37,7 @@
3737
<label>{{.locale.Tr "org.settings.permission"}}</label>
3838
<div class="inline-grouped-list">
3939
<div class="ui checkbox">
40-
<input class="hidden" type="checkbox" name="repo_admin_change_team_access" checked/>
40+
<input type="checkbox" name="repo_admin_change_team_access" checked/>
4141
<label>{{.locale.Tr "org.settings.repoadminchangeteam"}}</label>
4242
</div>
4343
</div>

templates/org/settings/options.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@
4141
<label for="visibility">{{.locale.Tr "org.settings.visibility"}}</label>
4242
<div class="field">
4343
<div class="ui radio checkbox">
44-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}/>
44+
<input class="enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}/>
4545
<label>{{.locale.Tr "org.settings.visibility.public"}}</label>
4646
</div>
4747
</div>
4848
<div class="field">
4949
<div class="ui radio checkbox">
50-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}/>
50+
<input class="enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}/>
5151
<label>{{.locale.Tr "org.settings.visibility.limited"}}</label>
5252
</div>
5353
</div>
5454
<div class="field">
5555
<div class="ui radio checkbox">
56-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}/>
56+
<input class="enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}/>
5757
<label>{{.locale.Tr "org.settings.visibility.private"}}</label>
5858
</div>
5959
</div>
@@ -63,7 +63,7 @@
6363
<label>{{.locale.Tr "org.settings.permission"}}</label>
6464
<div class="field">
6565
<div class="ui checkbox">
66-
<input class="hidden" type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}/>
66+
<input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}/>
6767
<label>{{.locale.Tr "org.settings.repoadminchangeteam"}}</label>
6868
</div>
6969
</div>

templates/org/team/new.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@
9999
</td>
100100
<td class="center aligned">
101101
<div class="ui radio checkbox">
102-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}} title="{{$.locale.Tr "org.teams.none_access"}}">
102+
<input type="radio" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}} title="{{$.locale.Tr "org.teams.none_access"}}">
103103
</div>
104104
</td>
105105
<td class="center aligned">
106106
<div class="ui radio checkbox">
107-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.read_access"}}">
107+
<input type="radio" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.read_access"}}">
108108
</div>
109109
</td>
110110
<td class="center aligned">
111111
<div class="ui radio checkbox">
112-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.write_access"}}">
112+
<input type="radio" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.write_access"}}">
113113
</div>
114114
</td>
115115
</tr>
@@ -121,7 +121,7 @@
121121
{{if lt $unit.MaxPerm 2}}
122122
<div {{if $unit.Type.UnitGlobalDisabled}}class="field tooltip" data-content="{{$.locale.Tr "repo.unit_disabled"}}"{{else}}class="field"{{end}}>
123123
<div class="ui checkbox">
124-
<input type="checkbox" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
124+
<input type="checkbox" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
125125
<label>{{$.locale.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.locale.Tr "org.team_unit_disabled"}}{{end}}</label>
126126
<span class="help">{{$.locale.Tr $unit.DescKey}}</span>
127127
</div>

templates/repo/create.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,33 +77,33 @@
7777
<div class="inline field">
7878
<label>{{.locale.Tr "repo.template.items"}}</label>
7979
<div class="ui checkbox">
80-
<input class="hidden" name="git_content" type="checkbox" tabindex="0" {{if .git_content}}checked{{end}}>
80+
<input name="git_content" type="checkbox" tabindex="0" {{if .git_content}}checked{{end}}>
8181
<label>{{.locale.Tr "repo.template.git_content"}}</label>
8282
</div>
8383
<div class="ui checkbox{{if not .SignedUser.CanEditGitHook}} tooltip{{end}}"{{if not .SignedUser.CanEditGitHook}} data-content="{{.locale.Tr "repo.template.git_hooks_tooltip"}}"{{end}}>
84-
<input class="hidden" name="git_hooks" type="checkbox" tabindex="0" {{if .git_hooks}}checked{{end}}>
84+
<input name="git_hooks" type="checkbox" tabindex="0" {{if .git_hooks}}checked{{end}}>
8585
<label>{{.locale.Tr "repo.template.git_hooks"}}</label>
8686
</div>
8787
</div>
8888
<div class="inline field">
8989
<label></label>
9090
<div class="ui checkbox">
91-
<input class="hidden" name="webhooks" type="checkbox" tabindex="0" {{if .webhooks}}checked{{end}}>
91+
<input name="webhooks" type="checkbox" tabindex="0" {{if .webhooks}}checked{{end}}>
9292
<label>{{.locale.Tr "repo.template.webhooks"}}</label>
9393
</div>
9494
<div class="ui checkbox">
95-
<input class="hidden" name="topics" type="checkbox" tabindex="0" {{if .topics}}checked{{end}}>
95+
<input name="topics" type="checkbox" tabindex="0" {{if .topics}}checked{{end}}>
9696
<label>{{.locale.Tr "repo.template.topics"}}</label>
9797
</div>
9898
</div>
9999
<div class="inline field">
100100
<label></label>
101101
<div class="ui checkbox">
102-
<input class="hidden" name="avatar" type="checkbox" tabindex="0" {{if .avatar}}checked{{end}}>
102+
<input name="avatar" type="checkbox" tabindex="0" {{if .avatar}}checked{{end}}>
103103
<label>{{.locale.Tr "repo.template.avatar"}}</label>
104104
</div>
105105
<div class="ui checkbox">
106-
<input class="hidden" name="labels" type="checkbox" tabindex="0" {{if .labels}}checked{{end}}>
106+
<input name="labels" type="checkbox" tabindex="0" {{if .labels}}checked{{end}}>
107107
<label>{{.locale.Tr "repo.template.issue_labels"}}</label>
108108
</div>
109109
</div>
@@ -169,7 +169,7 @@
169169
</div>
170170
<div class="inline field">
171171
<div class="ui checkbox" id="auto-init">
172-
<input class="hidden" name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
172+
<input name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
173173
<label>{{.locale.Tr "repo.auto_init"}}</label>
174174
</div>
175175
</div>
@@ -204,7 +204,7 @@
204204
<div class="inline field">
205205
<label>{{.locale.Tr "repo.template"}}</label>
206206
<div class="ui checkbox">
207-
<input class="hidden" name="template" type="checkbox" tabindex="0">
207+
<input name="template" type="checkbox" tabindex="0">
208208
<label>{{.locale.Tr "repo.template_helper"}}</label>
209209
</div>
210210
</div>

templates/repo/editor/commit_form.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
<div class="inline field">
1818
<div class="ui checkbox">
19-
<input name="signoff" type="checkbox" tabindex="0" class="hidden">
19+
<input name="signoff" type="checkbox" tabindex="0">
2020
<label>{{.locale.Tr "repo.editor.signoff_desc"}}</label>
2121
</div>
2222
</div>

templates/repo/settings/deploy_keys.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</div>
3232
<div class="field">
3333
<div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
34-
<input id="ssh-key-is-writable" name="is_writable" class="hidden" type="checkbox" value="1">
34+
<input id="ssh-key-is-writable" name="is_writable" type="checkbox" value="1">
3535
<label for="is_writable">
3636
{{.locale.Tr "repo.settings.is_writable"}}
3737
</label>

templates/repo/settings/options.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
{{else}}
282282
<div class="ui radio checkbox">
283283
{{end}}
284-
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}/>
284+
<input class="enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}/>
285285
<label>{{.locale.Tr "repo.settings.use_internal_wiki"}}</label>
286286
</div>
287287
</div>
@@ -291,7 +291,7 @@
291291
{{else}}
292292
<div class="ui radio checkbox">
293293
{{end}}
294-
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}/>
294+
<input class="enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}/>
295295
<label>{{.locale.Tr "repo.settings.use_external_wiki"}}</label>
296296
</div>
297297
</div>
@@ -323,7 +323,7 @@
323323
{{else}}
324324
<div class="ui radio checkbox">
325325
{{end}}
326-
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}/>
326+
<input class="enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}/>
327327
<label>{{.locale.Tr "repo.settings.use_internal_issue_tracker"}}</label>
328328
</div>
329329
</div>
@@ -359,7 +359,7 @@
359359
{{else}}
360360
<div class="ui radio checkbox">
361361
{{end}}
362-
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}/>
362+
<input class="enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}/>
363363
<label>{{.locale.Tr "repo.settings.use_external_issue_tracker"}}</label>
364364
</div>
365365
</div>

0 commit comments

Comments
 (0)