初始提交: Gitea 项目代码
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin actions")}}
|
||||
<div class="admin-setting-content">
|
||||
{{if eq .PageType "runners"}}
|
||||
{{template "shared/actions/runner_list" .}}
|
||||
{{end}}
|
||||
{{if eq .PageType "variables"}}
|
||||
{{template "shared/variables/variable_list" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,8 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin config")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.applications"}}
|
||||
</h4>
|
||||
{{template "user/settings/applications_oauth2_list" .}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin config")}}
|
||||
<div class="admin-setting-content">
|
||||
|
||||
{{template "user/settings/applications_oauth2_edit_form" .}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,451 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin edit authentication")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.auths.edit"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{template "base/disable_form_autofill"}}
|
||||
<input type="hidden" name="id" value="{{.Source.ID}}">
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.auth_type"}}</label>
|
||||
<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}}">
|
||||
<label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label>
|
||||
<input id="auth_name" name="name" value="{{.Source.Name}}" required>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label ><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
|
||||
<input name="two_factor_policy" type="checkbox" value="skip" {{if eq .Source.TwoFactorPolicy "skip"}}checked{{end}}>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- LDAP and DLDAP -->
|
||||
{{if or .Source.IsLDAP .Source.IsDLDAP}}
|
||||
{{$cfg:=.Source.Cfg}}
|
||||
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
|
||||
<label>{{ctx.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}}">
|
||||
<div class="text">{{$cfg.SecurityProtocolName}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .SecurityProtocols}}
|
||||
<div class="item" data-value="{{.Type.Int}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="host">{{ctx.Locale.Tr "admin.auths.host"}}</label>
|
||||
<input id="host" name="host" value="{{$cfg.Host}}" placeholder="mydomain.com" required>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="port">{{ctx.Locale.Tr "admin.auths.port"}}</label>
|
||||
<input id="port" name="port" value="{{$cfg.Port}}" placeholder="636" required>
|
||||
</div>
|
||||
<div class="has-tls inline field {{if not .HasTLS}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
|
||||
<input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
{{if .Source.IsLDAP}}
|
||||
<div class="field">
|
||||
<label for="bind_dn">{{ctx.Locale.Tr "admin.auths.bind_dn"}}</label>
|
||||
<input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="cn=Search,dc=mydomain,dc=com">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="bind_password">{{ctx.Locale.Tr "admin.auths.bind_password"}}</label>
|
||||
<input id="bind_password" name="bind_password" type="password" value="{{$cfg.BindPassword}}">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="{{if .Source.IsLDAP}}required{{end}} field">
|
||||
<label for="user_base">{{ctx.Locale.Tr "admin.auths.user_base"}}</label>
|
||||
<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
|
||||
</div>
|
||||
{{if .Source.IsDLDAP}}
|
||||
<div class="required field">
|
||||
<label for="user_dn">{{ctx.Locale.Tr "admin.auths.user_dn"}}</label>
|
||||
<input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com" required>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="required field">
|
||||
<label for="filter">{{ctx.Locale.Tr "admin.auths.filter"}}</label>
|
||||
<input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="admin_filter">{{ctx.Locale.Tr "admin.auths.admin_filter"}}</label>
|
||||
<input id="admin_filter" name="admin_filter" value="{{$cfg.AdminFilter}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="restricted_filter">{{ctx.Locale.Tr "admin.auths.restricted_filter"}}</label>
|
||||
<input id="restricted_filter" name="restricted_filter" value="{{$cfg.RestrictedFilter}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.restricted_filter_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_username">{{ctx.Locale.Tr "admin.auths.attribute_username"}}</label>
|
||||
<input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{ctx.Locale.Tr "admin.auths.attribute_username_placeholder"}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_name">{{ctx.Locale.Tr "admin.auths.attribute_name"}}</label>
|
||||
<input id="attribute_name" name="attribute_name" value="{{$cfg.AttributeName}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_surname">{{ctx.Locale.Tr "admin.auths.attribute_surname"}}</label>
|
||||
<input id="attribute_surname" name="attribute_surname" value="{{$cfg.AttributeSurname}}">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="attribute_mail">{{ctx.Locale.Tr "admin.auths.attribute_mail"}}</label>
|
||||
<input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="mail" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_ssh_public_key">{{ctx.Locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
|
||||
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="SshPublicKey">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_avatar">{{ctx.Locale.Tr "admin.auths.attribute_avatar"}}</label>
|
||||
<input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="jpegPhoto">
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="ssh_keys_are_verified"><strong>{{ctx.Locale.Tr "admin.auths.ssh_keys_are_verified"}}</strong></label>
|
||||
<input id="ssh_keys_are_verified" name="ssh_keys_are_verified" type="checkbox" {{if $cfg.SSHKeysAreVerified}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ldap group begin -->
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}tw-hidden{{end}}">
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.group_search_base"}}</label>
|
||||
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="ou=group,dc=mydomain,dc=com">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.group_attribute_list_users"}}</label>
|
||||
<input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="memberUid">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.user_attribute_in_group"}}</label>
|
||||
<input name="user_uid" value="{{$cfg.UserUID}}" placeholder="uid">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.verify_group_membership"}}</label>
|
||||
<input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.map_group_to_team"}}</label>
|
||||
<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
|
||||
</div>
|
||||
<div class="ui checkbox">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
|
||||
<input name="group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ldap group end -->
|
||||
|
||||
{{if .Source.IsLDAP}}
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="use_paged_search"><strong>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field required search-page-size{{if not $cfg.UsePagedSearch}} tw-hidden{{end}}">
|
||||
<label for="search_page_size">{{ctx.Locale.Tr "admin.auths.search_page_size"}}</label>
|
||||
<input id="search_page_size" name="search_page_size" value="{{if $cfg.UsePagedSearch}}{{$cfg.SearchPageSize}}{{end}}">
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
|
||||
<input name="attributes_in_bind" type="checkbox" {{if $cfg.AttributesInBind}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="allow_deactivate_all"><strong>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- SMTP -->
|
||||
{{if .Source.IsSMTP}}
|
||||
{{$cfg:=.Source.Cfg}}
|
||||
<div class="inline required field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.smtp_auth"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="smtp_auth" name="smtp_auth" value="{{$cfg.Auth}}" required>
|
||||
<div class="text">{{$cfg.Auth}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .SMTPAuths}}
|
||||
<div class="item" data-value="{{.}}">{{.}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="smtp_host">{{ctx.Locale.Tr "admin.auths.smtphost"}}</label>
|
||||
<input id="smtp_host" name="smtp_host" value="{{$cfg.Host}}" required>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="smtp_port">{{ctx.Locale.Tr "admin.auths.smtpport"}}</label>
|
||||
<input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<label for="force_smtps"><strong>{{ctx.Locale.Tr "admin.auths.force_smtps"}}</strong></label>
|
||||
<input id="force_smtps" name="force_smtps" type="checkbox" {{if $cfg.ForceSMTPS}}checked{{end}}>
|
||||
</div>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.force_smtps_helper"}}</p>
|
||||
</div>
|
||||
<div class="has-tls inline field {{if not .HasTLS}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
|
||||
<input name="skip_verify" type="checkbox" {{if $cfg.SkipVerify}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="helo_hostname">{{ctx.Locale.Tr "admin.auths.helo_hostname"}}</label>
|
||||
<input id="helo_hostname" name="helo_hostname" value="{{$cfg.HeloHostname}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.helo_hostname_helper"}}</p>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="disable_helo"><strong>{{ctx.Locale.Tr "admin.auths.disable_helo"}}</strong></label>
|
||||
<input id="disable_helo" name="disable_helo" type="checkbox" {{if $cfg.DisableHelo}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="allowed_domains">{{ctx.Locale.Tr "admin.auths.allowed_domains"}}</label>
|
||||
<input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- PAM -->
|
||||
{{if .Source.IsPAM}}
|
||||
{{$cfg:=.Source.Cfg}}
|
||||
<div class="required field">
|
||||
<label for="pam_service_name">{{ctx.Locale.Tr "admin.auths.pam_service_name"}}</label>
|
||||
<input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="pam_email_domain">{{ctx.Locale.Tr "admin.auths.pam_email_domain"}}</label>
|
||||
<input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}">
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- OAuth2 -->
|
||||
{{if .Source.IsOAuth2}}
|
||||
{{$cfg:=.Source.Cfg}}
|
||||
<div class="inline required field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_provider"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{$cfg.Provider}}" required>
|
||||
<div class="text">{{.CurrentOAuth2Provider.DisplayName}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .OAuth2Providers}}
|
||||
<div class="item" data-value="{{.Name}}">{{.DisplayName}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="oauth2_key">{{ctx.Locale.Tr "admin.auths.oauth2_clientID"}}</label>
|
||||
<input id="oauth2_key" name="oauth2_key" value="{{$cfg.ClientID}}" required>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="oauth2_secret">{{ctx.Locale.Tr "admin.auths.oauth2_clientSecret"}}</label>
|
||||
<input id="oauth2_secret" name="oauth2_secret" value="{{$cfg.ClientSecret}}" required>
|
||||
</div>
|
||||
<div class="optional field">
|
||||
<label for="oauth2_icon_url">{{ctx.Locale.Tr "admin.auths.oauth2_icon_url"}}</label>
|
||||
<input id="oauth2_icon_url" name="oauth2_icon_url" value="{{$cfg.IconURL}}">
|
||||
</div>
|
||||
<div class="open_id_connect_auto_discovery_url required field">
|
||||
<label for="open_id_connect_auto_discovery_url">{{ctx.Locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
|
||||
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_auth_url required field">
|
||||
<label for="oauth2_auth_url">{{ctx.Locale.Tr "admin.auths.oauth2_authURL"}}</label>
|
||||
<input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}{{end}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_token_url required field">
|
||||
<label for="oauth2_token_url">{{ctx.Locale.Tr "admin.auths.oauth2_tokenURL"}}</label>
|
||||
<input id="oauth2_token_url" name="oauth2_token_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.TokenURL}}{{end}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_profile_url required field">
|
||||
<label for="oauth2_profile_url">{{ctx.Locale.Tr "admin.auths.oauth2_profileURL"}}</label>
|
||||
<input id="oauth2_profile_url" name="oauth2_profile_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.ProfileURL}}{{end}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_email_url required field">
|
||||
<label for="oauth2_email_url">{{ctx.Locale.Tr "admin.auths.oauth2_emailURL"}}</label>
|
||||
<input id="oauth2_email_url" name="oauth2_email_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.EmailURL}}{{end}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_tenant required field">
|
||||
<label for="oauth2_tenant">{{ctx.Locale.Tr "admin.auths.oauth2_tenant"}}</label>
|
||||
<input id="oauth2_tenant" name="oauth2_tenant" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.Tenant}}{{end}}">
|
||||
</div>
|
||||
|
||||
{{range .OAuth2Providers}}
|
||||
<input id="{{.Name}}_SupportSSHPublicKey" value="{{.SupportSSHPublicKey}}" type="hidden">
|
||||
{{if .CustomURLSettings}}
|
||||
<input id="{{.Name}}_customURLSettings" type="hidden" data-required="{{.CustomURLSettings.Required}}" data-available="true">
|
||||
<input id="{{.Name}}_token_url" value="{{.CustomURLSettings.TokenURL.Value}}" data-available="{{.CustomURLSettings.TokenURL.Available}}" data-required="{{.CustomURLSettings.TokenURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_auth_url" value="{{.CustomURLSettings.AuthURL.Value}}" data-available="{{.CustomURLSettings.AuthURL.Available}}" data-required="{{.CustomURLSettings.AuthURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_profile_url" value="{{.CustomURLSettings.ProfileURL.Value}}" data-available="{{.CustomURLSettings.ProfileURL.Available}}" data-required="{{.CustomURLSettings.ProfileURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_email_url" value="{{.CustomURLSettings.EmailURL.Value}}" data-available="{{.CustomURLSettings.EmailURL.Available}}" data-required="{{.CustomURLSettings.EmailURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_tenant" value="{{.CustomURLSettings.Tenant.Value}}" data-available="{{.CustomURLSettings.Tenant.Available}}" data-required="{{.CustomURLSettings.Tenant.Required}}" type="hidden">
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
<label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label>
|
||||
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{StringUtils.Join $cfg.Scopes ","}}{{end}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_full_name_claim_name"}}</label>
|
||||
<input name="oauth2_full_name_claim_name" value="{{$cfg.FullNameClaimName}}" placeholder="name">
|
||||
</div>
|
||||
<div class="field oauth2_ssh_public_key_claim_name">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_ssh_public_key_claim_name"}}</label>
|
||||
<input name="oauth2_ssh_public_key_claim_name" value="{{$cfg.SSHPublicKeyClaimName}}" placeholder="sshpubkey">
|
||||
</div>
|
||||
<div class="open_id_connect_external_id_claim field">
|
||||
<label for="open_id_connect_external_id_claim">{{ctx.Locale.Tr "admin.auths.open_id_connect_external_id_claim"}}</label>
|
||||
<input id="open_id_connect_external_id_claim" name="open_id_connect_external_id_claim" value="{{$cfg.ExternalIDClaim}}" placeholder="sub">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.open_id_connect_external_id_claim_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
|
||||
<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{$cfg.RequiredClaimName}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_required_claim_value">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
|
||||
<input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{$cfg.RequiredClaimValue}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_group_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_group_claim_name"}}</label>
|
||||
<input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{$cfg.GroupClaimName}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_admin_group">{{ctx.Locale.Tr "admin.auths.oauth2_admin_group"}}</label>
|
||||
<input id="oauth2_admin_group" name="oauth2_admin_group" value="{{$cfg.AdminGroup}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_restricted_group">{{ctx.Locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
|
||||
<input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{$cfg.RestrictedGroup}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
|
||||
<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
|
||||
</div>
|
||||
<div class="ui checkbox">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
|
||||
<input name="oauth2_group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- SSPI -->
|
||||
{{if .Source.IsSSPI}}
|
||||
{{$cfg:=.Source.Cfg}}
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<label for="sspi_auto_create_users"><strong>{{ctx.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}}>
|
||||
<p class="help">{{ctx.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>{{ctx.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}}>
|
||||
<p class="help">{{ctx.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>{{ctx.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}}>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="sspi_separator_replacement">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
|
||||
<input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{$cfg.SeparatorReplacement}}" required>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sspi_default_language">{{ctx.Locale.Tr "admin.auths.sspi_default_language"}}</label>
|
||||
<div class="ui language selection dropdown" id="sspi_default_language">
|
||||
<input name="sspi_default_language" type="hidden" value="{{$cfg.DefaultLanguage}}">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">{{range .AllLangs}}{{if eq $cfg.DefaultLanguage .Lang}}{{.Name}}{{end}}{{end}}</div>
|
||||
<div class="menu">
|
||||
<div class="item{{if not $.SSPIDefaultLanguage}} active selected{{end}}" data-value="">-</div>
|
||||
{{range .AllLangs}}
|
||||
<div class="item{{if eq $cfg.DefaultLanguage .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_default_language_helper"}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if (or .Source.IsLDAP .Source.IsOAuth2)}}
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.syncenabled"}}</strong></label>
|
||||
<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>{{ctx.Locale.Tr "admin.auths.activated"}}</strong></label>
|
||||
<input name="is_active" type="checkbox" {{if .Source.IsActive}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.auths.update"}}</button>
|
||||
<button class="ui red button link-action" data-url="{{$.Link}}/delete?id={{.Source.ID}}"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "admin.auths.delete_auth_title"}}"
|
||||
data-modal-confirm-content="{{ctx.Locale.Tr "admin.auths.delete_auth_desc"}}"
|
||||
>{{ctx.Locale.Tr "admin.auths.delete"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.auths.tips"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<h5>GMail Settings:</h5>
|
||||
<p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
|
||||
|
||||
<h5 class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
|
||||
<p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin authentication")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.auths.auth_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/-/admin/auths/new">{{ctx.Locale.Tr "admin.auths.new"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>{{ctx.Locale.Tr "admin.auths.name"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.auths.type"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.auths.enabled"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.auths.updated"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.edit"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Sources}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td><a href="{{AppSubUrl}}/-/admin/auths/{{.ID}}">{{.Name}}</a></td>
|
||||
<td>{{.TypeName}}</td>
|
||||
<td>{{svg (Iif .IsActive "octicon-check" "octicon-x")}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .UpdatedUnix}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td>
|
||||
<td><a href="{{AppSubUrl}}/-/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td class="tw-text-center" colspan="7">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,150 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin new authentication")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.auths.new"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{template "base/disable_form_autofill"}}
|
||||
<!-- Types and name -->
|
||||
<div class="inline required field {{if .Err_Type}}error{{end}}">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.auth_type"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="auth_type" name="type" value="{{.type}}">
|
||||
<div class="text">{{.CurrentTypeName}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .AuthSources}}
|
||||
<div class="item" data-value="{{.Type.Int}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required inline field {{if .Err_Name}}error{{end}}">
|
||||
<label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label>
|
||||
<input id="auth_name" name="name" value="{{.name}}" autofocus required>
|
||||
</div>
|
||||
|
||||
<!-- LDAP and DLDAP -->
|
||||
{{template "admin/auth/source/ldap" .}}
|
||||
|
||||
<!-- SMTP -->
|
||||
{{template "admin/auth/source/smtp" .}}
|
||||
|
||||
<!-- PAM -->
|
||||
<div class="pam required field {{if not (eq .type 4)}}tw-hidden{{end}}">
|
||||
<label for="pam_service_name">{{ctx.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">{{ctx.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)}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label for="skip_local_two_fa"><strong>{{ctx.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}}>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OAuth2 -->
|
||||
{{template "admin/auth/source/oauth" .}}
|
||||
|
||||
<!-- SSPI -->
|
||||
{{template "admin/auth/source/sspi" .}}
|
||||
|
||||
<div class="ldap field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
|
||||
<input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oauth2 ldap inline field {{if not (or (eq .type 2) (eq .type 6))}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.syncenabled"}}</strong></label>
|
||||
<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>{{ctx.Locale.Tr "admin.auths.activated"}}</strong></label>
|
||||
<input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.auths.new"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.auths.tips"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<h5>GMail Settings:</h5>
|
||||
<p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
|
||||
|
||||
<div class="oauth2">
|
||||
<h5>{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}</h5>
|
||||
<p>{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
|
||||
</div>
|
||||
<div class="oauth2 tw-mt-4">
|
||||
<h5>{{ctx.Locale.Tr "admin.auths.tip.oauth2_provider"}}</h5>
|
||||
<ul>
|
||||
<li>
|
||||
Bitbucket
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.bitbucket" "https://bitbucket.org/account/user/{your-username}/oauth-consumers/new"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Dropbox
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.dropbox" "https://www.dropbox.com/developers/apps"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Facebook
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.facebook" "https://developers.facebook.com/apps"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
GitHub
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.github" "https://github.com/settings/applications/new"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
GitLab
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.gitlab_new" "https://gitlab.com/-/profile/applications"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Google
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.google_plus" "https://console.developers.google.com/"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
OpenID Connect
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.openid_connect"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Twitter
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.twitter" "https://dev.twitter.com/apps"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Discord
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.discord" "https://discordapp.com/developers/applications/me"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Gitea
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.gitea" "https://docs.gitea.com/development/oauth2-provider"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Nextcloud
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.nextcloud"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Yandex
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.yandex" "https://oauth.yandex.com/client/new"}}</div>
|
||||
</li>
|
||||
<li>
|
||||
Mastodon
|
||||
<div>{{ctx.Locale.Tr "admin.auths.tip.mastodon"}}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,147 @@
|
||||
<div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}tw-hidden{{end}}">
|
||||
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
|
||||
<label>{{ctx.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}}">
|
||||
<div class="text">{{.CurrentSecurityProtocol}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .SecurityProtocols}}
|
||||
<div class="item" data-value="{{.Type.Int}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="host">{{ctx.Locale.Tr "admin.auths.host"}}</label>
|
||||
<input id="host" name="host" value="{{.host}}" placeholder="mydomain.com">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="port">{{ctx.Locale.Tr "admin.auths.port"}}</label>
|
||||
<input id="port" name="port" value="{{.port}}" placeholder="636">
|
||||
</div>
|
||||
<div class="has-tls inline field {{if not .HasTLS}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
|
||||
<input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ldap field {{if not (eq .type 2)}}tw-hidden{{end}}">
|
||||
<label for="bind_dn">{{ctx.Locale.Tr "admin.auths.bind_dn"}}</label>
|
||||
<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="cn=Search,dc=mydomain,dc=com">
|
||||
</div>
|
||||
<div class="ldap field {{if not (eq .type 2)}}tw-hidden{{end}}">
|
||||
<label for="bind_password">{{ctx.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">
|
||||
<label for="user_base">{{ctx.Locale.Tr "admin.auths.user_base"}}</label>
|
||||
<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="ou=Users,dc=mydomain,dc=com">
|
||||
</div>
|
||||
<div class="dldap required field {{if not (eq .type 5)}}tw-hidden{{end}}">
|
||||
<label for="user_dn">{{ctx.Locale.Tr "admin.auths.user_dn"}}</label>
|
||||
<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="filter">{{ctx.Locale.Tr "admin.auths.filter"}}</label>
|
||||
<input id="filter" name="filter" value="{{.filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="admin_filter">{{ctx.Locale.Tr "admin.auths.admin_filter"}}</label>
|
||||
<input id="admin_filter" name="admin_filter" value="{{.admin_filter}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="restricted_filter">{{ctx.Locale.Tr "admin.auths.restricted_filter"}}</label>
|
||||
<input id="restricted_filter" name="restricted_filter" value="{{.restricted_filter}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.restricted_filter_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_username">{{ctx.Locale.Tr "admin.auths.attribute_username"}}</label>
|
||||
<input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{ctx.Locale.Tr "admin.auths.attribute_username_placeholder"}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_name">{{ctx.Locale.Tr "admin.auths.attribute_name"}}</label>
|
||||
<input id="attribute_name" name="attribute_name" value="{{.attribute_name}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_surname">{{ctx.Locale.Tr "admin.auths.attribute_surname"}}</label>
|
||||
<input id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="attribute_mail">{{ctx.Locale.Tr "admin.auths.attribute_mail"}}</label>
|
||||
<input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="mail">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_ssh_public_key">{{ctx.Locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
|
||||
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="SshPublicKey">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="attribute_avatar">{{ctx.Locale.Tr "admin.auths.attribute_avatar"}}</label>
|
||||
<input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="jpegPhoto">
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="ssh_keys_are_verified"><strong>{{ctx.Locale.Tr "admin.auths.ssh_keys_are_verified"}}</strong></label>
|
||||
<input id="ssh_keys_are_verified" name="ssh_keys_are_verified" type="checkbox" {{if .ssh_keys_are_verified}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ldap group begin -->
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap-group-options" class="ui segment secondary">
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.group_search_base"}}</label>
|
||||
<input name="group_dn" value="{{.group_dn}}" placeholder="ou=group,dc=mydomain,dc=com">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.group_attribute_list_users"}}</label>
|
||||
<input name="group_member_uid" value="{{.group_member_uid}}" placeholder="memberUid">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.user_attribute_in_group"}}</label>
|
||||
<input name="user_uid" value="{{.user_uid}}" placeholder="uid">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.verify_group_membership"}}</label>
|
||||
<input name="group_filter" value="{{.group_filter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.map_group_to_team"}}</label>
|
||||
<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.group_team_map}}</textarea>
|
||||
</div>
|
||||
<div class="ui checkbox">
|
||||
<label>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ldap group end -->
|
||||
|
||||
<div class="ldap inline field {{if not (eq .type 2)}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label for="use_paged_search"><strong>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ldap field search-page-size required {{if or (not (eq .type 2)) (not .use_paged_search)}}tw-hidden{{end}}">
|
||||
<label for="search_page_size">{{ctx.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>{{ctx.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}}>
|
||||
<p class="help">{{ctx.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>{{ctx.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}}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,126 @@
|
||||
<div class="oauth2 field {{if not (eq .type 6)}}tw-hidden{{end}}">
|
||||
<div class="inline required field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_provider"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{.oauth2_provider}}">
|
||||
<div class="text">{{.oauth2_provider}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .OAuth2Providers}}
|
||||
<div class="item" data-value="{{.Name}}">{{.DisplayName}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="oauth2_key">{{ctx.Locale.Tr "admin.auths.oauth2_clientID"}}</label>
|
||||
<input id="oauth2_key" name="oauth2_key" value="{{.oauth2_key}}">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="oauth2_secret">{{ctx.Locale.Tr "admin.auths.oauth2_clientSecret"}}</label>
|
||||
<input id="oauth2_secret" name="oauth2_secret" value="{{.oauth2_secret}}">
|
||||
</div>
|
||||
<div class="optional field">
|
||||
<label for="oauth2_icon_url">{{ctx.Locale.Tr "admin.auths.oauth2_icon_url"}}</label>
|
||||
<input id="oauth2_icon_url" name="oauth2_icon_url" value="{{.oauth2_icon_url}}">
|
||||
</div>
|
||||
<div class="open_id_connect_auto_discovery_url required field{{if .Err_DiscoveryURL}} error{{end}}">
|
||||
<label for="open_id_connect_auto_discovery_url">{{ctx.Locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
|
||||
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{.open_id_connect_auto_discovery_url}}">
|
||||
</div>
|
||||
<div class="optional field">
|
||||
<div class="ui checkbox">
|
||||
<label for="skip_local_two_fa"><strong>{{ctx.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}}>
|
||||
<p class="help">{{ctx.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>{{ctx.Locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
|
||||
<input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox">
|
||||
</div>
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_auth_url required field">
|
||||
<label for="oauth2_auth_url">{{ctx.Locale.Tr "admin.auths.oauth2_authURL"}}</label>
|
||||
<input id="oauth2_auth_url" name="oauth2_auth_url" value="{{.oauth2_auth_url}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_token_url required field">
|
||||
<label for="oauth2_token_url">{{ctx.Locale.Tr "admin.auths.oauth2_tokenURL"}}</label>
|
||||
<input id="oauth2_token_url" name="oauth2_token_url" value="{{.oauth2_token_url}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_profile_url required field">
|
||||
<label for="oauth2_profile_url">{{ctx.Locale.Tr "admin.auths.oauth2_profileURL"}}</label>
|
||||
<input id="oauth2_profile_url" name="oauth2_profile_url" value="{{.oauth2_profile_url}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_email_url required field">
|
||||
<label for="oauth2_email_url">{{ctx.Locale.Tr "admin.auths.oauth2_emailURL"}}</label>
|
||||
<input id="oauth2_email_url" name="oauth2_email_url" value="{{.oauth2_email_url}}">
|
||||
</div>
|
||||
<div class="oauth2_use_custom_url_field oauth2_tenant required field">
|
||||
<label for="oauth2_tenant">{{ctx.Locale.Tr "admin.auths.oauth2_tenant"}}</label>
|
||||
<input id="oauth2_tenant" name="oauth2_tenant" value="{{.oauth2_tenant}}">
|
||||
</div>
|
||||
|
||||
{{range .OAuth2Providers}}
|
||||
<input id="{{.Name}}_SupportSSHPublicKey" value="{{.SupportSSHPublicKey}}" type="hidden">
|
||||
{{if .CustomURLSettings}}
|
||||
<input id="{{.Name}}_customURLSettings" type="hidden" data-required="{{.CustomURLSettings.Required}}" data-available="true">
|
||||
<input id="{{.Name}}_token_url" value="{{.CustomURLSettings.TokenURL.Value}}" data-available="{{.CustomURLSettings.TokenURL.Available}}" data-required="{{.CustomURLSettings.TokenURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_auth_url" value="{{.CustomURLSettings.AuthURL.Value}}" data-available="{{.CustomURLSettings.AuthURL.Available}}" data-required="{{.CustomURLSettings.AuthURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_profile_url" value="{{.CustomURLSettings.ProfileURL.Value}}" data-available="{{.CustomURLSettings.ProfileURL.Available}}" data-required="{{.CustomURLSettings.ProfileURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_email_url" value="{{.CustomURLSettings.EmailURL.Value}}" data-available="{{.CustomURLSettings.EmailURL.Available}}" data-required="{{.CustomURLSettings.EmailURL.Required}}" type="hidden">
|
||||
<input id="{{.Name}}_tenant" value="{{.CustomURLSettings.Tenant.Value}}" data-available="{{.CustomURLSettings.Tenant.Available}}" data-required="{{.CustomURLSettings.Tenant.Required}}" type="hidden">
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
<label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label>
|
||||
<input id="oauth2_scopes" name="oauth2_scopes" value="{{.oauth2_scopes}}">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_full_name_claim_name"}}</label>
|
||||
<input name="oauth2_full_name_claim_name" value="{{.oauth2_full_name_claim_name}}" placeholder="name">
|
||||
</div>
|
||||
<div class="field oauth2_ssh_public_key_claim_name">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_ssh_public_key_claim_name"}}</label>
|
||||
<input name="oauth2_ssh_public_key_claim_name" value="{{.oauth2_ssh_public_key_claim_name}}" placeholder="sshpubkey">
|
||||
</div>
|
||||
<div class="open_id_connect_external_id_claim field">
|
||||
<label for="open_id_connect_external_id_claim">{{ctx.Locale.Tr "admin.auths.open_id_connect_external_id_claim"}}</label>
|
||||
<input id="open_id_connect_external_id_claim" name="open_id_connect_external_id_claim" value="{{.open_id_connect_external_id_claim}}" placeholder="sub">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.open_id_connect_external_id_claim_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
|
||||
<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{.oauth2_required_claim_name}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_required_claim_value">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
|
||||
<input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{.oauth2_required_claim_value}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_group_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_group_claim_name"}}</label>
|
||||
<input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{.oauth2_group_claim_name}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_admin_group">{{ctx.Locale.Tr "admin.auths.oauth2_admin_group"}}</label>
|
||||
<input id="oauth2_admin_group" name="oauth2_admin_group" value="{{.oauth2_admin_group}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="oauth2_restricted_group">{{ctx.Locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
|
||||
<input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{.oauth2_restricted_group}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
|
||||
<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.oauth2_group_team_map}}</textarea>
|
||||
</div>
|
||||
<div class="ui checkbox">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
|
||||
<input name="oauth2_group_team_map_removal" type="checkbox" {{if .oauth2_group_team_map_removal}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<div class="smtp field {{if not (eq .type 3)}}tw-hidden{{end}}">
|
||||
<div class="inline required field">
|
||||
<label>{{ctx.Locale.Tr "admin.auths.smtp_auth"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="smtp_auth" name="smtp_auth" value="{{.smtp_auth}}">
|
||||
<div class="text">{{.smtp_auth}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range .SMTPAuths}}
|
||||
<div class="item" data-value="{{.}}">{{.}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="smtp_host">{{ctx.Locale.Tr "admin.auths.smtphost"}}</label>
|
||||
<input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="smtp_port">{{ctx.Locale.Tr "admin.auths.smtpport"}}</label>
|
||||
<input id="smtp_port" name="smtp_port" value="{{.smtp_port}}">
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="force_smtps"><strong>{{ctx.Locale.Tr "admin.auths.force_smtps"}}</strong></label>
|
||||
<input id="force_smtps" name="force_smtps" type="checkbox" {{if .force_smtps}}checked{{end}}>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.force_smtps_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
|
||||
<input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="helo_hostname">{{ctx.Locale.Tr "admin.auths.helo_hostname"}}</label>
|
||||
<input id="helo_hostname" name="helo_hostname" value="{{.helo_hostname}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.helo_hostname_helper"}}</p>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label for="disable_helo"><strong>{{ctx.Locale.Tr "admin.auths.disable_helo"}}</strong></label>
|
||||
<input id="disable_helo" name="disable_helo" type="checkbox" {{if .disable_helo}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="allowed_domains">{{ctx.Locale.Tr "admin.auths.allowed_domains"}}</label>
|
||||
<input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p>
|
||||
</div>
|
||||
<div class="optional field">
|
||||
<div class="ui checkbox">
|
||||
<label for="skip_local_two_fa"><strong>{{ctx.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}}>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
<div class="sspi field {{if not (eq .type 7)}}tw-hidden{{end}}">
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<label for="sspi_auto_create_users"><strong>{{ctx.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 .SSPIAutoCreateUsers}}checked{{end}}>
|
||||
<p class="help">{{ctx.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>{{ctx.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 .SSPIAutoActivateUsers}}checked{{end}}>
|
||||
<p class="help">{{ctx.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>{{ctx.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 .SSPIStripDomainNames}}checked{{end}}>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="sspi_separator_replacement">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
|
||||
<input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{.SSPISeparatorReplacement}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sspi_default_language">{{ctx.Locale.Tr "admin.auths.sspi_default_language"}}</label>
|
||||
<div class="ui language selection dropdown" id="sspi_default_language">
|
||||
<input name="sspi_default_language" type="hidden" value="{{.SSPIDefaultLanguage}}">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">{{range .AllLangs}}{{if eq $.SSPIDefaultLanguage .Lang}}{{.Name}}{{end}}{{end}}</div>
|
||||
<div class="menu">
|
||||
<div class="item{{if not $.SSPIDefaultLanguage}} active selected{{end}}" data-value="">-</div>
|
||||
{{range .AllLangs}}
|
||||
<div class="item{{if eq $.SSPIDefaultLanguage .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_default_language_helper"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin edit badge")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.badges.edit_badge"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form form-fetch-action" action="./edit" method="post">
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.badges.slug"}}</label>
|
||||
<input value="{{.Badge.Slug}}" readonly>
|
||||
</div>
|
||||
<div class="field {{if .Err_Description}}error{{end}}">
|
||||
<label>{{ctx.Locale.Tr "admin.badges.description"}}</label>
|
||||
<textarea name="description" rows="2">{{.Badge.Description}}</textarea>
|
||||
</div>
|
||||
<div class="field {{if .Err_ImageURL}}error{{end}}">
|
||||
<label>{{ctx.Locale.Tr "admin.badges.image_url"}}</label>
|
||||
<input type="url" name="image_url" value="{{.Badge.ImageURL}}">
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.badges.update_badge"}}</button>
|
||||
<button class="ui red button show-modal" data-modal="#delete-badge-modal">{{ctx.Locale.Tr "admin.badges.delete_badge"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm modal" id="delete-badge-modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "admin.badges.delete_badge"}}
|
||||
</div>
|
||||
<form class="ui form" method="post" action="./delete">
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "admin.badges.delete_badge_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,67 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin badge")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.badges.badges_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/-/admin/badges/new">{{ctx.Locale.Tr "admin.badges.new_badge"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form ignore-dirty flex-text-block" id="user-list-search-form">
|
||||
<div class="tw-flex-1">
|
||||
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.badge_kind")}}
|
||||
</div>
|
||||
<!-- Right Menu -->
|
||||
<div class="ui secondary menu tw-m-0">
|
||||
<!-- Sort Menu Item -->
|
||||
<div class="ui dropdown type jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<button class="{{if eq $.SortType "oldest"}}active {{end}}item" name="sort" value="oldest">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</button>
|
||||
<button class="{{if eq $.SortType "newest"}}active {{end}}item" name="sort" value="newest">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</button>
|
||||
<button class="{{if eq $.SortType "alphabetically"}}active {{end}}item" name="sort" value="alphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</button>
|
||||
<button class="{{if eq $.SortType "reversealphabetically"}}active {{end}}item" name="sort" value="reversealphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic striped table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortt-asc="oldest" data-sortt-desc="newest" data-sortt-default="true">ID{{SortArrow "oldest" "newest" .SortType false}}</th>
|
||||
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
|
||||
{{ctx.Locale.Tr "admin.badges.slug"}}
|
||||
{{SortArrow "alphabetically" "reversealphabetically" $.SortType true}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.badges.description"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Badges}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td>
|
||||
<a href="{{$.Link}}/slug/{{.Slug | PathEscape}}">{{.Slug}}</a>
|
||||
</td>
|
||||
<td class="gt-ellipsis tw-max-w-48">{{.Description}}</td>
|
||||
<td>
|
||||
<div class="tw-flex tw-gap-2">
|
||||
<a href="{{$.Link}}/slug/{{.Slug | PathEscape}}" data-tooltip-content="{{ctx.Locale.Tr "admin.badges.details"}}">{{svg "octicon-star"}}</a>
|
||||
<a href="{{$.Link}}/slug/{{.Slug | PathEscape}}/edit" data-tooltip-content="{{ctx.Locale.Tr "edit"}}">{{svg "octicon-pencil"}}</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin new badge")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.badges.new_badge"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post">
|
||||
<div class="required field">
|
||||
<label>{{ctx.Locale.Tr "admin.badges.slug"}}</label>
|
||||
<input autofocus required name="slug">
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label>{{ctx.Locale.Tr "admin.badges.description"}}</label>
|
||||
<textarea name="description" rows="2" required></textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.badges.image_url"}}</label>
|
||||
<input type="url" name="image_url">
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.badges.new_badge"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin badge")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.Title}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form flex-text-block" action="{{.Link}}" method="post">
|
||||
<div id="search-user-box" class="ui search input">
|
||||
<input class="prompt" name="user" placeholder="{{ctx.Locale.Tr "search.user_kind"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.badges.add_user"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{if .Users}}
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .Users}}
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-leading">
|
||||
<a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 32}}</a>
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
{{template "shared/user/name" .}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-trailing">
|
||||
<a class="ui red tiny button inline link-action" data-url="{{$.Link}}/delete?id={{.ID}}" data-modal-confirm="{{ctx.Locale.Tr "admin.badges.delete_user_desc"}}">
|
||||
{{ctx.Locale.Tr "admin.badges.remove_user"}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{template "admin/layout_head" (dict)}}
|
||||
|
||||
<div class="admin-setting-content">
|
||||
<div class="admin-responsive-columns">
|
||||
<div class="tw-flex-1">
|
||||
<h4 class="ui top attached header">
|
||||
{{.Title}}
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{.Link}}/edit">{{ctx.Locale.Tr "admin.badges.edit_badge"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{if .Badge.ImageURL}}
|
||||
<div class="item-leading">
|
||||
<img width="64" height="64" src="{{.Badge.ImageURL}}" alt="{{.Badge.Description}}" data-tooltip-content="{{.Badge.Description}}">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
{{.Badge.Slug}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
{{.Badge.Description}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "explore.users"}} ({{.UsersTotal}})
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{.Link}}/users">{{ctx.Locale.Tr "admin.badges.manage_users"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{template "explore/user_list" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,331 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin config")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.server_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.app_name"}}</dt>
|
||||
<dd>{{AppName}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.app_ver"}}</dt>
|
||||
<dd>{{AppVer}}{{.AppBuiltWith}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_conf"}}</dt>
|
||||
<dd>{{.CustomConf}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.disable_router_log"}}</dt>
|
||||
<dd>{{svg (Iif .DisableRouterLog "octicon-check" "octicon-x")}}</dd>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<dt>{{ctx.Locale.Tr "admin.config.run_user"}}</dt>
|
||||
<dd>{{.RunUser}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.run_mode"}}</dt>
|
||||
<dd>{{.RunMode}}</dd>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_version"}}</dt>
|
||||
<dd>{{.GitVersion}}</dd>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<dt>{{ctx.Locale.Tr "admin.config.app_data_path"}}</dt>
|
||||
<dd>{{.AppDataPath}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.repo_root_path"}}</dt>
|
||||
<dd>{{.RepoRootPath}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_file_root_path"}}</dt>
|
||||
<dd>{{.CustomRootPath}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.log_file_root_path"}}</dt>
|
||||
<dd>{{.LogRootPath}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.script_type"}}</dt>
|
||||
<dd>{{.ScriptType}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.reverse_auth_user"}}</dt>
|
||||
<dd>{{.ReverseProxyAuthUser}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.ssh_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_enabled"}}</dt>
|
||||
<dd>{{svg (Iif (not .SSH.Disabled) "octicon-check" "octicon-x")}}</dd>
|
||||
{{if not .SSH.Disabled}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_start_builtin_server"}}</dt>
|
||||
<dd>{{svg (Iif .SSH.StartBuiltinServer "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_domain"}}</dt>
|
||||
<dd>{{.SSH.Domain}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_port"}}</dt>
|
||||
<dd>{{.SSH.Port}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_listen_port"}}</dt>
|
||||
<dd>{{.SSH.ListenPort}}</dd>
|
||||
|
||||
{{if not .SSH.StartBuiltinServer}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_root_path"}}</dt>
|
||||
<dd>{{.SSH.RootPath}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt>
|
||||
<dd>{{svg (Iif .SSH.MinimumKeySizeCheck "octicon-check" "octicon-x")}}</dd>
|
||||
{{if .SSH.MinimumKeySizeCheck}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_sizes"}}</dt>
|
||||
<dd>{{.SSH.MinimumKeySizes}}</dd>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.lfs_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.lfs_enabled"}}</dt>
|
||||
<dd>{{svg (Iif .LFS.StartServer "octicon-check" "octicon-x")}}</dd>
|
||||
{{if .LFS.StartServer}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.lfs_content_path"}}</dt>
|
||||
<dd>{{JsonUtils.EncodeToString .LFS.Storage.ToShadowCopy}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.lfs_http_auth_expiry"}}</dt>
|
||||
<dd>{{.LFS.HTTPAuthExpiry}}</dd>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.db_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_type"}}</dt>
|
||||
<dd>{{.DbCfg.Type}}</dd>
|
||||
{{if not (eq .DbCfg.Type "sqlite3")}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_host"}}</dt>
|
||||
<dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_name"}}</dt>
|
||||
<dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_user"}}</dt>
|
||||
<dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd>
|
||||
{{end}}
|
||||
{{if eq .DbCfg.Type "postgres"}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_schema"}}</dt>
|
||||
<dd>{{if .DbCfg.Schema}}{{.DbCfg.Schema}}{{else}}-{{end}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_ssl_mode"}}</dt>
|
||||
<dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd>
|
||||
{{end}}
|
||||
{{if eq .DbCfg.Type "sqlite3"}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.db_path"}}</dt>
|
||||
<dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}}</dd>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.service_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.register_email_confirm"}}</dt>
|
||||
<dd>{{svg (Iif .Service.RegisterEmailConfirm "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.disable_register"}}</dt>
|
||||
<dd>{{svg (Iif .Service.DisableRegistration "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.allow_only_internal_registration"}}</dt>
|
||||
<dd>{{svg (Iif .Service.AllowOnlyInternalRegistration "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.allow_only_external_registration"}}</dt>
|
||||
<dd>{{svg (Iif .Service.AllowOnlyExternalRegistration "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.show_registration_button"}}</dt>
|
||||
<dd>{{svg (Iif .Service.ShowRegistrationButton "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.enable_openid_signup"}}</dt>
|
||||
<dd>{{svg (Iif .Service.EnableOpenIDSignUp "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.enable_openid_signin"}}</dt>
|
||||
<dd>{{svg (Iif .Service.EnableOpenIDSignIn "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.require_sign_in_view"}}</dt>
|
||||
<dd>{{svg (Iif .Service.RequireSignInViewStrict "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mail_notify"}}</dt>
|
||||
<dd>{{svg (Iif .Service.EnableNotifyMail "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.enable_captcha"}}</dt>
|
||||
<dd>{{svg (Iif .Service.EnableCaptcha "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.default_keep_email_private"}}</dt>
|
||||
<dd>{{svg (Iif .Service.DefaultKeepEmailPrivate "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.default_allow_create_organization"}}</dt>
|
||||
<dd>{{svg (Iif .Service.DefaultAllowCreateOrganization "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.enable_timetracking"}}</dt>
|
||||
<dd>{{svg (Iif .Service.EnableTimetracking "octicon-check" "octicon-x")}}</dd>
|
||||
{{if .Service.EnableTimetracking}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.default_enable_timetracking"}}</dt>
|
||||
<dd>{{svg (Iif .Service.DefaultEnableTimetracking "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt>
|
||||
<dd>{{svg (Iif .Service.DefaultAllowOnlyContributorsToTrackTime "octicon-check" "octicon-x")}}</dd>
|
||||
{{end}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.default_visibility_organization"}}</dt>
|
||||
<dd>{{.Service.DefaultOrgVisibility}}</dd>
|
||||
|
||||
<dt>{{ctx.Locale.Tr "admin.config.no_reply_address"}}</dt>
|
||||
<dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.default_enable_dependencies"}}</dt>
|
||||
<dd>{{svg (Iif .Service.DefaultEnableDependencies "octicon-check" "octicon-x")}}</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.active_code_lives"}}</dt>
|
||||
<dd>{{.Service.ActiveCodeLives}} {{ctx.Locale.Tr "tool.raw_minutes"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.reset_password_code_lives"}}</dt>
|
||||
<dd>{{.Service.ResetPwdCodeLives}} {{ctx.Locale.Tr "tool.raw_minutes"}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.webhook_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.queue_length"}}</dt>
|
||||
<dd>{{.Webhook.QueueLength}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.deliver_timeout"}}</dt>
|
||||
<dd>{{.Webhook.DeliverTimeout}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.skip_tls_verify"}}</dt>
|
||||
<dd>{{svg (Iif .Webhook.SkipTLSVerify "octicon-check" "octicon-x")}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.mailer_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_enabled"}}</dt>
|
||||
<dd>{{svg (Iif .MailerEnabled "octicon-check" "octicon-x")}}</dd>
|
||||
{{if .MailerEnabled}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_name"}}</dt>
|
||||
<dd>{{.Mailer.Name}}</dd>
|
||||
{{if eq .Mailer.Protocol "sendmail"}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_use_sendmail"}}</dt>
|
||||
<dd>{{svg "octicon-check"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_path"}}</dt>
|
||||
<dd>{{.Mailer.SendmailPath}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_args"}}</dt>
|
||||
<dd>{{.Mailer.SendmailArgs}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt>
|
||||
<dd>{{.Mailer.SendmailTimeout}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
{{else if eq .Mailer.Protocol "dummy"}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_use_dummy"}}</dt>
|
||||
<dd>{{svg "octicon-check"}}</dd>
|
||||
{{else}}{{/* SMTP family */}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_protocol"}}</dt>
|
||||
<dd>{{.Mailer.Protocol}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_enable_helo"}}</dt>
|
||||
<dd>{{svg (Iif .Mailer.EnableHelo "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_smtp_addr"}}</dt>
|
||||
<dd>{{.Mailer.SMTPAddr}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_smtp_port"}}</dt>
|
||||
<dd>{{.Mailer.SMTPPort}}</dd>
|
||||
{{end}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.mailer_user"}}</dt>
|
||||
<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd>
|
||||
<div class="divider"></div>
|
||||
<dt class="flex-text-block tw-py-1">{{ctx.Locale.Tr "admin.config.send_test_mail"}}</dt>
|
||||
<dd class="tw-py-0">
|
||||
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/-/admin/config/test_mail" method="post">
|
||||
<div class="ui tiny input">
|
||||
<input type="email" name="email" placeholder="{{ctx.Locale.Tr "admin.config.test_email_placeholder"}}" size="29" required>
|
||||
</div>
|
||||
<button class="ui tiny primary button">{{ctx.Locale.Tr "admin.config.send_test_mail_submit"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.cache_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.cache_adapter"}}</dt>
|
||||
<dd>{{.CacheAdapter}}</dd>
|
||||
{{if eq .CacheAdapter "memory"}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.cache_interval"}}</dt>
|
||||
<dd>{{.CacheInterval}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
{{end}}
|
||||
{{if .CacheConn}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.cache_item_ttl"}}</dt>
|
||||
<dd>{{.CacheItemTTL}}</dd>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
<dt class="flex-text-block tw-py-1">{{ctx.Locale.Tr "admin.config.cache_test"}}</dt>
|
||||
<dd class="tw-py-0">
|
||||
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/-/admin/config/test_cache" method="post">
|
||||
<button class="ui tiny primary button">{{ctx.Locale.Tr "test"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.session_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.session_provider"}}</dt>
|
||||
<dd>{{.SessionConfig.Provider}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.cookie_name"}}</dt>
|
||||
<dd>{{.SessionConfig.CookieName}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.gc_interval_time"}}</dt>
|
||||
<dd>{{.SessionConfig.Gclifetime}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.session_life_time"}}</dt>
|
||||
<dd>{{.SessionConfig.Maxlifetime}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.https_only"}}</dt>
|
||||
<dd>{{svg (Iif .SessionConfig.Secure "octicon-check" "octicon-x")}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.git_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_disable_diff_highlight"}}</dt>
|
||||
<dd>{{svg (Iif .Git.DisableDiffHighlight "octicon-check" "octicon-x")}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_max_diff_lines"}}</dt>
|
||||
<dd>{{.Git.MaxGitDiffLines}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_max_diff_line_characters"}}</dt>
|
||||
<dd>{{.Git.MaxGitDiffLineCharacters}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_max_diff_files"}}</dt>
|
||||
<dd>{{.Git.MaxGitDiffFiles}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_gc_args"}}</dt>
|
||||
<dd>{{.Git.GCArgs}}</dd>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_migrate_timeout"}}</dt>
|
||||
<dd>{{.Git.Timeout.Migrate}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_mirror_timeout"}}</dt>
|
||||
<dd>{{.Git.Timeout.Mirror}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.git_gc_timeout"}}</dt>
|
||||
<dd>{{.Git.Timeout.GC}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.log_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
{{if .Loggers.xorm.IsEnabled}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.xorm_log_sql"}}</dt>
|
||||
<dd>{{svg (Iif $.LogSQL "octicon-check" "octicon-x")}}</dd>
|
||||
{{end}}
|
||||
|
||||
{{if .Loggers.access.IsEnabled}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.access_log_template"}}</dt>
|
||||
<dd>{{$.AccessLogTemplate}}</dd>
|
||||
{{end}}
|
||||
|
||||
{{range $loggerName, $loggerDetail := .Loggers}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.logger_name_fmt" $loggerName}}</dt>
|
||||
{{if $loggerDetail.IsEnabled}}
|
||||
<dd><pre class="tw-m-0">{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}</pre></dd>
|
||||
{{else}}
|
||||
<dd>{{ctx.Locale.Tr "admin.config.disabled_logger"}}</dd>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,24 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.picture_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
{{$cfgOpt := .SystemConfig.Picture.DisableGravatar}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.enable_gravatar"}}</dt>
|
||||
<dd>
|
||||
<div class="ui toggle checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.config.enable_gravatar"}}">
|
||||
<input type="checkbox" data-config-dyn-key="{{$cfgOpt.DynKey}}" data-config-value-type="flipped" {{if not ($cfgOpt.Value ctx)}}checked{{end}}><label></label>
|
||||
</div>
|
||||
</dd>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
{{$cfgOpt = .SystemConfig.Picture.EnableFederatedAvatar}}
|
||||
<dt>{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}</dt>
|
||||
<dd>
|
||||
<div class="ui toggle checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}">
|
||||
<input type="checkbox" data-config-dyn-key="{{$cfgOpt.DynKey}}" data-config-value-type="boolean" {{if $cfgOpt.Value ctx}}checked{{end}}><label></label>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin config" "dataGlobalInit" "initAdminConfigSettings")}}
|
||||
|
||||
{{template "admin/config_settings/avatars" .}}
|
||||
{{template "admin/config_settings/repository" .}}
|
||||
{{template "admin/config_settings/instance" .}}
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,63 @@
|
||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "admin.config.instance_maintenance"}}</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form ignore-dirty system-config-form" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{$cfgOpt := $.SystemConfig.Instance.MaintenanceMode}}
|
||||
{{$cfgKey := $cfgOpt.DynKey}}
|
||||
{{$maintenanceMode := $cfgOpt.Value ctx}}
|
||||
<input type="hidden" data-config-dyn-key="{{$cfgKey}}" data-config-value-json="{{JsonUtils.EncodeToString $maintenanceMode}}">
|
||||
<div class="field">
|
||||
<div class="ui checkbox tw-mb-2">
|
||||
<input type="checkbox" name="{{$cfgKey}}.AdminWebAccessOnly" value="true" {{if $maintenanceMode.AdminWebAccessOnly}}checked{{end}} data-config-value-type="boolean">
|
||||
<label>{{ctx.Locale.Tr "admin.config.instance_maintenance_mode.admin_web_access_only"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="fields tw-mb-1">
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.common.start_time"}}</label>
|
||||
<input type="datetime-local" name="{{$cfgKey}}.StartTimeUnix" data-config-value-type="timestamp">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.common.end_time"}}</label>
|
||||
<input type="datetime-local" name="{{$cfgKey}}.EndTimeUnix" data-config-value-type="timestamp">
|
||||
</div>
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.common.skip_time_check"}}</div>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
{{$cfgOpt = $.SystemConfig.Instance.WebBanner}}
|
||||
{{$cfgKey = $cfgOpt.DynKey}}
|
||||
{{$banner := $cfgOpt.Value ctx}}
|
||||
<input type="hidden" data-config-dyn-key="{{$cfgKey}}" data-config-value-json="{{JsonUtils.EncodeToString $banner}}">
|
||||
<div class="field">
|
||||
<div class="ui checkbox tw-mb-2">
|
||||
<input type="checkbox" name="{{$cfgKey}}.DisplayEnabled" value="true" {{if $banner.DisplayEnabled}}checked{{end}} data-config-value-type="boolean">
|
||||
<label>{{ctx.Locale.Tr "admin.config.instance_web_banner.enabled"}}</label>
|
||||
</div>
|
||||
{{template "shared/combomarkdowneditor" (dict
|
||||
"ContainerClasses" "web-banner-content-editor"
|
||||
"TextareaName" (print $cfgKey ".ContentMessage")
|
||||
"TextareaContent" $banner.ContentMessage
|
||||
"TextareaPlaceholder" (ctx.Locale.Tr "admin.config.instance_web_banner.message_placeholder")
|
||||
)}}
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="fields tw-mb-1">
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.common.start_time"}}</label>
|
||||
<input type="datetime-local" name="{{$cfgKey}}.StartTimeUnix" data-config-value-type="timestamp">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.common.end_time"}}</label>
|
||||
<input type="datetime-local" name="{{$cfgKey}}.EndTimeUnix" data-config-value-type="timestamp">
|
||||
</div>
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.common.skip_time_check"}}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repository"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form system-config-form" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{$cfg := .SystemConfig.Repository.OpenWithEditorApps}}
|
||||
<div class="field">
|
||||
<details>
|
||||
<summary>{{ctx.Locale.Tr "admin.config.open_with_editor_app_help"}}</summary>
|
||||
<pre class="tw-px-4">{{$cfg.DefaultValue.ToTextareaString}}</pre>
|
||||
</details>
|
||||
</div>
|
||||
<div class="field">
|
||||
{{/* TODO: OPEN-WITH-EDITOR-APP-JSON: use a simple textarea */}}
|
||||
<textarea name="{{$cfg.DynKey}}">{{if $cfg.HasValue ctx}}{{($cfg.Value ctx).ToTextareaString}}{{end}}</textarea>
|
||||
</div>
|
||||
|
||||
{{$cfg = .SystemConfig.Repository.GitGuideRemoteName}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.git_guide_remote_name"}}</label>
|
||||
<input name="{{$cfg.DynKey}}" value="{{$cfg.Value ctx}}" placeholder="{{$cfg.DefaultValue}}" maxlength="100" dir="auto" required pattern="^[A-Za-z0-9][\-_A-Za-z0-9]*$">
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin monitor")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.monitor.cron"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<form method="post" action="{{AppSubUrl}}/-/admin">
|
||||
<table class="ui very basic table unstackable tw-mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.name"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.schedule"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.next"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.previous"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.execute_times"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.last_execution_result"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Entries}}
|
||||
<tr>
|
||||
<td><button type="submit" class="ui primary button" name="op" value="{{.Name}}" title="{{ctx.Locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
|
||||
<td>{{ctx.Locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
|
||||
<td>{{.Spec}}</td>
|
||||
<td>{{DateUtils.FullTime .Next}}</td>
|
||||
<td>{{if gt .Prev.Year 1}}{{DateUtils.FullTime .Prev}}{{else}}-{{end}}</td>
|
||||
<td>{{.ExecTimes}}</td>
|
||||
<td {{if ne .Status ""}}data-tooltip-content="{{.FormatLastMessage ctx.Locale}}"{{end}} >{{if eq .Status ""}}—{{else}}{{svg (Iif (eq .Status "finished") "octicon-check" "octicon-x") 16}}{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="from" value="monitor">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,82 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin dashboard")}}
|
||||
<div class="admin-setting-content">
|
||||
{{if .NeedUpdate}}
|
||||
<div class="ui negative message flash-error">
|
||||
<p>{{ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer "https://blog.gitea.com"}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.dashboard.maintenance_operations"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<form method="post" action="{{AppSubUrl}}/-/admin">
|
||||
<table class="ui very basic table tw-mt-0 tw-px-4">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.delete_repo_archives"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.delete_missing_repos"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.git_gc_repos"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
{{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_hooks"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.reinit_missing_repos"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.sync_external_users"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.repo_health_check"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.sync_repo_branches"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ctx.Locale.Tr "admin.dashboard.sync_repo_tags"}}</td>
|
||||
<td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="sync_repo_tags">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.dashboard.system_status"}}
|
||||
</h4>
|
||||
{{/* TODO: make these stats work in multi-server deployments, likely needs per-server stats in DB */}}
|
||||
<div class="ui attached table segment">
|
||||
{{template "admin/system_status" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,101 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin user")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.emails.email_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui secondary filter menu tw-items-center tw-mx-0">
|
||||
<form class="ui form ignore-dirty tw-flex-1">
|
||||
{{template "shared/search/combo" dict "Value" .Keyword}}
|
||||
</form>
|
||||
<!-- Sort -->
|
||||
<div class="ui dropdown type jump item tw-mr-0">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if or (eq .SortType "email") (not .SortType)}}active {{end}}item" href="?sort=email&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.email"}}</a>
|
||||
<a class="{{if eq .SortType "reverseemail"}}active {{end}}item" href="?sort=reverseemail&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.email_reverse"}}</a>
|
||||
<a class="{{if eq .SortType "username"}}active {{end}}item" href="?sort=username&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.name"}}</a>
|
||||
<a class="{{if eq .SortType "reverseusername"}}active {{end}}item" href="?sort=reverseusername&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.name_reverse"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortt-asc="username" data-sortt-desc="reverseusername">
|
||||
{{ctx.Locale.Tr "admin.users.name"}}
|
||||
{{SortArrow "username" "reverseusername" $.SortType false}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.full_name"}}</th>
|
||||
<th data-sortt-asc="email" data-sortt-desc="reverseemail" data-sortt-default="true">
|
||||
{{ctx.Locale.Tr "email"}}
|
||||
{{SortArrow "email" "reverseemail" $.SortType true}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.emails.primary"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.emails.activated"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Emails}}
|
||||
<tr>
|
||||
<td><a href="{{AppSubUrl}}/{{.Name | PathEscape}}">{{.Name}}</a></td>
|
||||
<td class="gt-ellipsis tw-max-w-48">{{.FullName}}</td>
|
||||
<td class="gt-ellipsis tw-max-w-48">{{.Email}}</td>
|
||||
<td>{{svg (Iif .IsPrimary "octicon-check" "octicon-x")}}</td>
|
||||
<td>
|
||||
{{if .CanChange}}
|
||||
<a class="show-modal" href data-modal="#change-email-modal" data-modal-uid="{{.UID}}"
|
||||
data-modal-email="{{.Email}}"
|
||||
data-modal-primary="{{if .IsPrimary}}1{{else}}0{{end}}"
|
||||
data-modal-activate="{{if .IsActivated}}0{{else}}1{{end}}">
|
||||
{{svg (Iif .IsActivated "octicon-check" "octicon-x")}}
|
||||
</a>
|
||||
{{else}}
|
||||
{{svg (Iif .IsActivated "octicon-check" "octicon-x")}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td>
|
||||
<a class="link-action negative" href data-url="{{$.Link}}/delete?id={{.ID}}&uid={{.UID}}"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "admin.emails.delete"}}"
|
||||
data-modal-confirm-content="{{ctx.Locale.Tr "admin.emails.delete_desc"}}"
|
||||
>{{svg "octicon-trash"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td class="tw-text-center" colspan="6">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
|
||||
<div class="ui g-modal-confirm modal" id="change-email-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "admin.emails.change_email_header"}}
|
||||
</div>
|
||||
<form class="content ui form" action="{{AppSubUrl}}/-/admin/emails/activate" method="post">
|
||||
<p class="center">{{ctx.Locale.Tr "admin.emails.change_email_text"}}</p>
|
||||
|
||||
<input type="hidden" name="sort" value="{{.SortType}}">
|
||||
<input type="hidden" name="q" value="{{.Keyword}}">
|
||||
<input type="hidden" name="is_primary" value="{{.IsPrimary}}">
|
||||
<input type="hidden" name="is_activated" value="{{.IsActivated}}">
|
||||
|
||||
<input type="hidden" name="uid">
|
||||
<input type="hidden" name="email">
|
||||
<input type="hidden" name="primary">
|
||||
<input type="hidden" name="activate">
|
||||
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin settings new webhook")}}
|
||||
<div class="admin-setting-content">
|
||||
{{$CustomHeaderTitle := ctx.Locale.Tr "admin.defaulthooks.update_webhook"}}
|
||||
{{if .PageIsAdminDefaultHooksNew}}
|
||||
{{$CustomHeaderTitle = ctx.Locale.Tr "admin.defaulthooks.add_webhook"}}
|
||||
{{else if .PageIsAdminSystemHooksNew}}
|
||||
{{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.add_webhook"}}
|
||||
{{else if .Webhook.IsSystemWebhook}}
|
||||
{{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.update_webhook"}}
|
||||
{{end}}
|
||||
{{template "webhook/new" (dict "CustomHeaderTitle" $CustomHeaderTitle)}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin hooks")}}
|
||||
<div class="admin-setting-content">
|
||||
{{template "repo/settings/webhook/base_list" .SystemWebhooks}}
|
||||
{{template "repo/settings/webhook/base_list" .DefaultWebhooks}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
|
||||
<div class="page-content">
|
||||
<div class="admin-layout-right">
|
||||
<div>
|
||||
{{/* block: admin-setting-content */}}
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{template "base/head" ctx.RootData}}
|
||||
<div role="main" aria-label="{{ctx.RootData.Title}}" class="page-content {{.pageClass}}" {{if .dataGlobalInit}}data-global-init="{{.dataGlobalInit}}"{{end}}>
|
||||
<div class="ui container fluid padded flex-container">
|
||||
{{template "admin/navbar" ctx.RootData}}
|
||||
<div class="flex-container-main">
|
||||
{{template "base/alert" ctx.RootData}}
|
||||
{{/* block: admin-setting-content */}}
|
||||
|
||||
{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,119 @@
|
||||
<div class="flex-container-nav">
|
||||
<div class="ui fluid vertical menu">
|
||||
<div class="header item">{{ctx.Locale.Tr "admin.settings"}}</div>
|
||||
|
||||
<details class="item" {{if or .PageIsAdminDashboard .PageIsAdminSelfCheck}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "admin.maintenance"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsAdminDashboard}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
|
||||
{{ctx.Locale.Tr "admin.dashboard"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminSelfCheck}}active {{end}}item" href="{{AppSubUrl}}/-/admin/self_check">
|
||||
{{ctx.Locale.Tr "admin.self_check"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
<details class="item" {{if or .PageIsAdminUsers .PageIsAdminBadges .PageIsAdminEmails .PageIsAdminOrganizations .PageIsAdminAuthentications}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "admin.identity_access"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsAdminAuthentications}}active {{end}}item" href="{{AppSubUrl}}/-/admin/auths">
|
||||
{{ctx.Locale.Tr "admin.authentication"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminOrganizations}}active {{end}}item" href="{{AppSubUrl}}/-/admin/orgs">
|
||||
{{ctx.Locale.Tr "admin.organizations"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminUsers}}active {{end}}item" href="{{AppSubUrl}}/-/admin/users">
|
||||
{{ctx.Locale.Tr "admin.users"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminBadges}}active {{end}}item" href="{{AppSubUrl}}/-/admin/badges">
|
||||
{{ctx.Locale.Tr "admin.badges"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminEmails}}active {{end}}item" href="{{AppSubUrl}}/-/admin/emails">
|
||||
{{ctx.Locale.Tr "admin.emails"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
<details class="item" {{if or .PageIsAdminRepositories (and .EnablePackages .PageIsAdminPackages)}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "admin.assets"}}</summary>
|
||||
<div class="menu">
|
||||
{{if .EnablePackages}}
|
||||
<a class="{{if .PageIsAdminPackages}}active {{end}}item" href="{{AppSubUrl}}/-/admin/packages">
|
||||
{{ctx.Locale.Tr "packages.title"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsAdminRepositories}}active {{end}}item" href="{{AppSubUrl}}/-/admin/repos">
|
||||
{{ctx.Locale.Tr "admin.repositories"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
<!-- Webhooks and OAuth can be both disabled here, so add this if statement to display different ui -->
|
||||
{{if and (not DisableWebhooks) .EnableOAuth2}}
|
||||
<details class="item" {{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks .PageIsAdminApplications}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "admin.integrations"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/-/admin/applications">
|
||||
{{ctx.Locale.Tr "settings.applications"}}
|
||||
</a>
|
||||
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/-/admin/hooks">
|
||||
{{ctx.Locale.Tr "admin.hooks"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
{{else}}
|
||||
{{if not DisableWebhooks}}
|
||||
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/-/admin/hooks">
|
||||
{{ctx.Locale.Tr "admin.hooks"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableOAuth2}}
|
||||
<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/-/admin/applications">
|
||||
{{ctx.Locale.Tr "settings.applications"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .EnableActions}}
|
||||
<details class="item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsVariables}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/-/admin/actions/runners">
|
||||
{{ctx.Locale.Tr "actions.runners"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{AppSubUrl}}/-/admin/actions/variables">
|
||||
{{ctx.Locale.Tr "actions.variables"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
{{end}}
|
||||
<details class="item" {{if or .PageIsAdminConfig}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "admin.config"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsAdminConfigSummary}}active {{end}}item" href="{{AppSubUrl}}/-/admin/config">
|
||||
{{ctx.Locale.Tr "admin.config_summary"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminConfigSettings}}active {{end}}item" href="{{AppSubUrl}}/-/admin/config/settings">
|
||||
{{ctx.Locale.Tr "admin.config_settings"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
<a class="{{if .PageIsAdminNotices}}active {{end}}item" href="{{AppSubUrl}}/-/admin/notices">
|
||||
{{ctx.Locale.Tr "admin.notices"}}
|
||||
</a>
|
||||
<details class="item" {{if or .PageIsAdminMonitorStats .PageIsAdminMonitorCron .PageIsAdminMonitorQueue .PageIsAdminMonitorTrace}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "admin.monitor"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsAdminMonitorStats}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/stats">
|
||||
{{ctx.Locale.Tr "admin.monitor.stats"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminMonitorCron}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/cron">
|
||||
{{ctx.Locale.Tr "admin.monitor.cron"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminMonitorQueue}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/queue">
|
||||
{{ctx.Locale.Tr "admin.monitor.queues"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsAdminMonitorTrace}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/stacktrace">
|
||||
{{ctx.Locale.Tr "admin.monitor.trace"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,69 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin notice")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.notices.system_notice_list"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
</h4>
|
||||
<table class="ui attached segment select selectable table unstackable g-table-auto-ellipsis">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>ID</th>
|
||||
<th>{{ctx.Locale.Tr "admin.notices.type"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.notices.desc"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.notices.op"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Notices}}
|
||||
<tr>
|
||||
<td><div class="ui checkbox tw-flex" data-id="{{.ID}}"><input type="checkbox"></div></td>
|
||||
<td>{{.ID}}</td>
|
||||
<td>{{ctx.Locale.Tr .TrStr}}</td>
|
||||
<td class="view-detail auto-ellipsis tw-w-4/5"><span class="notice-description">{{.Description}}</span></td>
|
||||
<td nowrap>{{DateUtils.AbsoluteShort .CreatedUnix}}</td>
|
||||
<td class="view-detail"><a href="#">{{svg "octicon-note" 16}}</a></td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td class="tw-text-center" colspan="6">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
{{if .Notices}}
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th colspan="5">
|
||||
<form class="tw-float-right" method="post" action="{{AppSubUrl}}/-/admin/notices/empty">
|
||||
<button type="submit" class="ui red small button">{{ctx.Locale.Tr "admin.notices.delete_all"}}</button>
|
||||
</form>
|
||||
<div class="ui floating upward dropdown small button">
|
||||
<span class="text">{{ctx.Locale.Tr "admin.notices.operations"}}</span>
|
||||
<div class="menu">
|
||||
<div class="item select action" data-action="select-all">
|
||||
{{ctx.Locale.Tr "admin.notices.select_all"}}
|
||||
</div>
|
||||
<div class="item select action" data-action="deselect-all">
|
||||
{{ctx.Locale.Tr "admin.notices.deselect_all"}}
|
||||
</div>
|
||||
<div class="item select action" data-action="inverse">
|
||||
{{ctx.Locale.Tr "admin.notices.inverse_selection"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui small button" id="delete-selection" data-link="{{.Link}}/delete">
|
||||
<span class="text">{{ctx.Locale.Tr "admin.notices.delete_selected"}}</span>
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
{{end}}
|
||||
</table>
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
|
||||
<div class="ui modal admin" id="detail-modal">
|
||||
<div class="header">{{ctx.Locale.Tr "admin.notices.view_detail_header"}}</div>
|
||||
<div class="content"><pre></pre></div>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,81 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin user")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.orgs.org_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{ctx.Locale.Tr "admin.orgs.new_orga"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui secondary filter menu tw-items-center tw-mx-0">
|
||||
<form class="ui form ignore-dirty tw-flex-1">
|
||||
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.org_kind")}}
|
||||
</form>
|
||||
<!-- Sort -->
|
||||
<div class="ui dropdown type jump item tw-mr-0">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
|
||||
<a class="{{if eq .SortType "newest"}}active {{end}}item" href="?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
|
||||
<a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
|
||||
<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
|
||||
<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
|
||||
<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th>
|
||||
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically" data-sortt-default="true">
|
||||
{{ctx.Locale.Tr "admin.orgs.name"}}
|
||||
{{SortArrow "alphabetically" "reversealphabetically" $.SortType true}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.orgs.teams"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.orgs.members"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.repos"}}</th>
|
||||
<th data-sortt-asc="recentupdate" data-sortt-desc="leastupdate">
|
||||
{{ctx.Locale.Tr "admin.users.created"}}
|
||||
{{SortArrow "recentupdate" "leastupdate" $.SortType false}}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $org := .Users}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td>
|
||||
<span class="username-display">
|
||||
<a href="{{$org.HomeLink}}">{{$org.Name}}</a>
|
||||
{{if $org.FullName}}<span class="username-fullname">({{$org.FullName}})</span>{{end}}
|
||||
</span>
|
||||
{{if .Visibility.IsPrivate}}
|
||||
<span class="tw-text-gold">{{svg "octicon-lock"}}</span>
|
||||
{{end}}
|
||||
{{if eq .Type 3}}{{/* Reserved organization */}}
|
||||
<span class="ui mini label">{{ctx.Locale.Tr "admin.users.reserved"}}</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{.NumTeams}}</td>
|
||||
<td>{{.NumMembers}}</td>
|
||||
<td>{{.NumRepos}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td>
|
||||
<td><a href="{{.OrganisationLink}}/settings" data-tooltip-content="{{ctx.Locale.Tr "edit"}}">{{svg "octicon-pencil"}}</a></td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td class="tw-text-center" colspan="7">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,99 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin user")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.packages.package_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .TotalCount}},
|
||||
{{ctx.Locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}},
|
||||
{{ctx.Locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}})
|
||||
<div class="ui right">
|
||||
<form method="post" action="{{AppSubUrl}}/-/admin/packages/cleanup">
|
||||
<button class="ui primary tiny button">{{ctx.Locale.Tr "admin.packages.cleanup"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form ignore-dirty">
|
||||
<div class="ui small fluid action input">
|
||||
{{template "shared/search/input" dict "Value" .Query}}
|
||||
<select class="ui small dropdown" name="type">
|
||||
<option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option>
|
||||
<option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option>
|
||||
{{range $type := .AvailableTypes}}
|
||||
<option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
{{template "shared/search/button"}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>{{ctx.Locale.Tr "admin.packages.owner"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.packages.type"}}</th>
|
||||
<th data-sortt-asc="name_asc" data-sortt-desc="name_desc">
|
||||
{{ctx.Locale.Tr "admin.packages.name"}}
|
||||
{{SortArrow "name_asc" "name_desc" .SortType false}}
|
||||
</th>
|
||||
<th data-sortt-asc="version_desc" data-sortt-desc="version_asc">
|
||||
{{ctx.Locale.Tr "admin.packages.version"}}
|
||||
{{SortArrow "version_desc" "version_asc" .SortType false}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.packages.creator"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.packages.repository"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.packages.size"}}</th>
|
||||
<th data-sortt-asc="created_asc" data-sortt-desc="created_desc">
|
||||
{{ctx.Locale.Tr "admin.packages.published"}}
|
||||
{{SortArrow "created_asc" "created_desc" .SortType true}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.notices.op"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .PackageDescriptors}}
|
||||
<tr>
|
||||
<td>{{.Version.ID}}</td>
|
||||
<td>
|
||||
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
|
||||
{{if .Owner.Visibility.IsPrivate}}
|
||||
<span class="tw-text-gold">{{svg "octicon-lock"}}</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{.Package.Type.Name}}</td>
|
||||
<td class="gt-ellipsis tw-max-w-48">{{.Package.Name}}</td>
|
||||
<td class="gt-ellipsis tw-max-w-48"><a href="{{.VersionWebLink}}">{{.Version.Version}}</a></td>
|
||||
<td><a href="{{.Creator.HomeLink}}">{{.Creator.Name}}</a></td>
|
||||
<td>
|
||||
{{if .Repository}}
|
||||
<a href="{{.Repository.Link}}">{{.Repository.Name}}</a>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{FileSize .CalculateBlobSize}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .Version.CreatedUnix}}</td>
|
||||
<td>
|
||||
<a class="tw-text-red show-modal" href data-modal="#admin-package-delete-modal"
|
||||
data-modal-form.action="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}&id={{.Version.ID}}"
|
||||
data-modal-package-name="{{.Package.Name}}" data-modal-package-version="{{.Version.Version}}"
|
||||
>{{svg "octicon-trash"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td class="tw-text-center" colspan="10">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
|
||||
<form class="ui small modal form-fetch-action" method="post" id="admin-package-delete-modal">
|
||||
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "packages.settings.delete.version"}}</div>
|
||||
<div class="content">
|
||||
{{ctx.Locale.Tr "packages.settings.delete.notice" (HTMLFormat `<span class="%s"></span>` "package-name") (HTMLFormat `<span class="%s"></span>` "package-version")}}
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin monitor")}}
|
||||
|
||||
<div class="admin-setting-content">
|
||||
{{template "admin/trace_tabs" .}}
|
||||
|
||||
{{range $record := .PerfTraceRecords}}
|
||||
<div class="ui segment tw-w-full tw-overflow-auto">
|
||||
<pre class="tw-whitespace-pre">{{$record.Content}}</pre>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,36 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin monitor")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.monitor.queues"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $qid, $q := .Queues}}
|
||||
<tr>
|
||||
<td>{{$q.GetName}}</td>
|
||||
<td>{{$q.GetType}}</td>
|
||||
<td>{{$q.GetItemTypeName}}</td>
|
||||
<td>{{$q.GetWorkerNumber}}</td>
|
||||
<td>{{$q.GetWorkerActiveNumber}}</td>
|
||||
<td>{{$sum := $q.GetQueueItemNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
|
||||
<td><a href="{{$.Link}}/{{$qid}}" class="button">{{ctx.Locale.Tr "admin.monitor.queue.review_add"}}</a></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin monitor")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.monitor.queue" .Queue.GetName}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{.Queue.GetName}}</td>
|
||||
<td>{{.Queue.GetType}}</td>
|
||||
<td>{{.Queue.GetItemTypeName}}</td>
|
||||
<td>{{.Queue.GetWorkerNumber}}</td>
|
||||
<td>{{.Queue.GetWorkerActiveNumber}}</td>
|
||||
<td>{{.Queue.GetWorkerMaxNumber}}</td>
|
||||
<td>
|
||||
{{$sum := .Queue.GetQueueItemNumber}}
|
||||
{{if lt $sum 0}}
|
||||
-
|
||||
{{else}}
|
||||
{{$sum}}
|
||||
<form action="{{$.Link}}/remove-all-items" method="post" class="tw-inline-block tw-ml-4">
|
||||
<button class="ui tiny basic red button">{{ctx.Locale.Tr "admin.monitor.queue.settings.remove_all_items"}}</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.monitor.queue.settings.title"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{ctx.Locale.Tr "admin.monitor.queue.settings.desc"}}</p>
|
||||
<form method="post" action="{{.Link}}/set">
|
||||
<div class="ui form">
|
||||
<div class="inline field">
|
||||
<label for="max-number">{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label>
|
||||
<input name="max-number" type="text" placeholder="{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.GetWorkerMaxNumber}}">
|
||||
</div>
|
||||
<button class="ui submit button">{{ctx.Locale.Tr "admin.monitor.queue.settings.submit"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,114 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.repos.repo_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/-/admin/repos/unadopted">{{ctx.Locale.Tr "admin.repos.unadopted"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{template "shared/repo/search" .}}
|
||||
</div>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table selectable unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.repos.owner"}}</th>
|
||||
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
|
||||
{{ctx.Locale.Tr "admin.repos.name"}}
|
||||
{{SortArrow "alphabetically" "reversealphabetically" $.SortType false}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "repo.watchers"}}</th>
|
||||
<th data-sortt-asc="moststars" data-sortt-desc="feweststars">
|
||||
{{ctx.Locale.Tr "repo.stars"}}
|
||||
{{SortArrow "moststars" "feweststars" $.SortType false}}
|
||||
</th>
|
||||
<th data-sortt-asc="mostforks" data-sortt-desc="fewestforks">
|
||||
{{ctx.Locale.Tr "repo.forks"}}
|
||||
{{SortArrow "mostforks" "fewestforks" $.SortType false}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.repos.issues"}}</th>
|
||||
<th data-sortt-asc="gitsize" data-sortt-desc="reversegitsize">
|
||||
{{ctx.Locale.Tr "admin.repos.size"}}
|
||||
{{SortArrow "gitsize" "reversegitsize" $.SortType false}}
|
||||
</th>
|
||||
<th data-sortt-asc="lfssize" data-sortt-desc="reverselfssize">
|
||||
{{ctx.Locale.Tr "admin.repos.lfs_size"}}
|
||||
{{SortArrow "lfssize" "reverselfssize" $.SortType false}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "admin.auths.updated"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.notices.op"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Repos}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td>
|
||||
<a class="tw-break-anywhere" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
|
||||
{{if .Owner.Visibility.IsPrivate}}
|
||||
<span class="tw-text-gold">{{svg "octicon-lock"}}</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>
|
||||
<a class="tw-break-anywhere" href="{{.Link}}">{{.Name}}</a>
|
||||
{{if .IsArchived}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
|
||||
{{end}}
|
||||
{{if .IsPrivate}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
|
||||
{{else}}
|
||||
{{if .Owner.Visibility.IsPrivate}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .IsTemplate}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
|
||||
{{end}}
|
||||
{{if eq .ObjectFormatName "sha256"}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span>
|
||||
{{end}}
|
||||
{{if .IsMirror}}
|
||||
{{svg "octicon-mirror"}}
|
||||
{{else if .IsFork}}
|
||||
{{svg "octicon-repo-forked"}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{.NumWatches}}</td>
|
||||
<td>{{.NumStars}}</td>
|
||||
<td>{{.NumForks}}</td>
|
||||
<td>{{.NumIssues}}</td>
|
||||
<td>{{FileSize .GitSize}}</td>
|
||||
<td>{{FileSize .LFSSize}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .UpdatedUnix}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td>
|
||||
<td>
|
||||
<a class="tw-text-red show-modal" href data-modal="#admin-repo-delete-modal"
|
||||
data-modal-form.action="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}&id={{.ID}}"
|
||||
data-modal-repo-name="{{.Name}}"
|
||||
>{{svg "octicon-trash"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td class="tw-text-center" colspan="12">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
|
||||
<form class="ui small modal form-fetch-action" id="admin-repo-delete-modal" method="post">
|
||||
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.settings.delete"}}</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.settings.delete_desc"}}</p>
|
||||
{{ctx.Locale.Tr "repo.settings.delete_notices_2" (HTMLFormat `<span class="%s"></span>` "repo-name")}}<br>
|
||||
{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}<br>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,73 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.repos.unadopted"}}
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/-/admin/repos">{{ctx.Locale.Tr "admin.repos.repo_manage_panel"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form ignore-dirty">
|
||||
<div class="ui small fluid action input">
|
||||
<input name="search" value="true" type="hidden">
|
||||
<input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus>
|
||||
{{template "shared/search/button"}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{if .search}}
|
||||
<div class="ui attached segment settings">
|
||||
{{if .Dirs}}
|
||||
<div class="ui aligned divided list">
|
||||
{{range $dirI, $dir := .Dirs}}
|
||||
<div class="item flex-text-block">
|
||||
<span class="tw-flex-1"> {{svg "octicon-file-directory-fill"}} {{$dir}}</span>
|
||||
<div>
|
||||
<button class="ui button primary show-modal tw-p-2" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.adopt_preexisting_label"}}</button>
|
||||
<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
|
||||
<div class="header">
|
||||
<span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting"}}</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
|
||||
</div>
|
||||
<form class="ui form" method="post" action="{{AppSubUrl}}/-/admin/repos/unadopted">
|
||||
<input type="hidden" name="id" value="{{$dir}}">
|
||||
<input type="hidden" name="action" value="adopt">
|
||||
<input type="hidden" name="q" value="{{$.Keyword}}">
|
||||
<input type="hidden" name="page" value="{{$.CurrentPage}}">
|
||||
{{template "base/modal_actions_confirm"}}
|
||||
</form>
|
||||
</div>
|
||||
<button class="ui button red show-modal tw-p-2" data-modal="#delete-unadopted-modal-{{$dirI}}">{{svg "octicon-x"}} {{ctx.Locale.Tr "repo.delete_preexisting_label"}}</button>
|
||||
<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
|
||||
<div class="header">
|
||||
<span class="label">{{ctx.Locale.Tr "repo.delete_preexisting"}}</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.delete_preexisting_content" $dir}}</p>
|
||||
</div>
|
||||
<form class="ui form" method="post" action="{{AppSubUrl}}/-/admin/repos/unadopted">
|
||||
<input type="hidden" name="id" value="{{$dir}}">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" name="q" value="{{$.Keyword}}">
|
||||
<input type="hidden" name="page" value="{{$.CurrentPage}}">
|
||||
{{template "base/modal_actions_confirm"}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
{{else}}
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "admin.repos.unadopted.no_more"}}
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin runners")}}
|
||||
<div class="admin-setting-content">
|
||||
{{template "shared/actions/runner_edit" .}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,60 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin")}}
|
||||
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.self_check"}}
|
||||
</h4>
|
||||
|
||||
{{if .StartupProblems}}
|
||||
<div class="ui attached segment self-check-problem">
|
||||
<div class="ui warning message">
|
||||
<div>{{ctx.Locale.Tr "admin.self_check.startup_warnings"}}</div>
|
||||
<ul class="tw-w-full">{{range .StartupProblems}}<li>{{.}}</li>{{end}}</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="ui attached segment tw-hidden self-check-problem" id="self-check-by-frontend"></div>
|
||||
|
||||
{{if .DatabaseCheckHasProblems}}
|
||||
<div class="ui attached segment self-check-problem">
|
||||
{{if .DatabaseType.IsMySQL}}
|
||||
<div class="tw-p-2">{{ctx.Locale.Tr "admin.self_check.database_fix_mysql"}}</div>
|
||||
{{else if .DatabaseType.IsMSSQL}}
|
||||
<div class="tw-p-2">{{ctx.Locale.Tr "admin.self_check.database_fix_mssql"}}</div>
|
||||
{{end}}
|
||||
{{if .DatabaseCheckCollationMismatch}}
|
||||
<div class="ui red message">{{ctx.Locale.Tr "admin.self_check.database_collation_mismatch" .DatabaseCheckResult.ExpectedCollation}}</div>
|
||||
{{end}}
|
||||
{{if .DatabaseCheckCollationCaseInsensitive}}
|
||||
<div class="ui warning message">{{ctx.Locale.Tr "admin.self_check.database_collation_case_insensitive" .DatabaseCheckResult.DatabaseCollation}}</div>
|
||||
{{end}}
|
||||
{{if .DatabaseCheckInconsistentCollationColumns}}
|
||||
<div class="ui red message">
|
||||
<details>
|
||||
<summary>{{ctx.Locale.Tr "admin.self_check.database_inconsistent_collation_columns" .DatabaseCheckResult.DatabaseCollation}}</summary>
|
||||
<ul class="tw-w-full">
|
||||
{{range .DatabaseCheckInconsistentCollationColumns}}
|
||||
<li>{{.}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .CacheError}}
|
||||
<div class="ui red message">{{ctx.Locale.Tr "admin.config.cache_test_failed" .CacheError}}</div>
|
||||
{{end}}
|
||||
{{if .CacheSlow}}
|
||||
<div class="ui warning message">{{ctx.Locale.Tr "admin.config.cache_test_slow" .CacheSlow}}</div>
|
||||
{{end}}
|
||||
|
||||
{{/* only shown when there is no visible "self-check-problem" */}}
|
||||
<div class="ui attached segment tw-hidden self-check-no-problem">
|
||||
{{ctx.Locale.Tr "admin.self_check.no_problem_found"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,69 @@
|
||||
<div class="item">
|
||||
<div class="tw-flex tw-items-center">
|
||||
<div class="icon tw-ml-2 tw-mr-2">
|
||||
{{if eq .Process.Type "request"}}
|
||||
{{svg "octicon-globe" 16}}
|
||||
{{else if eq .Process.Type "system"}}
|
||||
{{svg "octicon-cpu" 16}}
|
||||
{{else if eq .Process.Type "normal"}}
|
||||
{{svg "octicon-terminal" 16}}
|
||||
{{else}}
|
||||
{{svg "octicon-code" 16}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="content tw-flex-1">
|
||||
<div class="header">{{.Process.Description}}</div>
|
||||
<div class="description">{{if ne .Process.Type "none"}}{{DateUtils.TimeSince .Process.Start}}{{end}}</div>
|
||||
</div>
|
||||
<div>
|
||||
{{if or (eq .Process.Type "request") (eq .Process.Type "normal")}}
|
||||
<a class="link-action" data-url="{{.root.Link}}/cancel/{{.Process.PID}}"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "admin.monitor.process.cancel"}}"
|
||||
data-modal-confirm-content="{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}"
|
||||
>{{svg "octicon-trash" 16 "tw-text-red"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if .Process.Stacks}}
|
||||
<div class="divided list tw-ml-2">
|
||||
{{range .Process.Stacks}}
|
||||
<div class="item">
|
||||
<details>
|
||||
<summary>
|
||||
<div class="flex-text-inline">
|
||||
<div class="header tw-ml-2">
|
||||
<span class="icon tw-mr-2">{{svg "octicon-code" 16}}</span>{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}}
|
||||
</div>
|
||||
<div class="description">
|
||||
{{range .Labels}}
|
||||
<div class="ui label">{{.Name}}<div class="detail">{{.Value}}</div></div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="list">
|
||||
{{range .Entry}}
|
||||
<div class="item tw-flex tw-items-center">
|
||||
<span class="icon tw-mr-4">{{svg "octicon-dot-fill" 16}}</span>
|
||||
<div class="content tw-flex-1">
|
||||
<div class="header">{{.Function}}</div>
|
||||
<div class="description">{{.File}}:{{.Line}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Process.Children}}
|
||||
<div class="divided list">
|
||||
{{range .Process.Children}}
|
||||
{{template "admin/stacktrace-row" dict "Process" . "root" $.root}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin monitor")}}
|
||||
<div class="admin-setting-content">
|
||||
|
||||
{{template "admin/trace_tabs" .}}
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{printf "%d Goroutines" .GoroutineCount}}{{/* Goroutine is non-translatable*/}}
|
||||
{{- if .ProcessCount -}}, {{ctx.Locale.Tr "admin.monitor.processes_count" .ProcessCount}}{{- end -}}
|
||||
</h4>
|
||||
|
||||
{{if .ProcessStacks}}
|
||||
<div class="ui attached segment">
|
||||
<div class="ui relaxed divided list">
|
||||
{{range .ProcessStacks}}
|
||||
{{template "admin/stacktrace-row" dict "Process" . "root" $}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin monitor")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.dashboard.statistic"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic table unstackable">
|
||||
{{range $statsKey := .StatsKeys}}
|
||||
<tr>
|
||||
<td width="200">{{$statsKey}}</td>
|
||||
<td>{{index $.StatsCounter $statsKey}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,62 @@
|
||||
<dl class="admin-dl-horizontal" data-fetch-url="{{AppSubUrl}}/-/admin/system_status" data-fetch-sync="$morph" data-fetch-trigger="every 5s">
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.server_uptime"}}</dt>
|
||||
<dd><relative-time format="duration" datetime="{{.SysStatus.StartTime}}">{{.SysStatus.StartTime}}</relative-time></dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.current_goroutine"}}</dt>
|
||||
<dd>{{.SysStatus.NumGoroutine}}</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.current_memory_usage"}}</dt>
|
||||
<dd>{{.SysStatus.MemAllocated}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.total_memory_allocated"}}</dt>
|
||||
<dd>{{.SysStatus.MemTotal}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.memory_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.MemSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.pointer_lookup_times"}}</dt>
|
||||
<dd>{{.SysStatus.Lookups}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.memory_allocate_times"}}</dt>
|
||||
<dd>{{.SysStatus.MemMallocs}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.memory_free_times"}}</dt>
|
||||
<dd>{{.SysStatus.MemFrees}}</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.current_heap_usage"}}</dt>
|
||||
<dd>{{.SysStatus.HeapAlloc}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.HeapSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_idle"}}</dt>
|
||||
<dd>{{.SysStatus.HeapIdle}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_in_use"}}</dt>
|
||||
<dd>{{.SysStatus.HeapInuse}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_released"}}</dt>
|
||||
<dd>{{.SysStatus.HeapReleased}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.heap_objects"}}</dt>
|
||||
<dd>{{.SysStatus.HeapObjects}}</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt>
|
||||
<dd>{{.SysStatus.StackInuse}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.stack_memory_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.StackSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.mspan_structures_usage"}}</dt>
|
||||
<dd>{{.SysStatus.MSpanInuse}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.mspan_structures_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.MSpanSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.mcache_structures_usage"}}</dt>
|
||||
<dd>{{.SysStatus.MCacheInuse}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.mcache_structures_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.MCacheSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.BuckHashSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.gc_metadata_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.GCSys}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt>
|
||||
<dd>{{.SysStatus.OtherSys}}</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.next_gc_recycle"}}</dt>
|
||||
<dd>{{.SysStatus.NextGC}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.last_gc_time"}}</dt>
|
||||
<dd><relative-time format="duration" datetime="{{.SysStatus.LastGCTime}}">{{.SysStatus.LastGCTime}}</relative-time></dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.total_gc_pause"}}</dt>
|
||||
<dd>{{.SysStatus.PauseTotalNs}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.last_gc_pause"}}</dt>
|
||||
<dd>{{.SysStatus.PauseNs}}</dd>
|
||||
<dt>{{ctx.Locale.Tr "admin.dashboard.gc_times"}}</dt>
|
||||
<dd>{{.SysStatus.NumGC}}</dd>
|
||||
</dl>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="flex-text-block">
|
||||
<div class="tw-flex-1">
|
||||
<div class="ui compact small menu">
|
||||
{{if .ShowAdminPerformanceTraceTab}}
|
||||
<a class="item {{Iif .PageIsAdminMonitorPerfTrace "active"}}" href="{{AppSubUrl}}/-/admin/monitor/perftrace">{{ctx.Locale.Tr "admin.monitor.performance_logs"}}</a>
|
||||
{{end}}
|
||||
<a class="item {{Iif (eq .ShowGoroutineList "process") "active"}}" href="{{AppSubUrl}}/-/admin/monitor/stacktrace?show=process">{{ctx.Locale.Tr "admin.monitor.process"}}</a>
|
||||
<a class="item {{Iif (eq .ShowGoroutineList "stacktrace") "active"}}" href="{{AppSubUrl}}/-/admin/monitor/stacktrace?show=stacktrace">{{ctx.Locale.Tr "admin.monitor.stacktrace"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<form target="_blank" action="{{AppSubUrl}}/-/admin/monitor/diagnosis" class="ui form">
|
||||
<div class="ui inline field">
|
||||
<button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button>
|
||||
<input name="seconds" size="3" maxlength="3" value="10"> {{ctx.Locale.Tr "tool.raw_seconds"}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -0,0 +1,227 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin edit user")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.users.edit_account"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="./edit" method="post">
|
||||
{{template "base/disable_form_autofill"}}
|
||||
<div class="field {{if .Err_UserName}}error{{end}}">
|
||||
<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
|
||||
<input id="user_name" name="user_name" value="{{.User.Name}}" maxlength="40">
|
||||
</div>
|
||||
<!-- Types and name -->
|
||||
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
|
||||
<label>{{ctx.Locale.Tr "admin.users.auth_source"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="login_type" name="login_type" value="{{.LoginSource.Type.Int}}-{{.LoginSource.ID}}" required>
|
||||
<div class="text">{{ctx.Locale.Tr "admin.users.local"}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item" data-value="0-0">{{ctx.Locale.Tr "admin.users.local"}}</div>
|
||||
{{range .Sources}}
|
||||
<div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field {{if .Err_Visibility}}error{{end}}">
|
||||
<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span>
|
||||
<div class="ui selection type dropdown">
|
||||
{{if .User.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}}
|
||||
{{if .User.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}}
|
||||
{{if .User.Visibility.IsPrivate}}<input type="hidden" id="visibility" name="visibility" value="2">{{end}}
|
||||
<div class="text">
|
||||
{{if .User.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
|
||||
{{if .User.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
|
||||
{{if .User.Visibility.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}}
|
||||
</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range $mode := .AllowedUserVisibilityModes}}
|
||||
{{if $mode.IsPublic}}
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div>
|
||||
{{else if $mode.IsLimited}}
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div>
|
||||
{{else if $mode.IsPrivate}}
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}tw-hidden{{end}}">
|
||||
<label for="login_name">{{ctx.Locale.Tr "admin.users.auth_login_name"}}</label>
|
||||
<input id="login_name" name="login_name" value="{{.User.LoginName}}">
|
||||
</div>
|
||||
<div class="field {{if .Err_FullName}}error{{end}}">
|
||||
<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
|
||||
<input id="full_name" name="full_name" value="{{.User.FullName}}" maxlength="100">
|
||||
</div>
|
||||
<div class="required field {{if .Err_Email}}error{{end}}">
|
||||
<label for="email">{{ctx.Locale.Tr "email"}}</label>
|
||||
<input id="email" name="email" type="email" value="{{.User.Email}}" required>
|
||||
</div>
|
||||
<div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}tw-hidden{{end}}">
|
||||
<label for="password">{{ctx.Locale.Tr "password"}}</label>
|
||||
<input id="password" name="password" type="password" autocomplete="new-password">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.users.password_helper"}}</p>
|
||||
</div>
|
||||
|
||||
<div class="field {{if .Err_Language}}error{{end}}">
|
||||
<label for="language">{{ctx.Locale.Tr "settings.language"}}</label>
|
||||
<div class="ui selection dropdown">
|
||||
<input name="language" type="hidden" value="{{.User.Language}}">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">{{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}}</div>
|
||||
<div class="menu">
|
||||
{{range .AllLangs}}
|
||||
<div class="item{{if eq $.User.Language .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field {{if .Err_Website}}error{{end}}">
|
||||
<label for="website">{{ctx.Locale.Tr "settings.website"}}</label>
|
||||
<input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="http://mydomain.com or https://mydomain.com" maxlength="255">
|
||||
</div>
|
||||
<div class="field {{if .Err_Location}}error{{end}}">
|
||||
<label for="location">{{ctx.Locale.Tr "settings.location"}}</label>
|
||||
<input id="location" name="location" value="{{.User.Location}}" maxlength="50">
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
|
||||
<label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label>
|
||||
<input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.User.MaxRepoCreation}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.is_activated"}}</strong></label>
|
||||
<input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.prohibit_login"}}</strong></label>
|
||||
<input name="prohibit_login" type="checkbox" {{if .User.ProhibitLogin}}checked{{end}} {{if (eq .User.ID .SignedUserID)}}disabled{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.is_admin"}}</strong></label>
|
||||
<input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.is_restricted"}}</strong></label>
|
||||
<input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field {{if .DisableGitHooks}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.allow_git_hook"}}</strong></label>
|
||||
<input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if .DisableGitHooks}}disabled{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field {{if or (.DisableImportLocal) (.DisableMigrations)}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.allow_import_local"}}</strong></label>
|
||||
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if .DisableImportLocal}}disabled{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
{{if not .DisableRegularOrgCreation}}
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.allow_create_organization"}}</strong></label>
|
||||
<input name="allow_create_organization" type="checkbox" {{if .User.CanCreateOrganization}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .TwoFactorEnabled}}
|
||||
<div class="divider"></div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.reset_2fa"}}</strong></label>
|
||||
<input name="reset_2fa" type="checkbox">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.users.update_profile"}}</button>
|
||||
<button class="ui red button show-modal" data-modal="#delete-user-modal">{{ctx.Locale.Tr "admin.users.delete_account"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.avatar"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="./avatar" method="post" enctype="multipart/form-data">
|
||||
{{if not .DisableGravatar}}
|
||||
<div class="inline field">
|
||||
<div class="ui radio checkbox">
|
||||
<input name="source" value="lookup" type="radio" {{if not .User.UseCustomAvatar}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "settings.lookup_avatar_by_mail"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field tw-pl-4 {{if .Err_Gravatar}}error{{end}}">
|
||||
<label for="gravatar">Avatar {{ctx.Locale.Tr "email"}}</label>
|
||||
<input id="gravatar" name="gravatar" value="{{.User.AvatarEmail}}">
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="inline field">
|
||||
<div class="ui radio checkbox">
|
||||
<input name="source" value="local" type="radio" {{if .User.UseCustomAvatar}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "settings.enable_custom_avatar"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field tw-pl-4">
|
||||
{{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}}
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui red button link-action" data-url="./avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-user-modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "settings.delete_account_title"}}
|
||||
</div>
|
||||
<form class="ui form" method="post" action="./delete">
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<label for="purge">{{ctx.Locale.Tr "admin.users.purge"}}</label>
|
||||
<input name="purge" type="checkbox">
|
||||
</div>
|
||||
<p class="help">{{ctx.Locale.Tr "admin.users.purge_help"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,121 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin user")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.users.user_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/-/admin/users/new">{{ctx.Locale.Tr "admin.users.new_account"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form ignore-dirty flex-text-block" id="user-list-search-form">
|
||||
<div class="tw-flex-1">
|
||||
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}}
|
||||
</div>
|
||||
<!-- Right Menu -->
|
||||
<div class="ui secondary menu tw-m-0">
|
||||
<!-- Status Filter Menu Item -->
|
||||
<div class="ui dropdown type jump item">
|
||||
<span class="text">{{ctx.Locale.Tr "admin.users.list_status_filter.menu_text"}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu flex-items-menu">
|
||||
<a class="item j-reset-status-filter">{{ctx.Locale.Tr "admin.users.list_status_filter.reset"}}</a>
|
||||
<div class="divider"></div>
|
||||
<label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_admin"}}</label>
|
||||
<label class="item"><input type="radio" name="status_filter[is_admin]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_admin"}}</label>
|
||||
<div class="divider"></div>
|
||||
<label class="item"><input type="radio" name="status_filter[is_active]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_active"}}</label>
|
||||
<label class="item"><input type="radio" name="status_filter[is_active]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_active"}}</label>
|
||||
<div class="divider"></div>
|
||||
<label class="item"><input type="radio" name="status_filter[is_restricted]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_restricted"}}</label>
|
||||
<label class="item"><input type="radio" name="status_filter[is_restricted]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_restricted"}}</label>
|
||||
<div class="divider"></div>
|
||||
<label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_prohibit_login"}}</label>
|
||||
<label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_prohibit_login"}}</label>
|
||||
<div class="divider"></div>
|
||||
<label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_2fa_enabled"}}</label>
|
||||
<label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_2fa_enabled"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sort Menu Item -->
|
||||
<div class="ui dropdown type jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<button class="item" name="sort" value="oldest">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</button>
|
||||
<button class="item" name="sort" value="newest">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</button>
|
||||
<button class="item" name="sort" value="alphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</button>
|
||||
<button class="item" name="sort" value="reversealphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button>
|
||||
<button class="item" name="sort" value="recentupdate">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</button>
|
||||
<button class="item" name="sort" value="leastupdate">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic selectable table unstackable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" .SortType false}}</th>
|
||||
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically" data-sortt-default="true">
|
||||
{{ctx.Locale.Tr "admin.users.name"}}
|
||||
{{SortArrow "alphabetically" "reversealphabetically" $.SortType true}}
|
||||
</th>
|
||||
<th>{{ctx.Locale.Tr "email"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.activated"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.restricted"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.2fa"}}</th>
|
||||
<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
|
||||
<th data-sortt-asc="lastlogin" data-sortt-desc="reverselastlogin">
|
||||
{{ctx.Locale.Tr "admin.users.last_login"}}
|
||||
{{SortArrow "lastlogin" "reverselastlogin" $.SortType false}}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Users}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td>
|
||||
<a href="{{.HomeLink}}">{{.Name}}</a>
|
||||
{{if .IsAdmin}}
|
||||
<span class="ui mini label">{{ctx.Locale.Tr "admin.users.admin"}}</span>
|
||||
{{else if eq 2 .Type}}{{/* Reserved user */}}
|
||||
<span class="ui mini label">{{ctx.Locale.Tr "admin.users.reserved"}}</span>
|
||||
{{else if eq 4 .Type}}{{/* Bot "user" */}}
|
||||
<span class="ui mini label">{{ctx.Locale.Tr "admin.users.bot"}}</span>
|
||||
{{else if eq 5 .Type}}{{/* Remote user */}}
|
||||
<span class="ui mini label">{{ctx.Locale.Tr "admin.users.remote"}}</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="gt-ellipsis tw-max-w-48">{{.Email}}</td>
|
||||
<td>{{svg (Iif .IsActive "octicon-check" "octicon-x")}}</td>
|
||||
<td>{{svg (Iif .IsRestricted "octicon-check" "octicon-x")}}</td>
|
||||
<td>{{svg (Iif (index $.UsersTwoFaStatus .ID) "octicon-check" "octicon-x")}}</td>
|
||||
<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td>
|
||||
{{if .LastLoginUnix}}
|
||||
<td>{{DateUtils.AbsoluteShort .LastLoginUnix}}</td>
|
||||
{{else}}
|
||||
<td><span>{{ctx.Locale.Tr "admin.users.never_login"}}</span></td>
|
||||
{{end}}
|
||||
<td>
|
||||
<div class="tw-flex tw-gap-2">
|
||||
<a href="{{$.Link}}/{{.ID}}" data-tooltip-content="{{ctx.Locale.Tr "admin.users.details"}}">{{svg "octicon-person"}}</a>
|
||||
<a href="{{$.Link}}/{{.ID}}/edit" data-tooltip-content="{{ctx.Locale.Tr "edit"}}">{{svg "octicon-pencil"}}</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr class="no-results-row"><td class="tw-text-center" colspan="9">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,89 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin new user")}}
|
||||
<div class="admin-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.users.new_account"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{template "base/disable_form_autofill"}}
|
||||
<!-- Types and name -->
|
||||
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
|
||||
<label>{{ctx.Locale.Tr "admin.users.auth_source"}}</label>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="login_type" name="login_type" value="{{.login_type}}" data-password="required" required>
|
||||
<div class="text">{{ctx.Locale.Tr "admin.users.local"}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item" data-value="0-0">{{ctx.Locale.Tr "admin.users.local"}}</div>
|
||||
{{range .Sources}}
|
||||
<div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field {{if .Err_Visibility}}error{{end}}">
|
||||
<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span>
|
||||
<div class="ui selection type dropdown">
|
||||
<input type="hidden" id="visibility" name="visibility" value="{{if .visibility}}{{printf "%d" .visibility}}{{else}}{{printf "%d" .DefaultUserVisibilityMode}}{{end}}">
|
||||
<div class="text">
|
||||
{{if .DefaultUserVisibilityMode.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
|
||||
{{if .DefaultUserVisibilityMode.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
|
||||
{{if .DefaultUserVisibilityMode.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}}
|
||||
</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range $mode := .AllowedUserVisibilityModes}}
|
||||
{{if $mode.IsPublic}}
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div>
|
||||
{{else if $mode.IsLimited}}
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div>
|
||||
{{else if $mode.IsPrivate}}
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .login_type "0-0"}}tw-hidden{{end}}">
|
||||
<label for="login_name">{{ctx.Locale.Tr "admin.users.auth_login_name"}}</label>
|
||||
<input id="login_name" name="login_name" value="{{.login_name}}">
|
||||
</div>
|
||||
<div class="required field {{if .Err_UserName}}error{{end}}">
|
||||
<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
|
||||
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required maxlength="40">
|
||||
</div>
|
||||
<div class="required field {{if .Err_Email}}error{{end}}">
|
||||
<label for="email">{{ctx.Locale.Tr "email"}}</label>
|
||||
<input id="email" name="email" type="email" value="{{.email}}" required>
|
||||
</div>
|
||||
<div class="required local field {{if .Err_Password}}error{{end}} {{if not (eq .login_type "0-0")}}tw-hidden{{end}}">
|
||||
<label for="password">{{ctx.Locale.Tr "password"}}</label>
|
||||
<input id="password" name="password" type="password" autocomplete="new-password" value="{{.password}}" {{if eq .login_type "0-0"}}required{{end}}>
|
||||
</div>
|
||||
|
||||
<div class="inline field local {{if ne .login_type "0-0"}}tw-hidden{{end}}">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "auth.allow_password_change"}}</strong></label>
|
||||
<input name="must_change_password" type="checkbox" checked>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Send register notify e-mail -->
|
||||
{{if .CanSendEmail}}
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<label><strong>{{ctx.Locale.Tr "admin.users.send_register_notify"}}</strong></label>
|
||||
<input name="send_notify" type="checkbox" {{if .send_notify}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "admin.users.new_account"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{template "admin/layout_head" (dict "pageClass" "admin view user")}}
|
||||
|
||||
<div class="admin-setting-content">
|
||||
<div class="admin-responsive-columns">
|
||||
<div class="tw-flex-1">
|
||||
<h4 class="ui top attached header">
|
||||
{{.Title}}
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{.Link}}/edit">{{ctx.Locale.Tr "admin.users.edit"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{template "admin/user/view_details" .}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw-flex-1">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.emails"}} ({{ctx.Locale.Tr "admin.total" .EmailsTotal}})
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{template "admin/user/view_emails" .}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.repositories"}} ({{ctx.Locale.Tr "admin.total" .ReposTotal}})
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{template "shared/repo/list" .}}
|
||||
</div>
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.organization"}} ({{ctx.Locale.Tr "admin.total" .OrgsTotal}})
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{template "explore/user_list" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -0,0 +1,65 @@
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{ctx.AvatarUtils.Avatar .User 48}}
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
{{template "shared/user/name" .User}}
|
||||
{{if .User.IsAdmin}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "admin.users.admin"}}</span>
|
||||
{{end}}
|
||||
{{if .User.IsTypeBot}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "admin.users.bot"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "admin.users.auth_source"}}:</b>
|
||||
{{Iif (eq .LoginSource.ID 0) (ctx.Locale.Tr "admin.users.local") .LoginSource.Name}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "admin.users.activated"}}:</b>
|
||||
{{svg (Iif .User.IsActive "octicon-check" "octicon-x")}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "admin.users.prohibit_login"}}:</b>
|
||||
{{svg (Iif .User.ProhibitLogin "octicon-check" "octicon-x")}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "admin.users.restricted"}}:</b>
|
||||
{{svg (Iif .User.IsRestricted "octicon-check" "octicon-x")}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "settings.visibility"}}:</b>
|
||||
{{if .User.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
|
||||
{{if .User.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
|
||||
{{if .User.Visibility.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}}
|
||||
</div>
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "admin.users.2fa"}}:</b>
|
||||
{{svg (Iif .TwoFactorEnabled "octicon-check" "octicon-x")}}
|
||||
</div>
|
||||
{{if .User.Language}}
|
||||
<div class="item-body">
|
||||
<span class="flex-text-inline">
|
||||
<b>{{ctx.Locale.Tr "settings.language"}}:</b>
|
||||
{{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}}
|
||||
</span>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .User.Location}}
|
||||
<div class="item-body">
|
||||
<span class="flex-text-inline">{{svg "octicon-location"}}{{.User.Location}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .User.Website}}
|
||||
<div class="item-body">
|
||||
<span class="flex-text-inline">
|
||||
{{svg "octicon-link"}}
|
||||
<a target="_blank" href="{{.User.Website}}">{{.User.Website}}</a>
|
||||
</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .Emails}}
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<div class="flex-text-block">
|
||||
<a href="mailto:{{.Email}}">{{.Email}}</a>
|
||||
{{if .IsPrimary}}
|
||||
<div class="ui primary label">{{ctx.Locale.Tr "settings.primary"}}</div>
|
||||
{{end}}
|
||||
{{if .IsActivated}}
|
||||
<div class="ui green label">{{ctx.Locale.Tr "settings.activated"}}</div>
|
||||
{{else}}
|
||||
<div class="ui label">{{ctx.Locale.Tr "settings.requires_activation"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Links for {{.PackageDescriptor.Package.Name}}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{- /* PEP 503 – Simple Repository API: https://peps.python.org/pep-0503/ */ -}}
|
||||
<h1>Links for {{.PackageDescriptor.Package.Name}}</h1>
|
||||
{{range .PackageDescriptors}}
|
||||
{{$pd := .}}
|
||||
{{range .Files}}
|
||||
<a href="{{$.RegistryURL}}/files/{{$pd.Package.LowerName}}/{{$pd.Version.Version}}/{{.File.Name}}#sha256={{.Blob.HashSHA256}}"{{if $pd.Metadata.RequiresPython}} data-requires-python="{{$pd.Metadata.RequiresPython}}"{{end}}>{{.File.Name}}</a><br>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
{{- if .Flash.ErrorMsg}}{{ctx.RenderUtils.RenderFlashMessage "error" .Flash.ErrorMsg}}{{end -}}
|
||||
{{- if .Flash.WarningMsg}}{{ctx.RenderUtils.RenderFlashMessage "warning" .Flash.WarningMsg}}{{end -}}
|
||||
{{- if .Flash.InfoMsg}}{{ctx.RenderUtils.RenderFlashMessage "info" .Flash.InfoMsg}}{{end -}}
|
||||
{{- if .Flash.SuccessMsg}}{{ctx.RenderUtils.RenderFlashMessage "success" .Flash.SuccessMsg}}{{end -}}
|
||||
{{- if .ShowTwoFactorRequiredMessage -}}
|
||||
<div class="ui error message flash-message flash-error">
|
||||
<a href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{ctx.Locale.Tr "auth.twofa_required"}}</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{.Message}}
|
||||
{{if .Details}}
|
||||
<details>
|
||||
<summary>{{.Summary}}</summary>
|
||||
<pre>{{.Details}}</pre>
|
||||
</details>
|
||||
{{else}}
|
||||
<div>{{.Summary}}</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,31 @@
|
||||
{{/*
|
||||
Why we need to disable form autofill:
|
||||
1. Many pages contain different password inputs for different usages, eg: repo setting, autofill will make a mess.
|
||||
2. We have `areYouSure` confirm dialog if a user leaves a pages without submit.
|
||||
Autofill will make the form changed even if the user didn't input anything. Then the user keeps seeing annoying confirm dialog.
|
||||
|
||||
In history, Gitea put `<input class="fake" type="password">` in forms to bypass the autofill,
|
||||
but there were still many forms suffered the autofill problem.
|
||||
|
||||
Now we improve it.
|
||||
|
||||
Solutions which do NOT work:
|
||||
1. Adding `autocomplete=off` doesn't help. New Chrome completely ignores it.
|
||||
2. Use a JavaScript to run in a few seconds later after the page is loaded to process the autofilled inputs, it doesn't work.
|
||||
Because for security reason, the inputs won't be filled before the user makes an interaction in the page.
|
||||
So we can not predict the correct time to run the JavaScript code.
|
||||
|
||||
Solutions which work:
|
||||
1. Some hacky methods like: https://github.com/matteobad/detect-autofill
|
||||
2. This solution: use invisible inputs. Be aware of:
|
||||
(a) The inputs must be at the beginning of the form, and can not be hidden.
|
||||
(b) The input for username must have a valid name.
|
||||
(c) There should be no negative word (eg: fake) in the `name` attribute.
|
||||
(d) Chrome seems to use a weighted algorithm to choose an input to fill text, so the using "username" as input name is better than using "user".
|
||||
We make the names of these dummy inputs begin with an underline to indicate it is for special usage,
|
||||
and these dummy form values won't be used by backend code.
|
||||
*/}}
|
||||
<div class="autofill-dummy" aria-hidden="true">
|
||||
<input type="text" name="_autofill_dummy_username" class="ays-ignore" tabindex="-1">
|
||||
<input type="password" name="_autofill_dummy_password" class="ays-ignore" tabindex="-1">
|
||||
</div>
|
||||
@@ -0,0 +1,18 @@
|
||||
{{if false}}
|
||||
{{/* to make html structure "likely" complete to prevent IDE warnings */}}
|
||||
<html>
|
||||
<body>
|
||||
<div>
|
||||
{{end}}
|
||||
|
||||
{{template "custom/body_inner_post" .}}
|
||||
</div>
|
||||
{{template "custom/body_outer_post" .}}
|
||||
{{template "base/footer_content" .}}
|
||||
{{ctx.ScriptImport "web_src/js/index.ts" "module"}}
|
||||
{{template "custom/footer" .}}
|
||||
<script nonce="{{ctx.CspScriptNonce}}" type="module">
|
||||
if (!window.config?.frontendInited && window.config?.runModeIsProd) alert("Frontend is not initialized, check console errors or asset files.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<footer class="page-footer" role="group" aria-label="{{ctx.Locale.Tr "aria.footer"}}">
|
||||
<div class="left-links" role="contentinfo" aria-label="{{ctx.Locale.Tr "aria.footer.software"}}">
|
||||
{{if ShowFooterPoweredBy}}
|
||||
<a target="_blank" href="https://about.gitea.com">{{ctx.Locale.Tr "powered_by" "Gitea"}}</a>
|
||||
{{end}}
|
||||
{{if (or .ShowFooterVersion .PageIsAdmin)}}
|
||||
<span>
|
||||
{{ctx.Locale.Tr "version"}}:
|
||||
{{if .IsAdmin}}
|
||||
<a href="{{AppSubUrl}}/-/admin/config">{{AppVer}}</a>
|
||||
{{else}}
|
||||
{{AppVer}}
|
||||
{{end}}
|
||||
</span>
|
||||
{{end}}
|
||||
{{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}}
|
||||
<span>
|
||||
{{ctx.Locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
|
||||
{{ctx.Locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
|
||||
</span>
|
||||
{{end}}
|
||||
{{if $.ViteModeIsDev}}<span class="ui basic label primary">ViteDevMode</span>{{end}}
|
||||
</div>
|
||||
<div class="right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}">
|
||||
<div class="ui dropdown custom" id="footer-theme-selector">
|
||||
<span class="default-text">{{ctx.RenderUtils.RenderThemeItem ctx.CurrentWebTheme 16}}</span>
|
||||
<div class="menu theme-menu"></div>
|
||||
</div>
|
||||
<div class="ui dropdown upward">
|
||||
<span class="flex-text-inline">{{svg "octicon-globe" 14}} {{ctx.Locale.LangName}}</span>
|
||||
<div class="menu language-menu">
|
||||
{{range .AllLangs -}}
|
||||
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq ctx.Locale.Lang .Lang}}selected{{end}}">{{.Name}}</a>
|
||||
{{end -}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{AssetUrlPrefix}}/licenses.txt">{{ctx.Locale.Tr "licenses"}}</a>
|
||||
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
|
||||
{{template "custom/extra_links_footer" .}}
|
||||
</div>
|
||||
</footer>
|
||||
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ctx.Locale.Lang}}" data-theme="{{ctx.CurrentWebTheme.InternalName}}">
|
||||
<head>
|
||||
{{ctx.HeadMetaContentSecurityPolicy}}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{if .Title}}{{.Title}} - {{end}}{{.PageTitleCommon}}</title>
|
||||
<link rel="manifest" href="{{AssetUrlPrefix}}/site-manifest.json">
|
||||
<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{MetaAuthor}}{{end}}">
|
||||
<meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{MetaDescription}}{{end}}">
|
||||
<meta name="keywords" content="{{MetaKeywords}}">
|
||||
<meta name="referrer" content="same-origin">{{/* required by: 1. "redirect_to" cookie; 2. cross-origin protection */}}
|
||||
{{if .GoGetImport}}
|
||||
<meta name="go-import" content="{{.GoGetImport}} git {{.RepoCloneLink.HTTPS}}">
|
||||
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
|
||||
{{end}}
|
||||
{{if and .EnableFeed .FeedURL}}
|
||||
<link rel="alternate" type="application/atom+xml" title="" href="{{.FeedURL}}.atom">
|
||||
<link rel="alternate" type="application/rss+xml" title="" href="{{.FeedURL}}.rss">
|
||||
{{end}}
|
||||
<link rel="icon" href="{{AssetUrlPrefix}}/img/favicon.svg" type="image/svg+xml">
|
||||
<link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png">
|
||||
{{template "base/head_opengraph" .}}
|
||||
{{template "base/head_style" .}}
|
||||
{{template "base/head_script" .}}
|
||||
{{template "custom/header" .}}
|
||||
</head>
|
||||
<body>
|
||||
{{template "custom/body_outer_pre" .}}
|
||||
|
||||
<div class="full height">
|
||||
<noscript>{{ctx.Locale.Tr "enable_javascript"}}</noscript>
|
||||
|
||||
{{template "custom/body_inner_pre" .}}
|
||||
|
||||
{{if not .PageIsInstall}}
|
||||
{{template "base/head_navbar" .}}
|
||||
{{end}}
|
||||
|
||||
{{if false}}
|
||||
{{/* to make html structure "likely" complete to prevent IDE warnings */}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{$banner := ctx.CurrentWebBanner}}
|
||||
{{if $banner}}
|
||||
<div class="ui info message web-banner-container">
|
||||
<div class="render-content markup web-banner-content">
|
||||
{{ctx.RenderUtils.MarkdownToHtml $banner.ContentMessage}}
|
||||
</div>
|
||||
<button type="button" class="btn dismiss-banner link-action" aria-label="{{ctx.Locale.Tr "dismiss"}}" data-url="{{AppSubUrl}}/-/web-banner/dismiss">
|
||||
{{svg "octicon-x"}}
|
||||
</button>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,182 @@
|
||||
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
|
||||
<div class="navbar-left">
|
||||
<!-- the logo -->
|
||||
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home_title"}}{{end}}">
|
||||
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
||||
</a>
|
||||
|
||||
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
|
||||
<div class="ui secondary menu navbar-mobile-right only-mobile">
|
||||
{{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
|
||||
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
|
||||
</div>
|
||||
|
||||
<!-- navbar links non-mobile -->
|
||||
{{if and .IsSigned .MustChangePassword}}
|
||||
{{/* No links */}}
|
||||
{{else if .IsSigned}}
|
||||
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
||||
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
|
||||
{{end}}
|
||||
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
|
||||
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
|
||||
{{end}}
|
||||
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
|
||||
{{if .ShowMilestonesDashboardPage}}
|
||||
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore_title"}}</a>
|
||||
{{else if .IsLandingPageOrganizations}}
|
||||
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore_title"}}</a>
|
||||
{{else}}
|
||||
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore_title"}}</a>
|
||||
{{end}}
|
||||
|
||||
{{template "custom/extra_links" .}}
|
||||
|
||||
{{if not .IsSigned}}
|
||||
<a class="item" target="_blank" href="https://docs.gitea.com">{{ctx.Locale.Tr "help"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<!-- the full dropdown menus -->
|
||||
<div class="navbar-right">
|
||||
{{if and .IsSigned .MustChangePassword}}
|
||||
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
||||
<span class="text">
|
||||
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
|
||||
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
||||
<span class="not-mobile flex-text-block">{{svg "octicon-triangle-down"}}</span>
|
||||
</span>
|
||||
<div class="menu user-menu">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
<a class="item" href="{{AppSubUrl}}/user/logout">
|
||||
{{svg "octicon-sign-out"}}
|
||||
{{ctx.Locale.Tr "sign_out"}}
|
||||
</a>
|
||||
</div><!-- end content avatar menu -->
|
||||
</div><!-- end dropdown avatar menu -->
|
||||
{{else if .IsSigned}}
|
||||
{{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
|
||||
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
|
||||
<span class="flex-text-block">
|
||||
{{svg "octicon-plus"}}
|
||||
<span class="not-mobile flex-text-block">{{svg "octicon-triangle-down"}}</span>
|
||||
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
|
||||
</span>
|
||||
<div class="menu">
|
||||
<a class="item" href="{{AppSubUrl}}/repo/create">
|
||||
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
|
||||
</a>
|
||||
{{if not .DisableMigrations}}
|
||||
<a class="item" href="{{AppSubUrl}}/repo/migrate">
|
||||
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .SignedUser.CanCreateOrganization}}
|
||||
<a class="item" href="{{AppSubUrl}}/org/create">
|
||||
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div><!-- end content create new menu -->
|
||||
</div><!-- end dropdown menu create new -->
|
||||
|
||||
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
||||
<span class="text tw-flex tw-items-center">
|
||||
<span class="navbar-avatar">
|
||||
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-2"}}
|
||||
{{if .IsAdmin}}{{svg "octicon-shield-check" 16 "navbar-admin-badge"}}{{end}}
|
||||
</span>
|
||||
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
||||
<span class="not-mobile flex-text-block">{{svg "octicon-triangle-down"}}</span>
|
||||
</span>
|
||||
<div class="menu user-menu">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
<a class="item" href="{{.SignedUser.HomeLink}}">
|
||||
{{svg "octicon-person"}}
|
||||
{{ctx.Locale.Tr "your_profile"}}
|
||||
</a>
|
||||
{{if not .DisableStars}}
|
||||
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
||||
{{svg "octicon-star"}}
|
||||
{{ctx.Locale.Tr "your_starred"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
||||
{{svg "octicon-bell"}}
|
||||
{{ctx.Locale.Tr "notification.subscriptions"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
||||
{{svg "octicon-tools"}}
|
||||
{{ctx.Locale.Tr "your_settings"}}
|
||||
</a>
|
||||
<a class="item" target="_blank" href="https://docs.gitea.com">
|
||||
{{svg "octicon-question"}}
|
||||
{{ctx.Locale.Tr "help"}}
|
||||
</a>
|
||||
{{if .IsAdmin}}
|
||||
<div class="divider"></div>
|
||||
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
|
||||
{{svg "octicon-server"}}
|
||||
{{ctx.Locale.Tr "admin_panel"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
<a class="item" href="{{AppSubUrl}}/user/logout">
|
||||
{{svg "octicon-sign-out"}}
|
||||
{{ctx.Locale.Tr "sign_out"}}
|
||||
</a>
|
||||
</div><!-- end content avatar menu -->
|
||||
</div><!-- end dropdown avatar menu -->
|
||||
{{else}}
|
||||
{{if .ShowRegistrationButton}}
|
||||
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
||||
{{svg "octicon-person"}}
|
||||
<span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login">
|
||||
{{svg "octicon-sign-in"}}
|
||||
<span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</div><!-- end full right menu -->
|
||||
|
||||
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
|
||||
{{if $activeStopwatch}}
|
||||
<div class="active-stopwatch-popup tippy-target">
|
||||
<div class="flex-text-block tw-p-3">
|
||||
<a class="stopwatch-link flex-text-block muted" href="{{$activeStopwatch.IssueLink}}">
|
||||
{{svg "octicon-issue-opened" 16}}
|
||||
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
|
||||
</a>
|
||||
<div class="tw-flex tw-gap-1">
|
||||
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
|
||||
<button
|
||||
type="submit"
|
||||
class="ui button mini compact basic icon tw-mr-0"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
|
||||
>{{svg "octicon-square-fill"}}</button>
|
||||
</form>
|
||||
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
|
||||
<button
|
||||
type="submit"
|
||||
class="ui button mini compact basic icon tw-mr-0"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
|
||||
>{{svg "octicon-trash"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</nav>
|
||||
{{template "base/head_banner"}}
|
||||
@@ -0,0 +1,20 @@
|
||||
{{- $itemExtraClass := .ItemExtraClass -}}
|
||||
{{- $data := .PageGlobalData -}}
|
||||
{{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
|
||||
{{- $activeStopwatch := call $data.GetActiveStopwatch -}}
|
||||
{{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
|
||||
{{if $activeStopwatch}}
|
||||
<a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
|
||||
<div class="tw-relative flex-text-block">
|
||||
{{svg "octicon-stopwatch"}}
|
||||
<span class="header-stopwatch-dot"></span>
|
||||
</div>
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
|
||||
<div class="tw-relative flex-text-block">
|
||||
{{svg "octicon-bell"}}
|
||||
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
|
||||
</div>
|
||||
</a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,46 @@
|
||||
{{- /* og:description - a one to two sentence description of your object, maybe it only needs at most 300 bytes */ -}}
|
||||
{{if .PageIsUserProfile}}
|
||||
<meta property="og:title" content="{{.ContextUser.DisplayName}}">
|
||||
<meta property="og:type" content="profile">
|
||||
<meta property="og:image" content="{{.ContextUser.AvatarLink ctx}}">
|
||||
<meta property="og:url" content="{{.ContextUser.HTMLURL ctx}}">
|
||||
{{if .ContextUser.Description}}
|
||||
<meta property="og:description" content="{{StringUtils.EllipsisString .ContextUser.Description 300}}">
|
||||
{{end}}
|
||||
{{else if .Repository}}
|
||||
{{if .Issue}}
|
||||
<meta property="og:title" content="{{.Issue.Title}}">
|
||||
<meta property="og:url" content="{{.Issue.HTMLURL ctx}}">
|
||||
{{if .Issue.Content}}
|
||||
<meta property="og:description" content="{{StringUtils.EllipsisString .Issue.Content 300}}">
|
||||
{{end}}
|
||||
{{else if or .PageIsDiff .IsViewFile}}
|
||||
<meta property="og:title" content="{{.Title}}">
|
||||
<meta property="og:url" content="{{ctx.AppFullLink $.Link}}">
|
||||
{{if and .PageIsDiff .Commit}}
|
||||
{{- $commitMessageBody := .Commit.MessageBody -}}
|
||||
{{- if $commitMessageBody -}}
|
||||
<meta property="og:description" content="{{StringUtils.EllipsisString $commitMessageBody 300}}">
|
||||
{{- end -}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
<meta property="og:title" content="{{.Repository.Name}}">
|
||||
<meta property="og:url" content="{{.Repository.HTMLURL ctx}}">
|
||||
{{if .Repository.Description}}
|
||||
<meta property="og:description" content="{{StringUtils.EllipsisString .Repository.Description 300}}">
|
||||
{{end}}
|
||||
{{end}}
|
||||
<meta property="og:type" content="object">
|
||||
{{if (.Repository.AvatarLink ctx)}}
|
||||
<meta property="og:image" content="{{.Repository.AvatarLink ctx}}">
|
||||
{{else}}
|
||||
<meta property="og:image" content="{{.Repository.Owner.AvatarLink ctx}}">
|
||||
{{end}}
|
||||
{{else}}
|
||||
<meta property="og:title" content="{{AppName}}">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png">
|
||||
<meta property="og:url" content="{{ctx.AppFullLink}}">
|
||||
<meta property="og:description" content="{{MetaDescription}}">
|
||||
{{end}}
|
||||
<meta property="og:site_name" content="{{AppName}}">
|
||||
@@ -0,0 +1,34 @@
|
||||
{{/* ==== DO NOT EDIT ====
|
||||
If you are customizing Gitea, please do not change this file.
|
||||
If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly.
|
||||
*/}}
|
||||
<script nonce="{{ctx.CspScriptNonce}}">
|
||||
{{/* before our JS code gets loaded, use arrays to store errors, then the arrays will be switched to our error handler later */}}
|
||||
window.addEventListener('error', function(e) {window._globalHandlerErrors=window._globalHandlerErrors||[]; window._globalHandlerErrors.push(e);});
|
||||
window.addEventListener('unhandledrejection', function(e) {window._globalHandlerErrors=window._globalHandlerErrors||[]; window._globalHandlerErrors.push(e);});
|
||||
window.config = {
|
||||
appUrl: '{{ctx.AppFullLink "/"}}',
|
||||
appSubUrl: '{{AppSubUrl}}',
|
||||
assetUrlPrefix: '{{AssetUrlPrefix}}',
|
||||
runModeIsProd: {{.RunModeIsProd}},
|
||||
customEmojis: {{CustomEmojis}},
|
||||
pageData: {{.PageData}},
|
||||
notificationSettings: {{NotificationSettings}}, {{/*a map provided by NewFuncMap in helper.go*/}}
|
||||
enableTimeTracking: {{EnableTimetracking}},
|
||||
mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}},
|
||||
sharedWorkerUri: '{{AssetURI "web_src/js/eventsource.sharedworker.ts"}}',
|
||||
{{/* this global i18n object should only contain general texts. for specialized texts, it should be provided inside the related modules by: (1) API response (2) HTML data-attribute (3) PageData */}}
|
||||
i18n: {
|
||||
error_occurred: {{ctx.Locale.Tr "error.occurred"}},
|
||||
remove_label_str: {{ctx.Locale.Tr "remove_label_str"}},
|
||||
modal_confirm: {{ctx.Locale.Tr "modal.confirm"}},
|
||||
modal_cancel: {{ctx.Locale.Tr "modal.cancel"}},
|
||||
more_items: {{ctx.Locale.Tr "more_items"}},
|
||||
copy_success: {{ctx.Locale.Tr "copy_success"}},
|
||||
copy_error: {{ctx.Locale.Tr "copy_error"}},
|
||||
},
|
||||
};
|
||||
{{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}}
|
||||
window.config.pageData = window.config.pageData || {};
|
||||
</script>
|
||||
{{ctx.ScriptImport "web_src/js/iife.ts"}}
|
||||
@@ -0,0 +1,2 @@
|
||||
{{AssetCSSLinks "web_src/js/index.ts" "web_src/css/index.css"}}
|
||||
<link rel="stylesheet" href="{{ctx.CurrentWebTheme.PublicAssetURI}}">
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="code-preview-container file-content">
|
||||
<div class="code-preview-header">
|
||||
<a href="{{.FullURL}}" class="tw-font-semibold" rel="nofollow">{{.RepoName}}/{{.FilePath}}</a>
|
||||
{{$link := HTMLFormat `<a href="%s/commit/%s" class="muted tw-font-mono tw-text-text" rel="nofollow">%s</a>` .RepoLink .CommitID (.CommitID | ShortSha) -}}
|
||||
{{- if eq .LineStart .LineStop -}}
|
||||
{{ctx.Locale.Tr "repo.code_preview_line_in" .LineStart $link}}
|
||||
{{- else -}}
|
||||
{{ctx.Locale.Tr "repo.code_preview_line_from_to" .LineStart .LineStop $link}}
|
||||
{{- end}}
|
||||
</div>
|
||||
<table class="file-view">
|
||||
<tbody>
|
||||
{{- range $idx, $line := .HighlightLines -}}
|
||||
<tr>
|
||||
<td class="lines-num"><span data-line-number="{{$line.Num}}"></span></td>
|
||||
{{- ctx.RenderUtils.RenderUnicodeEscapeToggleTd $.EscapeStatus (index $.LineEscapeStatus $idx)}}
|
||||
<td class="lines-code chroma"><div class="code-inner">{{$line.FormattedContent}}</div></td>{{/* only div works, span generates incorrect HTML structure */}}
|
||||
</tr>
|
||||
{{- end -}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
{{/* Two buttons (negative, positive):
|
||||
* ModalButtonTypes: "yes" (default) or "confirm"
|
||||
* ModalButtonCancelText
|
||||
* ModalButtonOkText
|
||||
|
||||
Single danger button (GitHub-like):
|
||||
* ModalButtonDangerText "This action will destroy your data"
|
||||
|
||||
The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal internally
|
||||
*/}}
|
||||
<div class="actions">
|
||||
{{if .ModalButtonDangerText}}
|
||||
<button class="ui danger red ok button">{{.ModalButtonDangerText}}</button>
|
||||
{{else}}
|
||||
{{$textNegative := ctx.Locale.Tr "modal.no"}}
|
||||
{{$textPositive := ctx.Locale.Tr "modal.yes"}}
|
||||
{{if eq .ModalButtonTypes "confirm"}}
|
||||
{{$textNegative = ctx.Locale.Tr "modal.cancel"}}
|
||||
{{$textPositive = ctx.Locale.Tr "modal.confirm"}}
|
||||
{{end}}
|
||||
{{if .ModalButtonCancelText}}{{$textNegative = .ModalButtonCancelText}}{{end}}
|
||||
{{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
|
||||
<button class="ui cancel button">{{svg "octicon-x"}} {{$textNegative}}</button>
|
||||
<button class="ui primary ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
{{$paginationParams := .Page.GetParams}}
|
||||
{{$paginationLink := $.Link}}
|
||||
{{if eq $paginationLink AppSubUrl}}{{$paginationLink = print $paginationLink "/"}}{{end}}
|
||||
{{with .Page.Paginater}}
|
||||
{{if or (eq .TotalPages -1) (gt .TotalPages 1)}}
|
||||
{{$showFirstLast := gt .TotalPages 1}}
|
||||
<div class="center page buttons">
|
||||
<div class="ui borderless pagination menu">
|
||||
{{if $showFirstLast}}
|
||||
<a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$paginationLink}}{{if $paginationParams}}?{{$paginationParams}}{{end}}"{{end}}>
|
||||
{{svg "gitea-double-chevron-left" 16 "tw-mr-1"}}
|
||||
<span class="navigation_label">{{ctx.Locale.Tr "admin.first_page"}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
<a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$paginationLink}}?page={{.Previous}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
|
||||
{{svg "octicon-chevron-left" 16 "tw-mr-1"}}
|
||||
<span class="navigation_label">{{ctx.Locale.Tr "repo.issues.previous"}}</span>
|
||||
</a>
|
||||
{{$pages := .Pages}}
|
||||
{{$pagesLen := len $pages}}
|
||||
{{range $pages}}
|
||||
{{if eq .Num -1}}
|
||||
<a class="disabled item">...</a>
|
||||
{{else}}
|
||||
{{/* do not highlight the current page if there is only one page */}}
|
||||
<a class="{{if and .IsCurrent (gt $pagesLen 1)}}active {{end}}item" {{if not .IsCurrent}}href="{{$paginationLink}}?page={{.Num}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>{{.Num}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$paginationLink}}?page={{.Next}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
|
||||
<span class="navigation_label">{{ctx.Locale.Tr "repo.issues.next"}}</span>
|
||||
{{svg "octicon-chevron-right" 16 "tw-ml-1"}}
|
||||
</a>
|
||||
|
||||
{{if $showFirstLast}}
|
||||
<a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$paginationLink}}?page={{.TotalPages}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
|
||||
<span class="navigation_label">{{ctx.Locale.Tr "admin.last_page"}}</span>
|
||||
{{svg "gitea-double-chevron-right" 16 "tw-ml-1"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>Actions SVG</h1>
|
||||
<form class="tw-my-3">
|
||||
<div class="tw-mb-2">
|
||||
{{range $fontName := .BadgeFontFamilyNames}}
|
||||
<label><input name="font" type="radio" value="{{$fontName}}" {{Iif (eq $.SelectedFontFamilyName $fontName) "checked"}}>{{$fontName}}</label>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="tw-mb-2">
|
||||
{{range $style := .BadgeStyles}}
|
||||
<label><input name="style" type="radio" value="{{$style}}" {{Iif (eq $.SelectedStyle $style) "checked"}}>{{$style}}</label>
|
||||
{{end}}
|
||||
</div>
|
||||
<button>submit</button>
|
||||
</form>
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
{{range $badgeSVG := .BadgeSVGs}}
|
||||
<div>{{$badgeSVG}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>Commit Sign Badges</h1>
|
||||
{{range $commit := .MockCommits}}
|
||||
<div class="flex-text-block tw-my-2">
|
||||
{{template "repo/commit_sign_badge" dict "Commit" $commit "CommitBaseLink" "/devtest/commit" "CommitSignVerification" $commit.Verification}}
|
||||
{{template "repo/commit_sign_badge" dict "CommitSignVerification" $commit.Verification}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1 @@
|
||||
{{template "base/footer" ctx.RootData}}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{template "base/head" ctx.RootData}}
|
||||
<link rel="stylesheet" href="{{AssetURI "web_src/css/devtest.css"}}">
|
||||
<div class="tw-hidden" data-global-init="initDevtestPage"></div>
|
||||
<div class="ui container tw-mt-4">{{template "base/alert" ctx.RootData}}</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<ul>
|
||||
{{range .SubNames}}
|
||||
<li><a href="{{AppSubUrl}}/devtest/{{.}}">{{.}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<style>
|
||||
ul {
|
||||
line-height: 2em;
|
||||
}
|
||||
</style>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,34 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>link-action</h1>
|
||||
<div>
|
||||
The request is defined in an "A" or "BUTTON" element.
|
||||
It might be renamed to "link-fetch-action" to match the "form-fetch-action".
|
||||
</div>
|
||||
<div>
|
||||
<button class="link-action" data-url="fetch-action-test?k=1">test action</button>
|
||||
<button class="link-action" data-url="fetch-action-test?k=1" data-modal-confirm="confirm?">test with confirm</button>
|
||||
<button class="ui red button link-action" data-url="fetch-action-test?k=1" data-modal-confirm="confirm?">test with risky confirm</button>
|
||||
<button class="ui button link-action" data-url="fetch-action-test?k=1" data-modal-confirm-header="confirm header" data-modal-confirm-content="confirm content">test with confirm header</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h1>form-fetch-action</h1>
|
||||
<div class="flex-relaxed-list fetch-action-demo-forms">
|
||||
<form method="get" action="./fetch-action-test?k=1" class="form-fetch-action">
|
||||
<button name="btn">submit get</button>
|
||||
</form>
|
||||
<form method="post" action="./fetch-action-test?k=1" class="form-fetch-action">
|
||||
<div><textarea name="text" rows="3"></textarea></div>
|
||||
<div><label><input name="check" type="checkbox"> check</label></div>
|
||||
<div><button name="btn">submit post</button></div>
|
||||
</form>
|
||||
<form method="post" action="/-/no-such-uri" class="form-fetch-action">
|
||||
<div class="tw-py-8">bad action url</div>
|
||||
<div><button name="btn">submit test</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,136 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest">
|
||||
<div class="ui container">
|
||||
<h3>Flex List (standalone)</h3>
|
||||
<div class="divider"></div>
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-info" 32}}
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
Flex Item
|
||||
<span class="ui basic label">
|
||||
with label
|
||||
</span>
|
||||
</div>
|
||||
<div class="item-body">
|
||||
consists of leading/main/trailing part
|
||||
</div>
|
||||
<div class="item-body">
|
||||
main part contains title and (multiple) body lines
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-trailing">
|
||||
<button class="ui tiny red button">
|
||||
{{svg "octicon-alert" 14}} CJK文本测试
|
||||
</button>
|
||||
<button class="ui tiny primary button">
|
||||
{{svg "octicon-info" 14}} Button
|
||||
</button>
|
||||
<button class="ui tiny primary button">
|
||||
Button with long text
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-info" 32}}
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong title
|
||||
</div>
|
||||
<div class="item-body">
|
||||
consists of leading/main/trailing part
|
||||
</div>
|
||||
<div class="item-body">
|
||||
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content
|
||||
<span class="tw-inline-block tw-truncate">Truncate very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-trailing">
|
||||
<button class="ui tiny red button">
|
||||
{{svg "octicon-alert" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-repo" 32}}
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<div class="item-header">
|
||||
<div class="item-title">
|
||||
<a class="tw-text-primary" href="{{$.Link}}">
|
||||
gitea-org / gitea
|
||||
</a>
|
||||
<span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
|
||||
</div>
|
||||
<div class="item-trailing">
|
||||
<a class="muted" href="{{$.Link}}">
|
||||
<span class="flex-text-inline"><i class="color-icon tw-mr-2 tw-bg-blue"></i>Go</span>
|
||||
</a>
|
||||
<a class="tw-text-text-light flex-text-inline" href="{{$.Link}}">{{svg "octicon-star" 16}}45000</a>
|
||||
<a class="tw-text-text-light flex-text-inline" href="{{$.Link}}">{{svg "octicon-git-branch" 16}}1234</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-body">
|
||||
when inside header, the trailing part will wrap below the title
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<h3>Flex List (with "ui segment")</h3>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-divided-list">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui attached segment">
|
||||
<h4>segment header</h4>
|
||||
<div class="flex-divided-list">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<h3>Flex List (with "ui segment fitted", items have their own padding)</h3>
|
||||
<div class="ui fitted segment">
|
||||
<div class="flex-divided-list items-px-default">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
<div class="item">item 3</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>If parent provides padding or items need their own flex and/or padding:</h3>
|
||||
<div class="tw-border tw-border-secondary">
|
||||
<div class="tw-m-3">before divider</div>
|
||||
<div class="divider"></div>
|
||||
<div class="flex-divided-list flex-items-block items-px-default">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div class="tw-m-3">after divider</div>
|
||||
</div>
|
||||
<div class="tw-border tw-border-secondary tw-p-4 tw-my-2">
|
||||
<div>before divider</div>
|
||||
<div class="divider"></div>
|
||||
<div class="flex-divided-list">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div>after divider</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,130 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h2>Dropdown</h2>
|
||||
<div>
|
||||
<div class="ui dropdown tw-border tw-border-red tw-border-dashed" data-tooltip-content="border for demo purpose only">
|
||||
<span class="text">search-input & flexed items in menu</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu flex-items-menu">
|
||||
<div class="ui icon search input"><i class="icon">{{svg "octicon-search"}}</i><input type="text" value="search input in menu"></div>
|
||||
<div class="item"><input type="radio">item</div>
|
||||
<div class="item"><input type="radio">item</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui search selection dropdown">
|
||||
<span class="text">search ...</span>
|
||||
<input name="value" class="search">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
{{svg "octicon-x" 14 "remove icon"}}
|
||||
<div class="menu">
|
||||
<div class="item">item</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui multiple selection dropdown">
|
||||
<input class="hidden" value="1">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
{{svg "octicon-x" 14 "remove icon"}}
|
||||
<div class="default text">empty multiple dropdown</div>
|
||||
<div class="menu">
|
||||
<div class="item">item</div>
|
||||
<div class="item">sm1</div>
|
||||
<div class="item">sm2</div>
|
||||
<div class="item">medium1</div>
|
||||
<div class="item">medium2</div>
|
||||
<div class="item">large item1</div>
|
||||
<div class="item">large item2</div>
|
||||
<div class="item">large item3</div>
|
||||
<div class="item">very large item test 1</div>
|
||||
<div class="item">very large item test 2</div>
|
||||
<div class="item">very large item test 3</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui buttons">
|
||||
<button class="ui button">Button with Dropdown</button>
|
||||
<div class="ui dropdown button icon">
|
||||
{{svg "octicon-triangle-down"}}
|
||||
<div class="menu">
|
||||
<div class="item">item</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="ui multiple clearable search selection dropdown tw-max-w-[220px]">
|
||||
<input type="hidden" value="1,2,3,4,5,10">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
{{svg "octicon-x" 14 "remove icon"}}
|
||||
<div class="default text">clearable search dropdown</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="1">item</div>
|
||||
<div class="item" data-value="2">sm1</div>
|
||||
<div class="item" data-value="3">sm2</div>
|
||||
<div class="item" data-value="4">medium1</div>
|
||||
<div class="item" data-value="5">medium2</div>
|
||||
<div class="item" data-value="6">large item1</div>
|
||||
<div class="item" data-value="7">large item2</div>
|
||||
<div class="item" data-value="8">large item3</div>
|
||||
<div class="item" data-value="9">very large item test 1</div>
|
||||
<div class="item" data-value="10">very large item test 2</div>
|
||||
<div class="item" data-value="11">very large item test 3</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Selection</h2>
|
||||
<div>
|
||||
{{/* the "selection" class is optional, it will be added by JS automatically */}}
|
||||
<select class="ui dropdown selection ellipsis-text-items">
|
||||
<option>a</option>
|
||||
<option>abcdefuvwxyz</option>
|
||||
<option>loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</option>
|
||||
</select>
|
||||
<select class="ui dropdown ellipsis-text-items tw-max-w-[8em]">
|
||||
<option>loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</option>
|
||||
<option>abcdefuvwxyz</option>
|
||||
<option>a</option>
|
||||
</select>
|
||||
</div>
|
||||
<h2>Dropdown Button (demo only without menu)</h2>
|
||||
<div>
|
||||
<div class="ui dropdown mini button">
|
||||
<span class="text">mini dropdown</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="ui dropdown tiny button">
|
||||
<span class="text">tiny dropdown</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="ui button dropdown">
|
||||
<span class="text">button dropdown</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="ui dropdown mini compact button">
|
||||
<span class="text">mini compact</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="ui dropdown tiny compact button">
|
||||
<span class="text">tiny compact</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="ui button compact dropdown">
|
||||
<span class="text">button compact</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<hr>
|
||||
<div class="ui tiny button">Other button align with ...</div>
|
||||
<div class="ui dropdown tiny button">
|
||||
<span class="text">... Dropdown Button</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,95 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div class="modal-buttons flex-text-block tw-flex-wrap"></div>
|
||||
<div id="test-modal-form-1" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 1)</div>
|
||||
<form class="content" method="post" action="?mock_response_delay=1">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="test-modal-form-2" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 2)</div>
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
<div class="content">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="test-modal-form-3" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 3)</div>
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
<div class="content">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="test-modal-form-4" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 4)</div>
|
||||
<div class="content">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
</div>
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="test-modal-form-5" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 5)</div>
|
||||
<div class="content">
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm modal" id="test-modal-default">
|
||||
<div class="header">{{svg "octicon-file"}} Default dialog <span>title</span></div>
|
||||
<div class="content">
|
||||
very long aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm"}}
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm modal" id="test-modal-confirm">
|
||||
<div class="header">Confirm dialog</div>
|
||||
<div class="content">hello, this is the modal dialog content</div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm modal" id="test-modal-danger">
|
||||
{{svg "octicon-x" 16 "inside close"}}
|
||||
<div class="header">dangerous action dialog</div>
|
||||
<div class="content">hello, this is the modal dialog content, this is a dangerous operation</div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonDangerText" "I know and must do this is dangerous operation")}}
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<button class="show-modal" data-modal="#test-modal-fill-values"
|
||||
data-modal-fill-by-id="value for id"
|
||||
data-modal-fill-by-name="value for name"
|
||||
data-modal-fill-by-class="value for class"
|
||||
data-modal-p="value for tag"
|
||||
data-modal-a.text-content="fill with attr"
|
||||
>test-modal-fill-values</button>
|
||||
|
||||
<div id="test-modal-fill-values" class="ui mini modal" data-skip-button>
|
||||
<div class="header">Modal dialog (fill values)</div>
|
||||
<form class="content">
|
||||
<div id="fill-by-id"></div>
|
||||
<input name="fill-by-name">
|
||||
<div class="fill-by-class"></div>
|
||||
<p></p>
|
||||
<a href="#">link</a>
|
||||
{{template "base/modal_actions_confirm" dict}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,109 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<form class="ui form left-right-form">
|
||||
<h4 class="ui dividing header">Input</h4>
|
||||
<div class="inline field">
|
||||
<label>Normal</label>
|
||||
<input type="text" value="value">
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>Readonly</label>
|
||||
<input type="text" value="value" readonly>
|
||||
</div>
|
||||
<div class="inline disabled field">
|
||||
<label>Disabled</label>
|
||||
<input type="text" value="value" disabled>
|
||||
</div>
|
||||
<div class="inline field error">
|
||||
<label>Error</label>
|
||||
<input type="text" value="value">
|
||||
</div>
|
||||
|
||||
<h4 class="ui dividing header">Textarea</h4>
|
||||
<div class="inline field">
|
||||
<label>Normal</label>
|
||||
<textarea rows="2">value</textarea>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>Readonly</label>
|
||||
<textarea rows="2" readonly>value</textarea>
|
||||
</div>
|
||||
<div class="inline disabled field">
|
||||
<label>Disabled</label>
|
||||
<textarea rows="2" disabled>value</textarea>
|
||||
</div>
|
||||
<div class="inline field error">
|
||||
<label>Error</label>
|
||||
<textarea rows="2">value</textarea>
|
||||
</div>
|
||||
|
||||
<h4 class="ui dividing header">Dropdown</h4>
|
||||
<div class="inline field">
|
||||
<label>Normal</label>
|
||||
<div class="ui selection dropdown">
|
||||
<input type="hidden" value="a">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">Option A</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="a">Option A</div>
|
||||
<div class="item" data-value="b">Option B</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>Readonly</label>
|
||||
<div class="ui selection dropdown" readonly>
|
||||
<input type="hidden" value="a">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">Option A</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="a">Option A</div>
|
||||
<div class="item" data-value="b">Option B</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline disabled field">
|
||||
<label>Disabled</label>
|
||||
<div class="ui selection dropdown">
|
||||
<input type="hidden" value="a">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">Option A</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="a">Option A</div>
|
||||
<div class="item" data-value="b">Option B</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field error">
|
||||
<label>Error</label>
|
||||
<div class="ui selection dropdown">
|
||||
<input type="hidden" value="a">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">Option A</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="a">Option A</div>
|
||||
<div class="item" data-value="b">Option B</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="ui dividing header">Required</h4>
|
||||
<div class="inline required field">
|
||||
<label>Normal</label>
|
||||
<input type="text" value="value">
|
||||
</div>
|
||||
<div class="inline required field">
|
||||
<label>Readonly</label>
|
||||
<input type="text" value="value" readonly>
|
||||
</div>
|
||||
<div class="inline required disabled field">
|
||||
<label>Disabled</label>
|
||||
<input type="text" value="value" disabled>
|
||||
</div>
|
||||
<div class="inline required field error">
|
||||
<label>Error</label>
|
||||
<input type="text" value="value">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,158 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>Link</h1>
|
||||
<div>
|
||||
<a href="#">normal</a>
|
||||
<a class="muted" href="#">muted</a>
|
||||
<a class="suppressed" href="#">suppressed</a>
|
||||
<a class="silenced" href="#">silenced</a>
|
||||
</div>
|
||||
<h1>Button</h1>
|
||||
".ui.button" styles:
|
||||
<div class="flex-text-block tw-gap-4">
|
||||
<label class="gt-checkbox"><input type="radio" name="button-style-size" value="">(normal)</label>
|
||||
<label class="gt-checkbox"><input type="radio" name="button-style-size" value="small">small</label>
|
||||
<label class="gt-checkbox"><input type="radio" name="button-style-size" value="tiny">tiny</label>
|
||||
<label class="gt-checkbox"><input type="radio" name="button-style-size" value="mini">mini</label>
|
||||
</div>
|
||||
<div class="flex-text-block tw-gap-4">
|
||||
<label class="gt-checkbox"><input type="checkbox" name="button-style-compact" value="compact">compact</label>
|
||||
<label class="gt-checkbox"><input type="checkbox" name="button-state-disabled" value="disabled">disabled</label>
|
||||
</div>
|
||||
<div id="devtest-button-samples">
|
||||
<ul class="button-sample-groups">
|
||||
<li class="sample-group">
|
||||
<h2>General purpose:</h2>
|
||||
<button class="ui button">Unclassed</button>
|
||||
<button class="ui basic button">Basic Unclassed</button>
|
||||
<button class="ui primary button">Primary</button>
|
||||
<button class="ui basic primary button">Basic Primary</button>
|
||||
</li>
|
||||
<li class="sample-group">
|
||||
<h2>Recommended colors:</h2>
|
||||
<button class="ui red button">Red</button>
|
||||
<button class="ui basic red button">Basic Red</button>
|
||||
<button class="ui green button">Green</button>
|
||||
<button class="ui basic green button">Basic Green</button>
|
||||
</li>
|
||||
<li class="sample-group">
|
||||
<h2>Inline / Plain:</h2>
|
||||
<div class="tw-my-1">
|
||||
<button class="btn tw-p-2">Plain button</button>
|
||||
<button class="btn interact-fg tw-p-2">Plain button with interact fg</button>
|
||||
<button class="btn interact-bg tw-p-2">Plain button with interact bg</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1>Buttons</h1>
|
||||
<div class="ui buttons"><button class="ui button">1</button><button class="ui button">2</button><button class="ui button">3</button></div>
|
||||
<div class="ui buttons"><button class="ui button active">1</button><button class="ui button">2</button><button class="ui button">3</button></div>
|
||||
<div class="ui buttons"><button class="ui button">1</button><button class="ui button active">2</button><button class="ui button">3</button></div>
|
||||
<div class="ui buttons"><button class="ui button">1</button><button class="ui button">2</button><button class="ui button active">3</button></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1>Tooltip</h1>
|
||||
<div><span data-tooltip-content="test tooltip">text with tooltip</span></div>
|
||||
<div><span data-tooltip-content="test tooltip" data-tooltip-interactive="true">text with interactive tooltip</span></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1>Loading</h1>
|
||||
<div class="is-loading loading-icon-2px tw-border tw-border-secondary tw-py-1"><span>loading ...</span></div>
|
||||
<div class="is-loading tw-border tw-border-secondary tw-py-4">
|
||||
<p>loading ...</p>
|
||||
<p>loading ...</p>
|
||||
<p>loading ...</p>
|
||||
<p>loading ...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1><overflow-menu></h1>
|
||||
<overflow-menu class="ui secondary pointing tabular borderless menu">
|
||||
<div class="overflow-menu-items">
|
||||
<a class="active item">item</a>
|
||||
<a class="item">item 1</a>
|
||||
<a class="item">item 2</a>
|
||||
<a class="item">item 3</a>
|
||||
<a class="item">item 4</a>
|
||||
<a class="item">item 5</a>
|
||||
<a class="item">item 6</a>
|
||||
<a class="item">item 7</a>
|
||||
<a class="item">item 8</a>
|
||||
<a class="item">item 9</a>
|
||||
<a class="item">item 10</a>
|
||||
<a class="item">item 11</a>
|
||||
<a class="item">item 12</a>
|
||||
<a class="item">item 13</a>
|
||||
<a class="item">item 14</a>
|
||||
<a class="item">item 15</a>
|
||||
<a class="item">item 16</a>
|
||||
<a class="item">item 17</a>
|
||||
<a class="item">item 18</a>
|
||||
</div>
|
||||
</overflow-menu>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1>LocaleNumber</h1>
|
||||
<div>{{ctx.Locale.PrettyNumber 1}}</div>
|
||||
<div>{{ctx.Locale.PrettyNumber 12}}</div>
|
||||
<div>{{ctx.Locale.PrettyNumber 123}}</div>
|
||||
<div>{{ctx.Locale.PrettyNumber 1234}}</div>
|
||||
<div>{{ctx.Locale.PrettyNumber 12345}}</div>
|
||||
<div>{{ctx.Locale.PrettyNumber 123456}}</div>
|
||||
<div>{{ctx.Locale.PrettyNumber 1234567}}</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1>SVG alignment</h1>
|
||||
|
||||
<h2>Text with SVG</h2>
|
||||
<div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div>
|
||||
<div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div>
|
||||
|
||||
<div class="flex-text-block">{{svg "octicon-alert"}} flex item with very very very very very very very very long content</div>
|
||||
|
||||
<div class="flex-items-block">
|
||||
<div class="item">{{svg "octicon-alert"}} flex every line</div>
|
||||
<div class="item">{{svg "octicon-alert"}} flex every item</div>
|
||||
<div class="item">{{svg "octicon-alert"}} flex item with very very very very very very very very long content</div>
|
||||
</div>
|
||||
|
||||
<h2>Button with SVG</h2>
|
||||
<div>
|
||||
<button class="ui red button">{{svg "octicon-alert" 24}} {{svg "octicon-x" 24}} text</button>
|
||||
<div class="ui labeled button">
|
||||
<button class="ui basic button">labeled button</button>
|
||||
<a class="ui basic label">123</a>
|
||||
</div>
|
||||
<button class="ui button">{{svg "octicon-x" 16}} button with very very very very very very very very long text</button>
|
||||
</div>
|
||||
|
||||
<h2>Input with SVG</h2>
|
||||
<div>
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="place holder">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1>ComboMarkdownEditor</h1>
|
||||
{{template "shared/combomarkdowneditor" dict "MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorGeneral nil)}}
|
||||
</div>
|
||||
|
||||
<h1>Tailwind CSS Demo</h1>
|
||||
<div>
|
||||
<button class="{{if true}}tw-bg-red{{end}} tw-p-5 tw-border tw-rounded hover:tw-bg-blue active:tw-bg-yellow">Button</button>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>Show/Hide panel</h1>
|
||||
<div>
|
||||
<!-- to test Space/Enter also works on non-button buttons with children -->
|
||||
<div tabindex="0" class="ui button show-panel toggle" data-panel="#devtest-panel-show-hide"><span>Toggle panel 1</span></div>
|
||||
<span tabindex="0" class="ui button show-panel" data-panel="#devtest-panel-show-hide"><span>Show panel 1</span></span>
|
||||
</div>
|
||||
<div id="devtest-panel-show-hide">
|
||||
<div>Panel 1 content</div>
|
||||
<div class="ui button hide-panel" data-panel-closest="div">Hide panel 1</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,23 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<h1>Keyboard Shortcut</h1>
|
||||
|
||||
<div>
|
||||
<div class="ui input global-shortcut-wrapper">
|
||||
<input class="ui input" placeholder="Press S to focus">
|
||||
<kbd data-global-init="onGlobalShortcut" data-shortcut-keys="s">S</kbd>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tw-mt-2">
|
||||
<div class="ui action input">
|
||||
<div class="ui input global-shortcut-wrapper">
|
||||
<input class="ui input" placeholder="Press T to focus">
|
||||
<kbd data-global-init="onGlobalShortcut" data-shortcut-keys="t">T</kbd>
|
||||
</div>
|
||||
<button class="ui button">Go</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>Label</h1>
|
||||
<div class="flex-text-block tw-my-2">
|
||||
<span class="ui label">simple label</span>
|
||||
<span class="ui red label">red label</span>
|
||||
<span class="ui green label">green label</span>
|
||||
</div>
|
||||
<div class="flex-text-block tw-my-2">
|
||||
<span class="ui basic label">basic label</span>
|
||||
<span class="ui basic red label">basic red label</span>
|
||||
<span class="ui basic green label">basic green label</span>
|
||||
</div>
|
||||
<div class="flex-text-block tw-my-2">
|
||||
<span class="ui label">long content must be in a non-flex "gt-ellipsis" element, otherwise it won't get ellipsis. very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label</span>
|
||||
</div>
|
||||
<div class="flex-text-block tw-my-2">
|
||||
<span class="ui label"><span class="gt-ellipsis">very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label</span></span>
|
||||
</div>
|
||||
<div class="tw-my-2">
|
||||
<span class="ui label tw-max-w-full"><span class="gt-ellipsis">very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,27 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
{{range $templateName := .MailTemplateNames}}
|
||||
<a class="ui button" href="?tmpl={{$templateName}}">{{$templateName}}</a>
|
||||
{{else}}
|
||||
<p>Mailer service is not enabled or no template is found</p>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if .RenderMailTemplateName}}
|
||||
<div class="tw-my-2">
|
||||
<div>Preview of: {{.RenderMailTemplateName}}</div>
|
||||
<div>Subject: {{.RenderMailSubject}}</div>
|
||||
<iframe src="{{AppSubUrl}}/devtest/mail-preview/{{.RenderMailTemplateName}}" class="mail-preview-body"></iframe>
|
||||
<style>
|
||||
.mail-preview-body {
|
||||
border: 1px solid #ccc;
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,71 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
{{$longCode := "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}}
|
||||
<div class="tw-flex">
|
||||
<div class="tw-w-[50%] tw-p-4">
|
||||
<div class="markup render-content">
|
||||
Inline <code>code</code> content
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="markup render-content">
|
||||
<p>content before</p>
|
||||
<pre><code>Very long line with no code block or container: {{$longCode}}</code></pre>
|
||||
<p>content after</p>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="markup render-content">
|
||||
<p>content before</p>
|
||||
<div class="code-block-container code-overflow-wrap">
|
||||
<pre class="code-block"><code>Very long line with wrap: {{$longCode}}</code></pre>
|
||||
</div>
|
||||
<p>content after</p>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="markup render-content">
|
||||
<p>content before</p>
|
||||
<div class="code-block-container code-overflow-scroll">
|
||||
<pre class="code-block"><code>Short line in scroll container</code></pre>
|
||||
</div>
|
||||
<div class="code-block-container code-overflow-scroll">
|
||||
<pre class="code-block"><code>Very long line with scroll: {{$longCode}}</code></pre>
|
||||
</div>
|
||||
<p>content after</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tw-w-[50%] tw-p-4">
|
||||
<div class="markup render-content">
|
||||
<p>content before</p>
|
||||
<div class="code-block-container">
|
||||
<pre class="code-block"><code class="language-math">
|
||||
\lim\limits_{n\rightarrow\infty}{\left(1+\frac{1}{n}\right)^n}
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>content after</p>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="markup render-content">
|
||||
<p>content before</p>
|
||||
<div class="code-block-container">
|
||||
<pre class="code-block"><code class="language-mermaid is-loading">
|
||||
graph LR
|
||||
A[Square Rect] -- Link text --> B((Circle))
|
||||
A --> C(Round Rect)
|
||||
B --> D{Rhombus}
|
||||
C --> D
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>content after</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,67 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div class="tw-grid tw-grid-cols-3 tw-gap-4">
|
||||
<div>
|
||||
<h2>Relative (auto)</h2>
|
||||
<div>now: <relative-time data-testid="relative-time-now" datetime="{{.TimeNow.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>3m ago: <relative-time datetime="{{.TimePast3m.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>3h ago: <relative-time datetime="{{.TimePast3h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>1d ago: <relative-time datetime="{{.TimePast1d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>3d ago: <relative-time datetime="{{.TimePast3d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>3d future: <relative-time datetime="{{.TimeFuture3d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>40d ago (threshold): <relative-time datetime="{{.TimePast40d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>tense=past</h2>
|
||||
<div>3m ago: <relative-time tense="past" datetime="{{.TimePast3m.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>future clamped: <relative-time tense="past" datetime="{{.TimeFuture1h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>60d ago: <relative-time tense="past" datetime="{{.TimePast60d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>tense=future</h2>
|
||||
<div>3h future: <relative-time tense="future" datetime="{{.TimeFuture3h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>past clamped: <relative-time tense="future" datetime="{{.TimePast1h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Duration</h2>
|
||||
<div>0s: <relative-time format="duration" datetime="{{.TimeNow.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>3h: <relative-time format="duration" datetime="{{.TimePast3h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>1d 2h: <relative-time format="duration" datetime="{{.TimePast26h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>short: <relative-time format="duration" format-style="short" datetime="{{.TimePast26h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>narrow: <relative-time format="duration" format-style="narrow" datetime="{{.TimePast26h.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Datetime (absolute)</h2>
|
||||
<div>default: <relative-time format="datetime" datetime="2024-03-11"></relative-time></div>
|
||||
<div>month=short: <relative-time datetime="2024-03-11" threshold="P0Y" prefix="" weekday="" year="numeric" month="short"></relative-time></div>
|
||||
<div>month=long: <relative-time datetime="2024-03-11" threshold="P0Y" prefix="" weekday="" year="numeric" month="long"></relative-time></div>
|
||||
<div>numeric: <relative-time datetime="2024-03-11" threshold="P0Y" prefix="" weekday="" year="" day="numeric" month="numeric"></relative-time></div>
|
||||
<div>weekday: <relative-time datetime="2024-03-11" threshold="P0Y" prefix="" weekday="long" year="" month="numeric"></relative-time></div>
|
||||
<div>with time: <relative-time datetime="2024-03-11T19:00:00-05:00" threshold="P0Y" prefix="" weekday="long" year="" month="numeric"></relative-time></div>
|
||||
<div>minutes: <relative-time datetime="2024-03-11T19:30:45-05:00" threshold="P0Y" prefix="" weekday="" year="numeric" month="short" hour="numeric" minute="2-digit"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Threshold</h2>
|
||||
<div>P0Y: <relative-time threshold="P0Y" prefix="" weekday="" year="numeric" month="short" datetime="{{.TimePast1d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>P1D: <relative-time threshold="P1D" datetime="{{.TimePast2d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
<div>P30D: <relative-time datetime="{{.TimePast1d.Format "2006-01-02T15:04:05Z07:00"}}"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Prefix</h2>
|
||||
<div>default: <relative-time datetime="2024-03-11"></relative-time></div>
|
||||
<div>prefix="": <relative-time prefix="" datetime="2024-03-11"></relative-time></div>
|
||||
<div>prefix="at": <relative-time prefix="at" datetime="2024-03-11"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>TimeSince (Go helper)</h2>
|
||||
<div>now: {{DateUtils.TimeSince .TimeNow}}</div>
|
||||
<div>5s past: {{DateUtils.TimeSince .TimePast5s}}</div>
|
||||
<div>5s future: {{DateUtils.TimeSince .TimeFuture5s}}</div>
|
||||
<div>2m past: {{DateUtils.TimeSince .TimePast2m}}</div>
|
||||
<div>2m future: {{DateUtils.TimeSince .TimeFuture2m}}</div>
|
||||
<div>1y past: {{DateUtils.TimeSince .TimePast1y}}</div>
|
||||
<div>1y future: {{DateUtils.TimeSince .TimeFuture1y}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,15 @@
|
||||
{{template "base/head" .}}
|
||||
<div class="page-content">
|
||||
<div class="flex-text-block tw-justify-center tw-gap-5">
|
||||
<a href="/devtest/repo-action-view/runs/10">Run:CanCancel</a>
|
||||
<a href="/devtest/repo-action-view/runs/20">Run:CanApprove</a>
|
||||
<a href="/devtest/repo-action-view/runs/30">Run:CanRerunLatest</a>
|
||||
<a href="/devtest/repo-action-view/runs/10/attempts/2">Run:PreviousAttempt</a>
|
||||
<a href="/devtest/repo-action-view/runs/40">Run:ReusableCaller</a>
|
||||
</div>
|
||||
{{template "repo/actions/view_component" (dict
|
||||
"JobID" (or .JobID 0)
|
||||
"ActionsViewURL" $.ActionsViewURL
|
||||
)}}
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,115 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<h1>Severity Colors</h1>
|
||||
|
||||
<h2>Messages</h2>
|
||||
<div class="ui error message">
|
||||
<div class="header">Error Message</div>
|
||||
<p>This is an error message using --color-error-* variables.</p>
|
||||
</div>
|
||||
<div class="ui warning message">
|
||||
<div class="header">Warning Message</div>
|
||||
<p>This is a warning message using --color-warning-* variables.</p>
|
||||
</div>
|
||||
<div class="ui success message">
|
||||
<div class="header">Success Message</div>
|
||||
<p>This is a success message using --color-success-* variables.</p>
|
||||
</div>
|
||||
<div class="ui info message">
|
||||
<div class="header">Info Message</div>
|
||||
<p>This is an info message using --color-info-* variables.</p>
|
||||
</div>
|
||||
|
||||
<h2>Markdown Attention Blocks</h2>
|
||||
<div class="markup render-content">
|
||||
<blockquote class="attention-header attention-note"><p>{{svg "octicon-info" 16 "attention-icon attention-note"}}<strong class="attention-note">Note</strong></p>
|
||||
<p>Useful information that users should know, even when skimming content.</p>
|
||||
</blockquote>
|
||||
<blockquote class="attention-header attention-tip"><p>{{svg "octicon-light-bulb" 16 "attention-icon attention-tip"}}<strong class="attention-tip">Tip</strong></p>
|
||||
<p>Helpful advice for doing things better or more easily.</p>
|
||||
</blockquote>
|
||||
<blockquote class="attention-header attention-important"><p>{{svg "octicon-report" 16 "attention-icon attention-important"}}<strong class="attention-important">Important</strong></p>
|
||||
<p>Key information users need to know to achieve their goal.</p>
|
||||
</blockquote>
|
||||
<blockquote class="attention-header attention-warning"><p>{{svg "octicon-alert" 16 "attention-icon attention-warning"}}<strong class="attention-warning">Warning</strong></p>
|
||||
<p>Urgent info that needs immediate user attention to avoid problems.</p>
|
||||
</blockquote>
|
||||
<blockquote class="attention-header attention-caution"><p>{{svg "octicon-stop" 16 "attention-icon attention-caution"}}<strong class="attention-caution">Caution</strong></p>
|
||||
<p>Advises about risks or negative outcomes of certain actions.</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<h2>Form Fields</h2>
|
||||
<div class="ui form">
|
||||
<div class="field error">
|
||||
<label>Error Field</label>
|
||||
<input type="text" value="Invalid input" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Error Input</h2>
|
||||
<div class="ui input error">
|
||||
<input type="text" value="Invalid input" readonly>
|
||||
</div>
|
||||
|
||||
<h2>Attached Section Boxes</h2>
|
||||
<h3 class="ui top attached error header">Error Header</h3>
|
||||
<div class="ui attached error segment">Error section body content.</div>
|
||||
<h3 class="ui top attached warning header tw-mt-3">Warning Header</h3>
|
||||
<div class="ui attached warning segment">Warning section body content.</div>
|
||||
|
||||
<h2>Banner Preview (info-tinted)</h2>
|
||||
<div class="web-banner-content-editor">
|
||||
<div class="render-content render-preview">Banner preview content</div>
|
||||
</div>
|
||||
|
||||
<h2>Labels</h2>
|
||||
<div class="flex-text-block tw-gap-2">
|
||||
<div class="ui red label">Red</div>
|
||||
<div class="ui orange label">Orange</div>
|
||||
<div class="ui yellow label">Yellow</div>
|
||||
<div class="ui green label">Green</div>
|
||||
<div class="ui blue label">Blue</div>
|
||||
<div class="ui violet label">Violet</div>
|
||||
<div class="ui purple label">Purple</div>
|
||||
</div>
|
||||
|
||||
<h2>Color Swatches</h2>
|
||||
<h3>Error</h3>
|
||||
<div class="flex-text-block tw-gap-4">
|
||||
<div class="tw-inline-flex tw-flex-col tw-items-center tw-gap-1 tw-min-w-[120px]">
|
||||
<div class="tw-w-[100px] tw-h-[60px] tw-rounded tw-flex tw-items-center tw-justify-center tw-text-xs tw-bg-error-bg tw-text-error-text tw-border tw-border-error-border">Text</div>
|
||||
<code>error-bg</code>
|
||||
</div>
|
||||
<div class="tw-inline-flex tw-flex-col tw-items-center tw-gap-1 tw-min-w-[120px]">
|
||||
<div class="tw-w-[100px] tw-h-[60px] tw-rounded tw-flex tw-items-center tw-justify-center tw-text-xs tw-bg-error-bg-hover tw-text-error-text tw-border tw-border-error-border">Hover</div>
|
||||
<code>error-bg-hover</code>
|
||||
</div>
|
||||
<div class="tw-inline-flex tw-flex-col tw-items-center tw-gap-1 tw-min-w-[120px]">
|
||||
<div class="tw-w-[100px] tw-h-[60px] tw-rounded tw-flex tw-items-center tw-justify-center tw-text-xs tw-bg-error-bg-active tw-text-error-text tw-border tw-border-error-border">Active</div>
|
||||
<code>error-bg-active</code>
|
||||
</div>
|
||||
</div>
|
||||
<h3>Warning</h3>
|
||||
<div class="flex-text-block tw-gap-4">
|
||||
<div class="tw-inline-flex tw-flex-col tw-items-center tw-gap-1 tw-min-w-[120px]">
|
||||
<div class="tw-w-[100px] tw-h-[60px] tw-rounded tw-flex tw-items-center tw-justify-center tw-text-xs tw-bg-warning-bg tw-text-warning-text tw-border tw-border-warning-border">Text</div>
|
||||
<code>warning-bg</code>
|
||||
</div>
|
||||
</div>
|
||||
<h3>Success</h3>
|
||||
<div class="flex-text-block tw-gap-4">
|
||||
<div class="tw-inline-flex tw-flex-col tw-items-center tw-gap-1 tw-min-w-[120px]">
|
||||
<div class="tw-w-[100px] tw-h-[60px] tw-rounded tw-flex tw-items-center tw-justify-center tw-text-xs tw-bg-success-bg tw-text-success-text tw-border tw-border-success-border">Text</div>
|
||||
<code>success-bg</code>
|
||||
</div>
|
||||
</div>
|
||||
<h3>Info</h3>
|
||||
<div class="flex-text-block tw-gap-4">
|
||||
<div class="tw-inline-flex tw-flex-col tw-items-center tw-gap-1 tw-min-w-[120px]">
|
||||
<div class="tw-w-[100px] tw-h-[60px] tw-rounded tw-flex tw-items-center tw-justify-center tw-text-xs tw-bg-info-bg tw-text-info-text tw-border tw-border-info-border">Text</div>
|
||||
<code>info-bg</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,3 @@
|
||||
sub template triggers an executing error
|
||||
|
||||
{{ctx.Locale.NoSuch "asdf"}}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest">
|
||||
<div class="tw-flex">
|
||||
<div class="tw-w-4/5">
|
||||
hello hello hello hello hello hello hello hello hello hello
|
||||
</div>
|
||||
<div class="tw-w-1/5">
|
||||
{{template "devtest/tmplerr-sub" .}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content">
|
||||
<div data-global-init="initDevtestDetailsErrorMessage"></div>
|
||||
<div class="ui container">
|
||||
<h1>Toast</h1>
|
||||
<div>
|
||||
<button class="ui button toast-test-button" data-toast-level="info" data-toast-message="test info">Show Info Toast</button>
|
||||
<button class="ui button toast-test-button" data-toast-level="warning" data-toast-message="test warning">Show Warning Toast</button>
|
||||
<button class="ui button toast-test-button" data-toast-level="error" data-toast-message="test error">Show Error Toast</button>
|
||||
<button class="ui button toast-test-button" data-toast-level="error" data-toast-message="very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong message">Show Error Toast (long)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content repository">
|
||||
<div class="file-content">
|
||||
<table class="file-view unicode-escaped">
|
||||
<tbody>
|
||||
{{range $idx, $line := .HighlightLines}}
|
||||
<tr>
|
||||
<td class="lines-num"><span data-line-number="{{$line.Num}}"></span></td>
|
||||
{{ctx.RenderUtils.RenderUnicodeEscapeToggleTd $.EscapeStatus (index $.LineEscapeStatus $idx)}}
|
||||
<td class="lines-code chroma"><div class="code-inner">{{$line.FormattedContent}}</div></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -0,0 +1,8 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content explore users">
|
||||
{{template "explore/navbar" .}}
|
||||
<div class="ui container">
|
||||
{{template "shared/search/code/search" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,22 @@
|
||||
<overflow-menu class="ui secondary pointing tabular top attached borderless menu secondary-nav">
|
||||
<div class="overflow-menu-items tw-justify-center">
|
||||
<a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos">
|
||||
{{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}}
|
||||
</a>
|
||||
{{if not .UsersPageIsDisabled}}
|
||||
<a class="{{if .PageIsExploreUsers}}active {{end}}item" href="{{AppSubUrl}}/explore/users">
|
||||
{{svg "octicon-person"}} {{ctx.Locale.Tr "explore.users"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if not .OrganizationsPageIsDisabled}}
|
||||
<a class="{{if .PageIsExploreOrganizations}}active {{end}}item" href="{{AppSubUrl}}/explore/organizations">
|
||||
{{svg "octicon-organization"}} {{ctx.Locale.Tr "explore.organizations"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if and (not ctx.Consts.RepoUnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled (not .CodePageIsDisabled)}}
|
||||
<a class="{{if .PageIsExploreCode}}active {{end}}item" href="{{AppSubUrl}}/explore/code">
|
||||
{{svg "octicon-code"}} {{ctx.Locale.Tr "explore.code"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</overflow-menu>
|
||||
@@ -0,0 +1,10 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content explore repositories">
|
||||
{{template "explore/navbar" .}}
|
||||
<div class="ui container">
|
||||
{{template "shared/repo/search" .}}
|
||||
{{template "shared/repo/list" .}}
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user