diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 12:06:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 12:06:26 +0000 |
commit | 0be510a49f6e4f8e27b19b707fd1dac61571f78f (patch) | |
tree | 97ca0053d4fad66e900d25fdba61b2adb611efb0 /app/views | |
parent | 6026bddcd51eca573c530240c421392045172b89 (diff) | |
download | gitlab-ce-0be510a49f6e4f8e27b19b707fd1dac61571f78f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views')
8 files changed, 31 insertions, 40 deletions
diff --git a/app/views/projects/merge_requests/creations/_new_submit.html.haml b/app/views/projects/merge_requests/creations/_new_submit.html.haml index 543441b9479..15c83f92474 100644 --- a/app/views/projects/merge_requests/creations/_new_submit.html.haml +++ b/app/views/projects/merge_requests/creations/_new_submit.html.haml @@ -1,15 +1,5 @@ %h3.page-title New Merge Request -%p.slead - - source_title, target_title = format_mr_branch_names(@merge_request) - From - %strong.ref-name= source_title - %span into - %strong.ref-name= target_title - - %span.float-right - = link_to 'Change branches', mr_change_branches_path(@merge_request) -%hr = form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f| = render 'shared/issuable/form', f: f, issuable: @merge_request, commits: @commits, presenter: @mr_presenter = f.hidden_field :source_project_id diff --git a/app/views/projects/merge_requests/edit.html.haml b/app/views/projects/merge_requests/edit.html.haml index 03159f123f3..318c9d809c1 100644 --- a/app/views/projects/merge_requests/edit.html.haml +++ b/app/views/projects/merge_requests/edit.html.haml @@ -2,5 +2,4 @@ %h3.page-title Edit Merge Request #{@merge_request.to_reference} -%hr = render 'form' diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 5e2b5f95ee3..a8aae03aad7 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -12,6 +12,9 @@ = link_to "the #{issuable.class.model_name.human.downcase}", polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), target: "_blank", rel: 'noopener noreferrer' and make sure your changes will not unintentionally remove theirs += render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form + +%hr .form-group.row = form.label :title, class: 'col-form-label col-sm-2' @@ -34,8 +37,6 @@ = render_if_exists 'shared/issuable/approvals', issuable: issuable, presenter: presenter, form: form -= render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form - = render 'shared/issuable/form/merge_params', issuable: issuable = render 'shared/issuable/form/contribution', issuable: issuable, form: form diff --git a/app/views/shared/issuable/form/_branch_chooser.html.haml b/app/views/shared/issuable/form/_branch_chooser.html.haml index fbc96baa0f7..03eebe7c987 100644 --- a/app/views/shared/issuable/form/_branch_chooser.html.haml +++ b/app/views/shared/issuable/form/_branch_chooser.html.haml @@ -4,21 +4,19 @@ - return unless issuable.is_a?(MergeRequest) - return if issuable.closed_without_fork? -%hr -- if issuable.new_record? - .form-group.row - = form.label :source_branch, class: 'col-form-label col-sm-2' - .col-sm-10 - .issuable-form-select-holder - = form.select(:source_branch, [issuable.source_branch], {}, { class: 'source_branch select2 ref-name', disabled: true }) -.form-group.row - = form.label :target_branch, class: 'col-form-label col-sm-2' - .col-sm-10.target-branch-select-dropdown-container - .issuable-form-select-holder - = form.hidden_field(:target_branch, - { class: 'target_branch js-target-branch-select ref-name', - disabled: issuable.new_record?, - data: { placeholder: "Select branch", endpoint: refs_project_path(@project, sort: 'updated_desc', find: 'branches') }}) +- source_title, target_title = format_mr_branch_names(@merge_request) + +.form-group.row.d-flex.gl-pl-3.gl-pr-3.branch-selector + .align-self-center + %span= s_('From %{source_title} into').html_safe % { source_title: "<code>#{source_title}</code>".html_safe } - if issuable.new_record? + %code= target_title - = link_to 'Change branches', mr_change_branches_path(issuable) + = link_to _('Change branches'), mr_change_branches_path(issuable) + - elsif issuable.for_fork? + %code= issuable.target_project_path + ":" + - unless issuable.new_record? + %span.dropdown.prepend-left-5.d-inline-block + = form.hidden_field(:target_branch, + { class: 'target_branch js-target-branch-select ref-name mw-xl', + data: { placeholder: _('Select branch'), endpoint: refs_project_path(@project, sort: 'updated_desc', find: 'branches') }}) diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index f0c4acdd07f..1b557214e02 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -3,17 +3,17 @@ - return unless issuable.is_a?(MergeRequest) - return if issuable.closed_without_fork? -- if issuable.can_remove_source_branch?(current_user) - .form-group.row - .col-sm-10.offset-sm-2 - .form-check +.form-group.row + .col-sm-2.col-form-label.pt-sm-0 + %label + = _('Merge options') + .col-sm-10 + - if issuable.can_remove_source_branch?(current_user) + .form-check.append-bottom-default = hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil = check_box_tag 'merge_request[force_remove_source_branch]', '1', issuable.force_remove_source_branch?, class: 'form-check-input' = label_tag 'merge_request[force_remove_source_branch]', class: 'form-check-label' do Delete source branch when merge request is accepted. - -.form-group.row - .col-sm-10.offset-sm-2 .form-check = hidden_field_tag 'merge_request[squash]', '0', id: nil = check_box_tag 'merge_request[squash]', '1', issuable.squash, class: 'form-check-input' diff --git a/app/views/shared/notifications/_button.html.haml b/app/views/shared/notifications/_button.html.haml index 441abd57334..2b3e986a841 100644 --- a/app/views/shared/notifications/_button.html.haml +++ b/app/views/shared/notifications/_button.html.haml @@ -17,14 +17,14 @@ .js-notification-toggle-btns %div{ class: ("btn-group" if notification_setting.custom?) } - if notification_setting.custom? - %button.dropdown-new.btn.btn-default.btn-xs.has-tooltip.notifications-btn.text-left#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } } + %button.dropdown-new.btn.btn-default.has-tooltip.notifications-btn.text-left#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } } = icon("bell", class: "js-notification-loading") = notification_title(notification_setting.level) - %button.btn.dropdown-toggle{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } + %button.btn.dropdown-toggle.d-flex{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } = icon('caret-down') .sr-only Toggle dropdown - else - %button.dropdown-new.btn.btn-default.btn-xs.has-tooltip.notifications-btn#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } + %button.dropdown-new.btn.btn-default.has-tooltip.notifications-btn#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } .float-left = icon("bell", class: "js-notification-loading") = notification_title(notification_setting.level) diff --git a/app/views/shared/notifications/_custom_notifications.html.haml b/app/views/shared/notifications/_custom_notifications.html.haml index 43a87fd8397..1fef43c0c37 100644 --- a/app/views/shared/notifications/_custom_notifications.html.haml +++ b/app/views/shared/notifications/_custom_notifications.html.haml @@ -1,3 +1,5 @@ +- hide_label = local_assigns.fetch(:hide_label, false) + .modal.fade{ tabindex: "-1", role: "dialog", id: notifications_menu_identifier("modal", notification_setting), "aria-labelledby": "custom-notifications-title" } .modal-dialog .modal-content @@ -11,6 +13,7 @@ .container-fluid = form_for notification_setting, html: { class: "custom-notifications-form" } do |f| = hidden_setting_source_input(notification_setting) + = hidden_field_tag("hide_label", true) if hide_label .row .col-lg-4 %h4.prepend-top-0= _('Notification events') diff --git a/app/views/shared/notifications/_new_button.html.haml b/app/views/shared/notifications/_new_button.html.haml index 3c8cc023848..363053b5e35 100644 --- a/app/views/shared/notifications/_new_button.html.haml +++ b/app/views/shared/notifications/_new_button.html.haml @@ -31,4 +31,4 @@ = render "shared/notifications/notification_dropdown", notification_setting: notification_setting = content_for :scripts_body do - = render "shared/notifications/custom_notifications", notification_setting: notification_setting + = render "shared/notifications/custom_notifications", notification_setting: notification_setting, hide_label: true |