diff options
author | Martin Wortschack <mwortschack@gitlab.com> | 2018-10-30 16:23:47 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-30 16:23:47 +0000 |
commit | 66e8ecffa0990651e7bac46ac65120f5a98b1749 (patch) | |
tree | 527d4fc5bc0c341ddab80cd9f27ddaca0b822d11 /app/views | |
parent | e9814aae809fb057f9126d9574c313fa18836ec0 (diff) | |
download | gitlab-ce-66e8ecffa0990651e7bac46ac65120f5a98b1749.tar.gz |
Resolve "Create new group: Rename form fields and update UI"
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/groups/new.html.haml | 33 | ||||
-rw-r--r-- | app/views/shared/_group_form.html.haml | 45 |
2 files changed, 43 insertions, 35 deletions
diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 684b51b8552..0904e44a658 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -1,12 +1,12 @@ - @hide_breadcrumbs = true - @hide_top_links = true -- page_title 'New Group' -- header_title "Groups", dashboard_groups_path +- page_title _('New Group') +- header_title _("Groups"), dashboard_groups_path +.page-title-holder + %h1.page-title= _('New group') .row.prepend-top-default .col-lg-3.profile-settings-sidebar - %h4.prepend-top-0 - = _('New group') %p - group_docs_path = help_page_path('user/group/index') - group_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_docs_path } @@ -15,24 +15,29 @@ - subgroup_docs_path = help_page_path('user/group/subgroups/index') - subgroup_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: subgroup_docs_path } = s_('Groups can also be nested by creating %{subgroup_docs_link_start}subgroups%{subgroup_docs_link_end}.').html_safe % { subgroup_docs_link_start: subgroup_docs_link_start, subgroup_docs_link_end: '</a>'.html_safe } + %p + = _('Projects that belong to a group are prefixed with the group namespace. Existing projects may be moved into a group.') .col-lg-9 = form_for @group, html: { class: 'group-form gl-show-field-errors' } do |f| = form_errors(@group) = render 'shared/group_form', f: f, autofocus: true - .form-group.row.group-description-holder - = f.label :avatar, "Group avatar", class: 'col-form-label col-sm-2' - .col-sm-10 - = render 'shared/choose_group_avatar_button', f: f - - = render 'shared/old_visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group, with_label: false + .row + .form-group.group-description-holder.col-sm-12 + = f.label :avatar, _("Group avatar"), class: 'label-bold' + %div + = render 'shared/choose_group_avatar_button', f: f - = render 'create_chat_team', f: f if Gitlab.config.mattermost.enabled + .form-group.col-sm-12 + %label.label-bold + = _('Visibility level') + %p + = _('Who will be able to see this group?') + = link_to _('View the documentation'), help_page_path("public_access/public_access"), target: '_blank' + = render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group, with_label: false - .form-group.row - .offset-sm-2.col-sm-10 - = render 'shared/group_tips' + = render 'create_chat_team', f: f if Gitlab.config.mattermost.enabled .form-actions = f.submit 'Create group', class: "btn btn-success" diff --git a/app/views/shared/_group_form.html.haml b/app/views/shared/_group_form.html.haml index dbed4b94d61..973c756f496 100644 --- a/app/views/shared/_group_form.html.haml +++ b/app/views/shared/_group_form.html.haml @@ -2,10 +2,19 @@ - group_path = root_url - group_path << parent.full_path + '/' if parent -.form-group.row - = f.label :path, class: 'col-form-label col-sm-2' do - Group path - .col-sm-10 +.row + .form-group.group-name-holder.col-sm-12 + = f.label :name, class: 'label-bold' do + = _("Group name") + = f.text_field :name, placeholder: 'My Awesome Group', class: 'form-control input-lg', + required: true, + title: _('Please fill in a descriptive name for your group.'), + autofocus: true + +.row + .form-group.col-xs-12.col-sm-8 + = f.label :path, class: 'label-bold' do + = _("Group URL") .input-group.gl-field-error-anchor .group-root-path.input-group-prepend.has-tooltip{ title: group_path, :'data-placement' => 'bottom' } .input-group-text @@ -13,10 +22,10 @@ - if parent %strong= parent.full_path + '/' = f.hidden_field :parent_id - = f.text_field :path, placeholder: 'open-source', class: 'form-control', + = f.text_field :path, placeholder: 'my-awesome-group', class: 'form-control', autofocus: local_assigns[:autofocus] || false, required: true, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, - title: 'Please choose a group path with no special characters.', + title: _('Please choose a group URL with no special characters.'), "data-bind-in" => "#{'create_chat_team' if Gitlab.config.mattermost.enabled}" - if @group.persisted? @@ -25,23 +34,17 @@ = succeed '.' do = link_to 'Learn more', help_page_path('user/group/index', anchor: 'changing-a-groups-path'), target: '_blank' -.form-group.row.group-name-holder - = f.label :name, class: 'col-form-label col-sm-2' do - Group name - .col-sm-10 - = f.text_field :name, class: 'form-control', - required: true, - title: 'You can choose a descriptive name different from the path.' - - if @group.persisted? - .form-group.row.group-name-holder - = f.label :id, class: 'col-form-label col-sm-2' do - = _("Group ID") - .col-sm-10 + .row + .form-group.group-name-holder.col-sm-8 + = f.label :id, class: 'label-bold' do + = _("Group ID") = f.text_field :id, class: 'form-control', readonly: true -.form-group.row.group-description-holder - = f.label :description, class: 'col-form-label col-sm-2' - .col-sm-10 +.row + .form-group.group-description-holder.col-sm-8 + = f.label :description, class: 'label-bold' do + = _("Group description") + %span (optional) = f.text_area :description, maxlength: 250, class: 'form-control js-gfm-input', rows: 4 |