diff options
author | Martin Wortschack <mwortschack@gitlab.com> | 2019-03-14 22:13:35 +0300 |
---|---|---|
committer | Martin Wortschack <mwortschack@gitlab.com> | 2019-03-14 22:14:14 +0300 |
commit | 67fd866a5dc1321ec6b6495450f4b0ac313f30f2 (patch) | |
tree | 0c216628bbf47f47fc6047259bf0572762cef955 | |
parent | 6908c5f70eb4d5d7e8ef28b43d73d71da9b2a0c3 (diff) |
Move EE specific code in admin application settings
- Leverage render_if_exists
- Externalize strings
- Extract help page setting into EE specific partial
7 files changed, 161 insertions, 53 deletions
diff --git a/app/views/admin/application_settings/_account_and_limit.html.haml b/app/views/admin/application_settings/_account_and_limit.html.haml index 65a24854583..9ed4bc44aae 100644 --- a/app/views/admin/application_settings/_account_and_limit.html.haml +++ b/app/views/admin/application_settings/_account_and_limit.html.haml @@ -6,32 +6,35 @@ .form-check = f.check_box :gravatar_enabled, class: 'form-check-input' = f.label :gravatar_enabled, class: 'form-check-label' do - Gravatar enabled + = _('Gravatar enabled') .form-group = f.label :default_projects_limit, class: 'label-bold' = f.number_field :default_projects_limit, class: 'form-control' .form-group - = f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'label-bold' + = f.label :max_attachment_size, _('Maximum attachment size (MB)'), class: 'label-bold' = f.number_field :max_attachment_size, class: 'form-control' + + = render_if_exists 'admin/application_settings/repository_size_limit_setting', form: f + .form-group - = f.label :receive_max_input_size, 'Maximum push size (MB)', class: 'label-light' + = f.label :receive_max_input_size, _('Maximum push size (MB)'), class: 'label-light' = f.number_field :receive_max_input_size, class: 'form-control qa-receive-max-input-size-field' .form-group - = f.label :session_expire_delay, 'Session duration (minutes)', class: 'label-light' + = f.label :session_expire_delay, _('Session duration (minutes)'), class: 'label-light' = f.number_field :session_expire_delay, class: 'form-control' - %span.form-text.text-muted#session_expire_delay_help_block GitLab restart is required to apply changes + %span.form-text.text-muted#session_expire_delay_help_block= _('GitLab restart is required to apply changes') .form-group - = f.label :user_oauth_applications, 'User OAuth applications', class: 'label-bold' + = f.label :user_oauth_applications, _('User OAuth applications'), class: 'label-bold' .form-check = f.check_box :user_oauth_applications, class: 'form-check-input' = f.label :user_oauth_applications, class: 'form-check-label' do - Allow users to register any application to use GitLab as an OAuth provider + = _('Allow users to register any application to use GitLab as an OAuth provider') .form-group - = f.label :user_default_external, 'New users set to external', class: 'label-bold' + = f.label :user_default_external, _('New users set to external'), class: 'label-bold' .form-check = f.check_box :user_default_external, class: 'form-check-input' = f.label :user_default_external, class: 'form-check-label' do - Newly registered users will by default be external + = _('Newly registered users will by default be external') .prepend-top-10 = _('Internal users') = f.text_field :user_default_internal_regex, placeholder: _('Regex pattern'), class: 'form-control prepend-top-5' @@ -40,10 +43,12 @@ = link_to _('More information'), help_page_path('user/permissions', anchor: 'external-users-permissions'), target: '_blank' .form-group - = f.label :user_show_add_ssh_key_message, 'Prompt users to upload SSH keys', class: 'label-bold' + = f.label :user_show_add_ssh_key_message, _('Prompt users to upload SSH keys'), class: 'label-bold' .form-check = f.check_box :user_show_add_ssh_key_message, class: 'form-check-input' = f.label :user_show_add_ssh_key_message, class: 'form-check-label' do - Inform users without uploaded SSH keys that they can't push over SSH until one is added + = _("Inform users without uploaded SSH keys that they can't push over SSH until one is added") + + = render_if_exists 'admin/application_settings/availability_on_namespace_setting', form: f - = f.submit 'Save changes', class: 'btn btn-success qa-save-changes-button' + = f.submit _('Save changes'), class: 'btn btn-success qa-save-changes-button' diff --git a/app/views/admin/application_settings/_ci_cd.html.haml b/app/views/admin/application_settings/_ci_cd.html.haml index c99d7e9b8e9..b8c481df0d2 100644 --- a/app/views/admin/application_settings/_ci_cd.html.haml +++ b/app/views/admin/application_settings/_ci_cd.html.haml @@ -8,7 +8,7 @@ .form-check = f.check_box :auto_devops_enabled, class: 'form-check-input' = f.label :auto_devops_enabled, class: 'form-check-label' do - Default to Auto DevOps pipeline for all projects + = s_('CICD|Default to Auto DevOps pipeline for all projects') .form-text.text-muted = s_('CICD|The Auto DevOps pipeline will run if no alternative CI configuration file is found.') = link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank' @@ -21,34 +21,31 @@ .form-check = f.check_box :shared_runners_enabled, class: 'form-check-input' = f.label :shared_runners_enabled, class: 'form-check-label' do - Enable shared runners for new projects + = s_("AdminSettings|Enable shared runners for new projects") + + = render_if_exists 'admin/application_settings/shared_runners_minutes_setting', form: f + .form-group = f.label :shared_runners_text, class: 'label-bold' = f.text_area :shared_runners_text, class: 'form-control', rows: 4 - .form-text.text-muted Markdown enabled + .form-text.text-muted= _("Markdown enabled") .form-group - = f.label :max_artifacts_size, 'Maximum artifacts size (MB)', class: 'label-bold' + = f.label :max_artifacts_size, _('Maximum artifacts size (MB)'), class: 'label-bold' = f.number_field :max_artifacts_size, class: 'form-control' .form-text.text-muted - Set the maximum file size for each job's artifacts + = _("Set the maximum file size for each job's artifacts") = link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size') .form-group - = f.label :default_artifacts_expire_in, 'Default artifacts expiration', class: 'label-bold' + = f.label :default_artifacts_expire_in, _('Default artifacts expiration'), class: 'label-bold' = f.text_field :default_artifacts_expire_in, class: 'form-control' .form-text.text-muted - Set the default expiration time for each job's artifacts. - 0 for unlimited. - The default unit is in seconds, but you can define an alternative. For example: - <code>4 mins 2 sec</code>, <code>2h42min</code>. + = _("Set the default expiration time for each job's artifacts. 0 for unlimited. The default unit is in seconds, but you can define an alternative. For example: <code>4 mins 2 sec</code>, <code>2h42min</code>.").html_safe = link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'default-artifacts-expiration') .form-group - = f.label :archive_builds_in_human_readable, 'Archive jobs', class: 'label-bold' + = f.label :archive_builds_in_human_readable, _('Archive jobs'), class: 'label-bold' = f.text_field :archive_builds_in_human_readable, class: 'form-control', placeholder: 'never' .form-text.text-muted - Set the duration for which the jobs will be considered as old and expired. - Once that time passes, the jobs will be archived and no longer able to be - retried. Make it empty to never expire jobs. It has to be no less than 1 day, - for example: <code>15 days</code>, <code>1 month</code>, <code>2 years</code>. + = _("Set the duration for which the jobs will be considered as old and expired. Once that time passes, the jobs will be archived and no longer able to be retried. Make it empty to never expire jobs. It has to be no less than 1 day, for example: <code>15 days</code>, <code>1 month</code>, <code>2 years</code>.").html_safe .form-group .form-check = f.check_box :protected_ci_variables, class: 'form-check-input' @@ -57,4 +54,4 @@ .form-text.text-muted = s_('AdminSettings|When creating a new environment variable it will be protected by default.') - = f.submit 'Save changes', class: "btn btn-success" + = f.submit _('Save changes'), class: "btn btn-success" diff --git a/app/views/admin/application_settings/_email.html.haml b/app/views/admin/application_settings/_email.html.haml index 60a6be731ea..3f30c75fbb6 100644 --- a/app/views/admin/application_settings/_email.html.haml +++ b/app/views/admin/application_settings/_email.html.haml @@ -6,20 +6,16 @@ .form-check = f.check_box :email_author_in_body, class: 'form-check-input' = f.label :email_author_in_body, class: 'form-check-label' do - Include author name in notification email body + = _('Include author name in notification email body') .form-text.text-muted - Some email servers do not support overriding the email sender name. - Enable this option to include the name of the author of the issue, - merge request or comment in the email body instead. + = _('Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead.') .form-group .form-check = f.check_box :html_emails_enabled, class: 'form-check-input' = f.label :html_emails_enabled, class: 'form-check-label' do - Enable HTML emails + = _('Enable HTML emails') .form-text.text-muted - By default GitLab sends emails in HTML and plain text formats so mail - clients can choose what format to use. Disable this option if you only - want to send emails in plain text format. + = _('By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.') .form-group = f.label :commit_email_hostname, _('Custom hostname (for private commit emails)'), class: 'label-bold' = f.text_field :commit_email_hostname, class: 'form-control' @@ -27,4 +23,6 @@ - commit_email_hostname_docs_link = link_to _('Learn more'), help_page_path('user/admin_area/settings/email', anchor: 'custom-private-commit-email-hostname'), target: '_blank' = _("This setting will update the hostname that is used to generate private commit emails. %{learn_more}").html_safe % { learn_more: commit_email_hostname_docs_link } - = f.submit 'Save changes', class: "btn btn-success" + = render_if_exists 'admin/application_settings/email_additional_text_setting', form: f + + = f.submit _('Save changes'), class: "btn btn-success" diff --git a/app/views/admin/application_settings/_help_page.html.haml b/app/views/admin/application_settings/_help_page.html.haml index 70c8c74cc5d..aa491c735d1 100644 --- a/app/views/admin/application_settings/_help_page.html.haml +++ b/app/views/admin/application_settings/_help_page.html.haml @@ -2,18 +2,20 @@ = form_errors(@application_setting) %fieldset + = render_if_exists 'admin/application_settings/help_text_setting', form: f + .form-group = f.label :help_page_text, class: 'label-bold' = f.text_area :help_page_text, class: 'form-control', rows: 4 - .form-text.text-muted Markdown enabled + .form-text.text-muted= _('Markdown enabled') .form-group .form-check = f.check_box :help_page_hide_commercial_content, class: 'form-check-input' = f.label :help_page_hide_commercial_content, class: 'form-check-label' do - Hide marketing-related entries from help + = _('Hide marketing-related entries from help') .form-group - = f.label :help_page_support_url, 'Support page URL', class: 'label-bold' + = f.label :help_page_support_url, _('Support page URL'), class: 'label-bold' = f.text_field :help_page_support_url, class: 'form-control', placeholder: 'http://company.example.com/getting-help', :'aria-describedby' => 'support_help_block' - %span.form-text.text-muted#support_help_block Alternate support URL for help page + %span.form-text.text-muted#support_help_block= _('Alternate support URL for help page') - = f.submit 'Save changes', class: "btn btn-success" + = f.submit _('Save changes'), class: "btn btn-success" diff --git a/app/views/admin/application_settings/_repository_mirrors_form.html.haml b/app/views/admin/application_settings/_repository_mirrors_form.html.haml index 615aa6317b0..f2f2cd1282a 100644 --- a/app/views/admin/application_settings/_repository_mirrors_form.html.haml +++ b/app/views/admin/application_settings/_repository_mirrors_form.html.haml @@ -3,13 +3,15 @@ %fieldset .form-group - = f.label :mirror_available, 'Enable mirror configuration', class: 'label-bold' + = f.label :mirror_available, _('Enable mirror configuration'), class: 'label-bold' .form-check = f.check_box :mirror_available, class: 'form-check-input' = f.label :mirror_available, class: 'form-check-label' do - Allow mirrors to be set up for projects + = _('Allow mirrors to be set up for projects') %span.form-text.text-muted - If disabled, only admins will be able to set up mirrors in projects. + = _('If disabled, only admins will be able to set up mirrors in projects.') = link_to icon('question-circle'), help_page_path('workflow/repository_mirroring') - = f.submit 'Save changes', class: "btn btn-success" + = render_if_exists 'admin/application_settings/mirror_settings', form: f + + = f.submit _('Save changes'), class: "btn btn-success" diff --git a/app/views/admin/application_settings/_visibility_and_access.html.haml b/app/views/admin/application_settings/_visibility_and_access.html.haml index 0725ffb7f6c..8122d81f578 100644 --- a/app/views/admin/application_settings/_visibility_and_access.html.haml +++ b/app/views/admin/application_settings/_visibility_and_access.html.haml @@ -5,6 +5,7 @@ .form-group = f.label :default_branch_protection, class: 'label-bold' = f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control' + = render_if_exists 'admin/application_settings/project_creation_level', form: f, application_setting: @application_setting .form-group.visibility-level-setting = f.label :default_project_visibility, class: 'label-bold' = render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: Project.new) @@ -22,32 +23,33 @@ .form-check = level %span.form-text.text-muted#restricted-visibility-help - Selected levels cannot be used by non-admin users for groups, projects or snippets. - If the public level is restricted, user profiles are only visible to logged in users. + = _('Selected levels cannot be used by non-admin users for groups, projects or snippets. If the public level is restricted, user profiles are only visible to logged in users.') .form-group = f.label :import_sources, class: 'label-bold' = hidden_field_tag 'application_setting[import_sources][]' - import_sources_checkboxes('import-sources-help', class: 'form-check-input').each do |source| .form-check= source %span.form-text.text-muted#import-sources-help - Enabled sources for code import during project creation. OmniAuth must be configured for GitHub + = _('Enabled sources for code import during project creation. OmniAuth must be configured for GitHub') = link_to "(?)", help_page_path("integration/github") , Bitbucket = link_to "(?)", help_page_path("integration/bitbucket") and GitLab.com = link_to "(?)", help_page_path("integration/gitlab") + = render_if_exists 'admin/application_settings/ldap_access_setting', form: f + .form-group .form-check = f.check_box :project_export_enabled, class: 'form-check-input' = f.label :project_export_enabled, class: 'form-check-label' do - Project export enabled + = _('Project export enabled') .form-group - %label.label-bold Enabled Git access protocols + %label.label-bold= _('Enabled Git access protocols') = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control') %span.form-text.text-muted#clone-protocol-help - Allow only the selected protocols to be used for Git access. + = _('Allow only the selected protocols to be used for Git access.') - ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type| - field_name = :"#{type}_key_restriction" @@ -55,4 +57,4 @@ = f.label field_name, "#{type.upcase} SSH keys", class: 'label-bold' = f.select field_name, key_restriction_options_for_select(type), {}, class: 'form-control' - = f.submit 'Save changes', class: "btn btn-success" + = f.submit _('Save changes'), class: "btn btn-success" diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 006ec1ec56f..3a9c15c5314 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -495,6 +495,9 @@ msgstr "" msgid "AdminSettings|Auto DevOps domain" msgstr "" +msgid "AdminSettings|Enable shared runners for new projects" +msgstr "" + msgid "AdminSettings|Environment variables are protected by default" msgstr "" @@ -603,6 +606,12 @@ msgstr "" msgid "Allow commits from members who can merge to the target branch." msgstr "" +msgid "Allow mirrors to be set up for projects" +msgstr "" + +msgid "Allow only the selected protocols to be used for Git access." +msgstr "" + msgid "Allow projects within this group to use Git LFS" msgstr "" @@ -618,6 +627,9 @@ msgstr "" msgid "Allow this key to push to repository as well? (Default only allows pull access.)" msgstr "" +msgid "Allow users to register any application to use GitLab as an OAuth provider" +msgstr "" + msgid "Allow users to request access" msgstr "" @@ -630,6 +642,9 @@ msgstr "" msgid "Allows you to add and manage Kubernetes clusters." msgstr "" +msgid "Alternate support URL for help page" +msgstr "" + msgid "Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import." msgstr "" @@ -801,6 +816,9 @@ msgstr "" msgid "April" msgstr "" +msgid "Archive jobs" +msgstr "" + msgid "Archived project! Repository and other project resources are read-only" msgstr "" @@ -1272,6 +1290,9 @@ msgstr "" msgid "By %{user_name}" msgstr "" +msgid "By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format." +msgstr "" + msgid "ByAuthor|by" msgstr "" @@ -1317,6 +1338,9 @@ msgstr "" msgid "CICD|Default to Auto DevOps pipeline" msgstr "" +msgid "CICD|Default to Auto DevOps pipeline for all projects" +msgstr "" + msgid "CICD|Deployment strategy" msgstr "" @@ -2597,6 +2621,9 @@ msgstr "" msgid "Default Branch" msgstr "" +msgid "Default artifacts expiration" +msgstr "" + msgid "Default first day of the week" msgstr "" @@ -3001,6 +3028,9 @@ msgstr "" msgid "Enable Auto DevOps" msgstr "" +msgid "Enable HTML emails" +msgstr "" + msgid "Enable Sentry for error reporting and logging." msgstr "" @@ -3022,6 +3052,9 @@ msgstr "" msgid "Enable header and footer in emails" msgstr "" +msgid "Enable mirror configuration" +msgstr "" + msgid "Enable or disable version check and usage ping." msgstr "" @@ -3046,6 +3079,12 @@ msgstr "" msgid "Enabled" msgstr "" +msgid "Enabled Git access protocols" +msgstr "" + +msgid "Enabled sources for code import during project creation. OmniAuth must be configured for GitHub" +msgstr "" + msgid "Ends at (UTC)" msgstr "" @@ -3714,6 +3753,9 @@ msgstr "" msgid "GitLab project export" msgstr "" +msgid "GitLab restart is required to apply changes" +msgstr "" + msgid "GitLab.com import" msgstr "" @@ -3777,6 +3819,9 @@ msgstr "" msgid "Graph" msgstr "" +msgid "Gravatar enabled" +msgstr "" + msgid "Group" msgstr "" @@ -3963,6 +4008,9 @@ msgstr "" msgid "Hide host keys manual input" msgstr "" +msgid "Hide marketing-related entries from help" +msgstr "" + msgid "Hide payload" msgstr "" @@ -4043,6 +4091,9 @@ msgstr "" msgid "If any job surpasses this timeout threshold, it will be marked as failed. Human readable time input language is accepted like \"1 hour\". Values without specification represent seconds." msgstr "" +msgid "If disabled, only admins will be able to set up mirrors in projects." +msgstr "" + msgid "If disabled, the access level will depend on the user's permissions in the project." msgstr "" @@ -4163,6 +4214,9 @@ msgstr "" msgid "Include a Terms of Service agreement and Privacy Policy that all users must accept." msgstr "" +msgid "Include author name in notification email body" +msgstr "" + msgid "Include merge request description" msgstr "" @@ -4184,6 +4238,9 @@ msgstr "" msgid "Indicates whether this runner can pick jobs without tags" msgstr "" +msgid "Inform users without uploaded SSH keys that they can't push over SSH until one is added" +msgstr "" + msgid "Information about additional Pages templates and how to install them can be found in our %{pages_getting_started_guide}." msgstr "" @@ -4683,9 +4740,18 @@ msgstr "" msgid "Max access level" msgstr "" +msgid "Maximum artifacts size (MB)" +msgstr "" + +msgid "Maximum attachment size (MB)" +msgstr "" + msgid "Maximum job timeout" msgstr "" +msgid "Maximum push size (MB)" +msgstr "" + msgid "May" msgstr "" @@ -5060,9 +5126,15 @@ msgstr "" msgid "New tag" msgstr "" +msgid "New users set to external" +msgstr "" + msgid "New..." msgstr "" +msgid "Newly registered users will by default be external" +msgstr "" + msgid "No" msgstr "" @@ -6034,6 +6106,9 @@ msgstr "" msgid "Project export could not be deleted." msgstr "" +msgid "Project export enabled" +msgstr "" + msgid "Project export has been deleted." msgstr "" @@ -6211,6 +6286,9 @@ msgstr "" msgid "Promote to group label" msgstr "" +msgid "Prompt users to upload SSH keys" +msgstr "" + msgid "Protected" msgstr "" @@ -6752,6 +6830,9 @@ msgstr "" msgid "Select the branch you want to set as the default for this project. All merge requests and commits will automatically be made against this branch unless you specify a different one." msgstr "" +msgid "Selected levels cannot be used by non-admin users for groups, projects or snippets. If the public level is restricted, user profiles are only visible to logged in users." +msgstr "" + msgid "Selecting a GitLab user will add a link to the GitLab user in the descriptions of issues and comments (e.g. \"By <a href=\"#\">@johnsmith</a>\"). It will also associate and/or assign these issues and comments with the selected user." msgstr "" @@ -6821,6 +6902,9 @@ msgstr "" msgid "Service Templates" msgstr "" +msgid "Session duration (minutes)" +msgstr "" + msgid "Session expiration, projects limit and attachment size." msgstr "" @@ -6842,6 +6926,15 @@ msgstr "" msgid "Set requirements for a user to sign-in. Enable mandatory two-factor authentication." msgstr "" +msgid "Set the default expiration time for each job's artifacts. 0 for unlimited. The default unit is in seconds, but you can define an alternative. For example: <code>4 mins 2 sec</code>, <code>2h42min</code>." +msgstr "" + +msgid "Set the duration for which the jobs will be considered as old and expired. Once that time passes, the jobs will be archived and no longer able to be retried. Make it empty to never expire jobs. It has to be no less than 1 day, for example: <code>15 days</code>, <code>1 month</code>, <code>2 years</code>." +msgstr "" + +msgid "Set the maximum file size for each job's artifacts" +msgstr "" + msgid "Set up CI/CD" msgstr "" @@ -6988,6 +7081,9 @@ msgstr "" msgid "SnippetsEmptyState|They can be either public or private." msgstr "" +msgid "Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead." +msgstr "" + msgid "Someone edited this %{issueType} at the same time you did. The description has been updated and you will need to make your changes again." msgstr "" @@ -7336,6 +7432,9 @@ msgstr "" msgid "Support for custom certificates is disabled. Ask your system's administrator to enable it." msgstr "" +msgid "Support page URL" +msgstr "" + msgid "Switch branch/tag" msgstr "" @@ -8312,6 +8411,9 @@ msgstr "" msgid "User Cohorts are only shown when the %{usage_ping_link_start}usage ping%{usage_ping_link_end} is enabled." msgstr "" +msgid "User OAuth applications" +msgstr "" + msgid "User Settings" msgstr "" |