Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): extra spaces in HTML attribute #21855

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions templates/admin/auth/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<input type="hidden" id="auth_type" name="type" value="{{.Source.Type.Int}}">
<span>{{.Source.TypeName}}</span>
</div>
<div class="required inline field {{if .Err_Name}}error{{end}}">
<div class="required inline field{{if .Err_Name}} error{{end}}">
<label for="name">{{.locale.Tr "admin.auths.auth_name"}}</label>
<input id="name" name="name" value="{{.Source.Name}}" autofocus required>
</div>

<!-- LDAP and DLDAP -->
{{if or .Source.IsLDAP .Source.IsDLDAP}}
{{$cfg:=.Source.Cfg}}
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
<div class="inline required field{{if .Err_SecurityProtocol}} error{{end}}">
<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
<div class="ui selection security-protocol dropdown">
<input type="hidden" id="security_protocol" name="security_protocol" value="{{$cfg.SecurityProtocol.Int}}">
Expand All @@ -45,10 +45,10 @@
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
<input id="port" name="port" value="{{$cfg.Port}}" placeholder="e.g. 636" required>
</div>
<div class="has-tls inline field {{if not .HasTLS}}hide{{end}}">
<div class="has-tls inline field{{if not .HasTLS}} hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
<input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
<input name="skip_verify" type="checkbox"{{if .Source.SkipVerify}} checked{{end}}>
</div>
</div>
{{if .Source.IsLDAP}}
Expand All @@ -61,9 +61,9 @@
<input id="bind_password" name="bind_password" type="password" value="{{$cfg.BindPassword}}">
</div>
{{end}}
<div class="{{if .Source.IsLDAP}}required{{end}} field">
<div class="{{if .Source.IsLDAP}}required {{end}}field">
<label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label>
<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com"{{if .Source.IsLDAP}} required{{end}}>
</div>
{{if .Source.IsDLDAP}}
<div class="required field">
Expand Down Expand Up @@ -114,10 +114,10 @@
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}>
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle"{{if $cfg.GroupsEnabled}} checked{{end}}>
</div>
</div>
<div id="ldap-group-options" class="ui segment secondary" {{if not $cfg.GroupsEnabled}}hidden{{end}}>
<div id="ldap-group-options" class="ui segment secondary"{{if not $cfg.GroupsEnabled}} hidden{{end}}>
<div class="field">
<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
Expand All @@ -140,7 +140,7 @@
</div>
<div class="ui checkbox">
<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
<input name="group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
<input name="group_team_map_removal" type="checkbox"{{if $cfg.GroupTeamMapRemoval}} checked{{end}}>
</div>
</div>
<!-- ldap group end -->
Expand All @@ -149,7 +149,7 @@
<div class="inline field">
<div class="ui checkbox">
<label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label>
<input id="use_paged_search" name="use_paged_search" type="checkbox" {{if $cfg.UsePagedSearch}}checked{{end}}>
<input id="use_paged_search" name="use_paged_search" type="checkbox"{{if $cfg.UsePagedSearch}} checked{{end}}>
</div>
</div>
<div class="field required search-page-size{{if not $cfg.UsePagedSearch}} hide{{end}}">
Expand All @@ -159,21 +159,21 @@
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
<input name="attributes_in_bind" type="checkbox" {{if $cfg.AttributesInBind}}checked{{end}}>
<input name="attributes_in_bind" type="checkbox"{{if $cfg.AttributesInBind}} checked{{end}}>
</div>
</div>
{{end}}
<div class="optional field">
<div class="ui checkbox">
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox"{{if $cfg.SkipLocalTwoFA}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
<input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if $cfg.AllowDeactivateAll}}checked{{end}}>
<input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox"{{if $cfg.AllowDeactivateAll}} checked{{end}}>
</div>
</div>
{{end}}
Expand Down Expand Up @@ -205,14 +205,14 @@
<div class="field">
<div class="ui checkbox">
<label for="force_smtps"><strong>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label>
<input id="force_smtps" name="force_smtps" type="checkbox" {{if $cfg.ForceSMTPS}}checked{{end}}>
<input id="force_smtps" name="force_smtps" type="checkbox"{{if $cfg.ForceSMTPS}} checked{{end}}>
</div>
<p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p>
</div>
<div class="has-tls inline field {{if not .HasTLS}}hide{{end}}">
<div class="has-tls inline field{{if not .HasTLS}} hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
<input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
<input name="skip_verify" type="checkbox"{{if .Source.SkipVerify}} checked{{end}}>
</div>
</div>
<div class="field">
Expand All @@ -223,7 +223,7 @@
<div class="inline field">
<div class="ui checkbox">
<label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label>
<input id="disable_helo" name="disable_helo" type="checkbox" {{if $cfg.DisableHelo}}checked{{end}}>
<input id="disable_helo" name="disable_helo" type="checkbox"{{if $cfg.DisableHelo}} checked{{end}}>
</div>
</div>
<div class="field">
Expand All @@ -234,7 +234,7 @@
<div class="optional field">
<div class="ui checkbox">
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox"{{if $cfg.SkipLocalTwoFA}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
</div>
Expand All @@ -254,7 +254,7 @@
<div class="optional field">
<div class="ui checkbox">
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox"{{if $cfg.SkipLocalTwoFA}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
</div>
Expand Down Expand Up @@ -295,14 +295,14 @@
<div class="optional field">
<div class="ui checkbox">
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox"{{if $cfg.SkipLocalTwoFA}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
</div>
<div class="oauth2_use_custom_url inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
<input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $cfg.CustomURLMapping}}checked{{end}}>
<input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox"{{if $cfg.CustomURLMapping}} checked{{end}}>
</div>
</div>
<div class="oauth2_use_custom_url_field oauth2_auth_url required field">
Expand Down Expand Up @@ -369,21 +369,21 @@
<div class="field">
<div class="ui checkbox">
<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>
<input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if $cfg.AutoCreateUsers}}checked{{end}}>
<input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox"{{if $cfg.AutoCreateUsers}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<label for="sspi_auto_activate_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label>
<input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if $cfg.AutoActivateUsers}}checked{{end}}>
<input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox"{{if $cfg.AutoActivateUsers}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<label for="sspi_strip_domain_names"><strong>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label>
<input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if $cfg.StripDomainNames}}checked{{end}}>
<input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox"{{if $cfg.StripDomainNames}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
</div>
</div>
Expand Down Expand Up @@ -412,14 +412,14 @@
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
<input name="is_sync_enabled" type="checkbox" {{if .Source.IsSyncEnabled}}checked{{end}}>
<input name="is_sync_enabled" type="checkbox"{{if .Source.IsSyncEnabled}} checked{{end}}>
</div>
</div>
{{end}}
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label>
<input name="is_active" type="checkbox" {{if .Source.IsActive}}checked{{end}}>
<input name="is_active" type="checkbox"{{if .Source.IsActive}} checked{{end}}>
</div>
</div>

