debian-mirror-gitlab/app/views/projects/branches/index.html.haml

58 lines
3.6 KiB
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
- page_title _('Branches')
2019-09-04 21:01:54 +05:30
- add_to_breadcrumbs(_('Repository'), project_tree_path(@project))
2017-09-10 17:25:29 +05:30
2019-12-04 20:38:33 +05:30
.top-area.adjust
%ul.nav-links.issues-state-filters.nav.nav-tabs
%li{ class: active_when(@mode == 'overview') }>
= link_to s_('Branches|Overview'), project_branches_path(@project), title: s_('Branches|Show overview of the branches')
2018-03-27 19:54:05 +05:30
2019-12-04 20:38:33 +05:30
%li{ class: active_when(@mode == 'active') }>
= link_to s_('Branches|Active'), project_branches_filtered_path(@project, state: 'active'), title: s_('Branches|Show active branches')
2018-03-27 19:54:05 +05:30
2019-12-04 20:38:33 +05:30
%li{ class: active_when(@mode == 'stale') }>
= link_to s_('Branches|Stale'), project_branches_filtered_path(@project, state: 'stale'), title: s_('Branches|Show stale branches')
2018-03-27 19:54:05 +05:30
2019-12-04 20:38:33 +05:30
%li{ class: active_when(!%w[overview active stale].include?(@mode)) }>
= link_to s_('Branches|All'), project_branches_filtered_path(@project, state: 'all'), title: s_('Branches|Show all branches')
2019-12-04 20:38:33 +05:30
.nav-controls
2021-04-29 21:17:54 +05:30
#js-branches-sort-dropdown{ data: { project_branches_filtered_path: project_branches_path(@project, state: 'all'), sort_options: branches_sort_options_hash.to_json, mode: @mode } }
2016-09-13 17:45:13 +05:30
2019-12-04 20:38:33 +05:30
- if can? current_user, :push_code, @project
= link_to project_merged_branches_path(@project),
2021-01-03 14:25:43 +05:30
class: 'gl-button btn btn-danger btn-danger-secondary has-tooltip qa-delete-merged-branches',
2019-12-04 20:38:33 +05:30
title: s_("Branches|Delete all branches that are merged into '%{default_branch}'") % { default_branch: @project.repository.root_ref },
method: :delete,
data: { confirm: s_('Branches|Deleting the merged branches cannot be undone. Are you sure?'),
container: 'body' } do
= s_('Branches|Delete merged branches')
2021-04-29 21:17:54 +05:30
= link_to new_project_branch_path(@project), class: 'gl-button btn btn-confirm' do
2019-12-04 20:38:33 +05:30
= s_('Branches|New branch')
2016-09-13 17:45:13 +05:30
2019-12-04 20:38:33 +05:30
= render_if_exists 'projects/commits/mirror_status'
2019-09-04 21:01:54 +05:30
2021-04-29 21:17:54 +05:30
.js-branch-list{ data: { diverging_counts_endpoint: diverging_commit_counts_namespace_project_branches_path(@project.namespace, @project, format: :json), default_branch: @project.default_branch } }
2019-12-04 20:38:33 +05:30
- if can?(current_user, :admin_project, @project)
- project_settings_link = link_to s_('Branches|project settings'), project_protected_branches_path(@project)
.row-content-block
%h5
= s_('Branches|Protected branches can be managed in %{project_settings_link}.').html_safe % { project_settings_link: project_settings_link }
2018-03-27 19:54:05 +05:30
2019-12-04 20:38:33 +05:30
- if @mode == 'overview' && (@active_branches.any? || @stale_branches.any?)
= render "projects/branches/panel", branches: @active_branches, state: 'active', panel_title: s_('Branches|Active branches'), show_more_text: s_('Branches|Show more active branches'), project: @project, overview_max_branches: @overview_max_branches
= render "projects/branches/panel", branches: @stale_branches, state: 'stale', panel_title: s_('Branches|Stale branches'), show_more_text: s_('Branches|Show more stale branches'), project: @project, overview_max_branches: @overview_max_branches
2018-03-27 19:54:05 +05:30
2019-12-04 20:38:33 +05:30
- elsif @branches.any?
%ul.content-list.all-branches
- @branches.each do |branch|
2020-06-23 00:09:42 +05:30
= 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?
2021-03-11 19:13:27 +05:30
- 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'
2019-12-04 20:38:33 +05:30
- else
.nothing-here-block
= s_('Branches|No branches to show')
2017-09-10 17:25:29 +05:30
= render 'projects/branches/delete_protected_modal'