diff options
Diffstat (limited to 'app/views/projects/branches/_branch.html.haml')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index adff64fad5a..ae8d230f356 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -11,13 +11,13 @@ = branch.name = clipboard_button(text: branch.name, title: _("Copy branch name")) - if is_default_branch - = gl_badge_tag s_('DefaultBranchLabel|default'), { variant: :neutral, size: :sm }, { class: 'gl-ml-2', data: { qa_selector: 'badge_content' } } + = gl_badge_tag s_('DefaultBranchLabel|default'), { variant: :neutral, size: :sm }, { class: 'gl-ml-2' } - if protected_branch?(@project, branch) - = gl_badge_tag s_('Branches|protected'), { variant: :muted, size: :sm }, { class: 'gl-ml-2', data: { qa_selector: 'badge_content' } } + = gl_badge_tag s_('Branches|protected'), { variant: :muted, size: :sm }, { class: 'gl-ml-2' } = render_if_exists 'projects/branches/diverged_from_upstream', branch: branch - .block-truncated + .gl-text-truncate - if commit = render 'projects/branches/commit', commit: commit, project: @project - else @@ -28,35 +28,33 @@ .pipeline-status.d-none.d-md-block< - if commit_status - = render 'ci/status/icon', size: 16, status: commit_status, option_css_classes: 'gl-display-inline-flex gl-vertical-align-middle gl-mr-5' + = render 'ci/status/icon', size: 16, status: commit_status, option_css_classes: 'gl-display-inline-flex gl-vertical-align-middle gl-mr-3' - elsif show_commit_status - .gl-display-inline-flex.gl-vertical-align-middle.gl-mr-5 + .gl-display-inline-flex.gl-vertical-align-middle.gl-mr-3 %svg.s16 - - - if mr_status.present? - .issuable-reference.gl-display-flex.gl-justify-content-end.gl-min-w-10.gl-ml-5.gl-mr-4 - = gl_badge_tag issuable_reference(related_merge_request), - { icon: mr_status[:icon], variant: mr_status[:variant], size: :md, href: merge_request_path(related_merge_request) }, - { class: 'gl-mr-2', title: mr_status[:title], data: { toggle: 'tooltip', container: 'body', qa_selector: 'badge_content' } } - - .controls.d-none.d-md-block< - - if mr_status.nil? && create_mr_button?(from: branch.name, source_project: @project) - = render Pajamas::ButtonComponent.new(icon: 'merge-request', href: create_mr_path(from: branch.name, source_project: @project), button_options: { class: 'has-tooltip gl-mr-2!', title: _('New merge request') }) do - = _('New') - - = render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name], css_class: 'gl-mr-1!' - - - if !is_default_branch - .js-branch-more-actions{ data: { - branch_name: branch.name, - default_branch_name: @repository.root_ref, - can_delete_branch: user_access(@project).can_delete_branch?(branch.name).to_s, - is_protected_branch: protected_branch?(@project, branch).to_s, - merged: merged.to_s, - compare_path: project_compare_index_path(@project, from: @repository.root_ref, to: branch.name), - delete_path: project_branch_path(@project, branch.name), - } } - - else - .gl-display-inline-flex.gl-w-7 - + .right-block.gl-display-flex.gl-align-items-center.gl-justify-content-end + .gl-mr-3 + - if mr_status.present? + .issuable-reference.gl-display-flex.gl-justify-content-end.gl-overflow-hidden + = gl_badge_tag issuable_reference(related_merge_request), + { icon: mr_status[:icon], variant: mr_status[:variant], size: :md, href: merge_request_path(related_merge_request) }, + { class: 'gl-display-block gl-text-truncate', title: mr_status[:title], data: { toggle: 'tooltip', container: 'body' } } + + - elsif mr_status.nil? && create_mr_button?(from: branch.name, source_project: @project) + = render Pajamas::ButtonComponent.new(icon: 'merge-request', href: create_mr_path(from: branch.name, source_project: @project), button_options: { class: 'has-tooltip', title: _('New merge request') }) do + = _('New') + + = render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name], css_class: 'gl-mr-2!' + + .gl-w-7 + - if !is_default_branch + .js-branch-more-actions{ data: { + branch_name: branch.name, + default_branch_name: @repository.root_ref, + can_delete_branch: user_access(@project).can_delete_branch?(branch.name).to_s, + is_protected_branch: protected_branch?(@project, branch).to_s, + merged: merged.to_s, + compare_path: project_compare_index_path(@project, from: @repository.root_ref, to: branch.name), + delete_path: project_branch_path(@project, branch.name), + } } |