Expand Down
18 changes: 9 additions & 9 deletions templates/admin/auth/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<!-- Types and name -->
<div class="inline required field {{if .Err_Type}}error{{end}}">
<div class="inline required field{{if .Err_Type}} error{{end}}">
<label>{{.locale.Tr "admin.auths.auth_type"}}</label>
<div class="ui selection type dropdown">
<input type="hidden" id="auth_type" name="type" value="{{.type}}">
Expand All @@ -24,7 +24,7 @@
</div>
</div>
</div>
<div class="required inline field {{if .Err_Name}}error{{end}}">
<div class="required inline field{{if .Err_Name}} error{{end}}">
<label for="name">{{.locale.Tr "admin.auths.auth_name"}}</label>
<input id="name" name="name" value="{{.name}}" autofocus required>
</div>
Expand All @@ -36,16 +36,16 @@
{{template "admin/auth/source/smtp" .}}

<!-- PAM -->
<div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
<div class="pam required field{{if not (eq .type 4)}} hide{{end}}">
<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
<input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}" />
<label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label>
<input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}">
</div>
<div class="pam optional field {{if not (eq .type 4)}}hide{{end}}">
<div class="pam optional field{{if not (eq .type 4)}} hide{{end}}">
<div class="ui checkbox">
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox"{{if .skip_local_two_fa}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
</div>
Expand All @@ -59,19 +59,19 @@
<div class="ldap field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
<input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}>
<input name="attributes_in_bind" type="checkbox"{{if .attributes_in_bind}} checked{{end}}>
</div>
</div>
<div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}">
<div class="ldap inline field{{if not (eq .type 2)}} hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
<input name="is_sync_enabled" type="checkbox" {{if .is_sync_enabled}}checked{{end}}>
<input name="is_sync_enabled" type="checkbox"{{if .is_sync_enabled}} checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label>
<input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}>
<input name="is_active" type="checkbox"{{if .is_active}} checked{{end}}>
</div>
</div>

