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

57 lines
3.7 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
2021-11-18 22:05:49 +05:30
.top-area.gl-border-0
= gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-b-0' }) do
= gl_tab_link_to s_('Branches|Overview'), project_branches_path(@project), { item_active: @mode == 'overview', title: s_('Branches|Show overview of the branches') }
= gl_tab_link_to s_('Branches|Active'), project_branches_filtered_path(@project, state: 'active'), { title: s_('Branches|Show active branches') }
= gl_tab_link_to s_('Branches|Stale'), project_branches_filtered_path(@project, state: 'stale'), { title: s_('Branches|Show stale branches') }
= gl_tab_link_to s_('Branches|All'), project_branches_filtered_path(@project, state: 'all'), { item_active: !%w[overview active stale].include?(@mode), 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,
2022-04-04 11:22:00 +05:30
aria: { label: s_('Branches|Delete merged branches') },
2019-12-04 20:38:33 +05:30
data: { confirm: s_('Branches|Deleting the merged branches cannot be undone. Are you sure?'),
2022-04-04 11:22:00 +05:30
confirm_btn_variant: 'danger',
2019-12-04 20:38:33 +05:30
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
2021-11-18 22:05:49 +05:30
- if @gitaly_unavailable
= render 'shared/errors/gitaly_unavailable', reason: s_('Branches|Unable to load branches')
- elsif @mode == 'overview' && (@active_branches.any? || @stale_branches.any?)
2019-12-04 20:38:33 +05:30
= 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?
2022-01-26 12:08:38 +05:30
- if Feature.enabled?(:branch_list_keyset_pagination, @project, default_enabled: :yaml)
2021-03-11 19:13:27 +05:30
= 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
2022-03-02 08:16:31 +05:30
- if can?(current_user, :push_code, @project)
2021-09-04 01:27:46 +05:30
.js-delete-branch-modal