From bc78336c25380ba269f1c99669416b54ca15be6b Mon Sep 17 00:00:00 2001 From: Amy Qualls Date: Tue, 14 Sep 2021 11:03:54 -0700 Subject: [PATCH] Revise UI to better explain file templates Our UI description of file template repositories left a LOT to be desired. Add helptext. Add links to documentation. Make clearer what the feature actually IS, and why you'd want it. --- .../settings/instance_template_repository.md | 2 ++ .../application_settings/_templates.html.haml | 7 ++++--- .../views/groups/_templates_setting.html.haml | 6 ++++-- locale/gitlab.pot | 18 ++++++++++++------ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/doc/user/admin_area/settings/instance_template_repository.md b/doc/user/admin_area/settings/instance_template_repository.md index 862bf3b1652e3f..044863729dbeb4 100644 --- a/doc/user/admin_area/settings/instance_template_repository.md +++ b/doc/user/admin_area/settings/instance_template_repository.md @@ -31,6 +31,8 @@ After you add templates, you can use them for the entire instance. They are available in the [Web Editor's dropdown](../../project/repository/web_editor.md#template-dropdowns) and through the [API settings](../../../api/settings.md). +## Supported file types and locations + Templates must be added to a specific subdirectory in the repository, corresponding to the kind of template. The following types of custom templates are supported: diff --git a/ee/app/views/admin/application_settings/_templates.html.haml b/ee/app/views/admin/application_settings/_templates.html.haml index 006fa08aad831f..9fe83b54cb32e8 100644 --- a/ee/app/views/admin/application_settings/_templates.html.haml +++ b/ee/app/views/admin/application_settings/_templates.html.haml @@ -6,7 +6,8 @@ %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded ? _('Collapse') : _('Expand') %p - = _('Select a shared template repository for all projects on this instance.') + = _('Select a repository containing templates for common files.') + = link_to _('What templates can I create?'), help_page_path('user/admin_area/settings/instance_template_repository.md', anchor: 'supported-file-types-and-locations'), target: '_blank', rel: 'noopener noreferrer' .settings-content = form_for @application_setting, url: templates_admin_application_settings_path, html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) @@ -18,6 +19,6 @@ = _('Select a template repository') = project_select_tag('application_setting[file_template_project_id]', class: 'project-item-select hidden-filter-value', toggle_class: 'js-project-search js-project-filter js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit', placeholder: _('Search projects'), idAttribute: 'id', data: { order_by: 'last_activity_at', idattribute: 'id', all_projects: 'true', simple_filter: true, allow_clear: true }, value: @application_setting.file_template_project_id) - - link_start = ''.html_safe % { url: help_page_path('user/admin_area/settings/instance_template_repository') } - = s_('TemplateRepository|Select a repository to make its templates available to all projects. %{link_start}What should the repository contain?%{link_end} ').html_safe % { link_start: link_start, link_end: ''.html_safe } + = s_('TemplateRepository|Create common files more quickly, and standardize their format.') + = link_to "How do I use file templates?", help_page_path('user/project/repository/web_editor.md', anchor: 'template-dropdowns'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/ee/app/views/groups/_templates_setting.html.haml b/ee/app/views/groups/_templates_setting.html.haml index 0e5676e683eaeb..90ff6f74d26233 100644 --- a/ee/app/views/groups/_templates_setting.html.haml +++ b/ee/app/views/groups/_templates_setting.html.haml @@ -7,7 +7,8 @@ %button.btn.gl-button.js-settings-toggle{ type: 'button' } = expanded ? _('Collapse') : _('Expand') %p - = _('Set a template repository for projects in this group') + = _('Select a repository containing templates for common files.') + = link_to _('What templates can I create?'), help_page_path('user/admin_area/settings/instance_template_repository.md', anchor: 'supported-file-types-and-locations'), target: '_blank', rel: 'noopener noreferrer' .settings-content = form_for @group, url: group_path, html: { class: 'fieldset-form' } do |f| = form_errors(@group) @@ -17,7 +18,8 @@ = f.label :file_template_project_id, class: 'label-light' do .form-text.text-muted = _('Select a template repository') - = link_to sprite_icon('question-o'), help_page_path('user/group/index.md', anchor: 'group-file-templates'), target: '_blank' = project_select_tag('group[file_template_project_id]', class: 'project-item-select hidden-filter-value qa-file-template-repository-dropdown', toggle_class: 'js-project-search js-project-filter js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit', placeholder: _('Search projects'), idAttribute: 'id', data: { order_by: 'last_activity_at', idattribute: 'id', simple_filter: true, allow_clear: true }, value: @group.checked_file_template_project_id) + = s_('Create common files more quickly, and standardize their format.') + = link_to s_("How do I use file templates?"), help_page_path('user/project/repository/web_editor.md', anchor: 'template-dropdowns'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "btn gl-button btn-success", data: { qa_selector: 'save_changes_button' } diff --git a/locale/gitlab.pot b/locale/gitlab.pot index e6e1b4af5c8d9b..7e43a4069e4290 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -9516,6 +9516,9 @@ msgstr "" msgid "Create commit" msgstr "" +msgid "Create common files more quickly, and standardize their format." +msgstr "" + msgid "Create confidential merge request" msgstr "" @@ -16829,6 +16832,9 @@ msgstr "" msgid "How do I use a web terminal?" msgstr "" +msgid "How do I use file templates?" +msgstr "" + msgid "How it works" msgstr "" @@ -30385,10 +30391,10 @@ msgstr "" msgid "Select a repository" msgstr "" -msgid "Select a role" +msgid "Select a repository containing templates for common files." msgstr "" -msgid "Select a shared template repository for all projects on this instance." +msgid "Select a role" msgstr "" msgid "Select a template repository" @@ -30793,9 +30799,6 @@ msgstr "" msgid "Set a password on your account to pull or push via %{protocol}." msgstr "" -msgid "Set a template repository for projects in this group" -msgstr "" - msgid "Set access permissions for this token." msgstr "" @@ -33110,7 +33113,7 @@ msgstr "" msgid "Template to append to all Service Desk issues" msgstr "" -msgid "TemplateRepository|Select a repository to make its templates available to all projects. %{link_start}What should the repository contain?%{link_end} " +msgid "TemplateRepository|Create common files more quickly, and standardize their format." msgstr "" msgid "Templates" @@ -38018,6 +38021,9 @@ msgstr "" msgid "What is your job title? (optional)" msgstr "" +msgid "What templates can I create?" +msgstr "" + msgid "What will you use this group for?" msgstr "" -- GitLab