Expand Down
30 changes: 15 additions & 15 deletions templates/admin/auth/source/ldap.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}hide{{end}}">
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
<div class="ldap dldap field{{if not (or (eq .type 2) (eq .type 5))}} hide{{end}}">
<div class="inline required field{{if .Err_SecurityProtocol}} error{{end}}">
<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
<div class="ui selection security-protocol dropdown">
<input type="hidden" id="security_protocol" name="security_protocol" value="{{.security_protocol}}">
Expand All @@ -20,25 +20,25 @@
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
<input id="port" name="port" value="{{.port}}" placeholder="e.g. 636">
</div>
<div class="has-tls inline field {{if not .HasTLS}}hide{{end}}">
<div class="has-tls inline field{{if not .HasTLS}} hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
<input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}>
<input name="skip_verify" type="checkbox"{{if .skip_verify}} checked{{end}}>
</div>
</div>
<div class="ldap field {{if not (eq .type 2)}}hide{{end}}">
<div class="ldap field{{if not (eq .type 2)}} hide{{end}}">
<label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label>
<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
</div>
<div class="ldap field {{if not (eq .type 2)}}hide{{end}}">
<div class="ldap field{{if not (eq .type 2)}} hide{{end}}">
<label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label>
<input id="bind_password" name="bind_password" type="password" autocomplete="off" value="{{.bind_password}}">
</div>
<div class="binddnrequired {{if (eq .type 2)}}required{{end}} field">
<div class="binddnrequired{{if (eq .type 2)}} required{{end}} field">
<label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label>
<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com">
</div>
<div class="dldap required field {{if not (eq .type 5)}}hide{{end}}">
<div class="dldap required field{{if not (eq .type 5)}} hide{{end}}">
<label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label>
<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com">
</div>
Expand Down Expand Up @@ -84,7 +84,7 @@
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if .groups_enabled}}checked{{end}}>
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle"{{if .groups_enabled}} checked{{end}}>
</div>
</div>
<div id="ldap-group-options" class="ui segment secondary">
Expand All @@ -110,32 +110,32 @@
</div>
<div class="ui checkbox">
<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
<input name="group_team_map_removal" type="checkbox" {{if .group_team_map_removal}}checked{{end}}>
<input name="group_team_map_removal" type="checkbox"{{if .group_team_map_removal}} checked{{end}}>
</div>
</div>
<!-- ldap group end -->

<div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}">
<div class="ldap inline field{{if not (eq .type 2)}} hide{{end}}">
<div class="ui checkbox">
<label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label>
<input id="use_paged_search" name="use_paged_search" class="use-paged-search" type="checkbox" {{if .use_paged_search}}checked{{end}}>
<input id="use_paged_search" name="use_paged_search" class="use-paged-search" type="checkbox"{{if .use_paged_search}} checked{{end}}>
</div>
</div>
<div class="ldap field search-page-size required {{if or (not (eq .type 2)) (not .use_paged_search)}}hide{{end}}">
<div class="ldap field search-page-size required{{if or (not (eq .type 2)) (not .use_paged_search)}} hide{{end}}">
<label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label>
<input id="search_page_size" name="search_page_size" value="{{.search_page_size}}">
</div>
<div class="optional field">
<div class="ui checkbox">
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox"{{if .skip_local_two_fa}} checked{{end}}>
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
<input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if .allow_deactivate_all}}checked{{end}}>
<input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox"{{if .allow_deactivate_all}} checked{{end}}>
</div>
</div>
</div>
Loading