diff options
Diffstat (limited to 'app/views/projects/branches')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 22 | ||||
-rw-r--r-- | app/views/projects/branches/index.html.haml | 5 |
2 files changed, 15 insertions, 12 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index dc4172e2f09..fcf073e1e09 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -8,13 +8,13 @@ = link_to project_tree_path(@project, branch.name), class: 'item-title str-truncated-100 ref-name gl-ml-3 qa-branch-name' do = branch.name - if branch.name == @repository.root_ref - %span.badge.badge-primary.gl-ml-2 default + %span.badge.gl-badge.sm.badge-pill.badge-primary.gl-ml-2 default - elsif merged - %span.badge.badge-info.has-tooltip.gl-ml-2{ title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref } } + %span.badge.gl-badge.sm.badge-pill.badge-info.has-tooltip.gl-ml-2{ title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref } } = s_('Branches|merged') - if protected_branch?(@project, branch) - %span.badge.badge-success.gl-ml-2 + %span.badge.gl-badge.sm.badge-pill.badge-success.gl-ml-2 = s_('Branches|protected') = render_if_exists 'projects/branches/diverged_from_upstream', branch: branch @@ -50,10 +50,10 @@ - if can?(current_user, :push_code, @project) - if branch.name == @project.repository.root_ref - %button{ class: "gl-button btn btn-danger remove-row has-tooltip disabled", - disabled: true, - title: s_('Branches|The default branch cannot be deleted') } - = sprite_icon("remove") + - delete_default_branch_tooltip = s_('Branches|The default branch cannot be deleted') + %span.has-tooltip{ title: delete_default_branch_tooltip } + %button{ class: "gl-button btn btn-danger remove-row disabled", disabled: true, 'aria-label' => delete_default_branch_tooltip } + = sprite_icon("remove") - elsif protected_branch?(@project, branch) - if can?(current_user, :push_to_delete_protected_branch, @project) %button{ class: "gl-button btn btn-danger remove-row has-tooltip", @@ -65,10 +65,10 @@ is_merged: ("true" if merged) } } = sprite_icon("remove") - else - %button{ class: "gl-button btn btn-danger remove-row has-tooltip disabled", - disabled: true, - title: s_('Branches|Only a project maintainer or owner can delete a protected branch') } - = sprite_icon("remove") + - delete_protected_branch_tooltip = s_('Branches|Only a project maintainer or owner can delete a protected branch') + %span.has-tooltip{ title: delete_protected_branch_tooltip } + %button{ class: "gl-button btn btn-danger remove-row disabled", disabled: true, 'aria-label' => delete_protected_branch_tooltip } + = sprite_icon("remove") - else = link_to project_branch_path(@project, branch.name), class: "gl-button btn btn-danger remove-row qa-remove-btn js-ajax-loading-spinner has-tooltip", diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml index 46cce59f67a..beccf458138 100644 --- a/app/views/projects/branches/index.html.haml +++ b/app/views/projects/branches/index.html.haml @@ -60,7 +60,10 @@ %ul.content-list.all-branches - @branches.each do |branch| = render "projects/branches/branch", branch: branch, merged: @merged_branch_names.include?(branch.name), commit_status: @branch_pipeline_statuses[branch.name], show_commit_status: @branch_pipeline_statuses.any? - = paginate @branches, theme: 'gitlab' + - if Feature.enabled?(:branches_pagination_without_count, @project, default_enabled: true) + = render('kaminari/gitlab/without_count', previous_path: @prev_path, next_path: @next_path) + - else + = paginate @branches, theme: 'gitlab' - else .nothing-here-block = s_('Branches|No branches to show') |