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

67 lines
3.7 KiB
Text
Raw Normal View History

2023-01-13 00:05:48 +05:30
- add_page_specific_style 'page_bundles/branches'
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))
2023-05-27 22:25:52 +05:30
- is_branch_rules_available = (can? current_user, :maintainer_access, @project) && Feature.enabled?(:branch_rules, @project)
- can_push_code = (can? current_user, :push_code, @project)
2017-09-10 17:25:29 +05:30
2023-04-23 21:23:45 +05:30
-# Possible values for variables passed down from the projects/branches_controller.rb
-#
-# @mode - overview|active|stale|all (default:overview)
-# @sort - name_asc|updated_asc|updated_desc
2023-07-09 08:55:56 +05:30
.top-area
2021-11-18 22:05:49 +05:30
= 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') }
2023-01-13 00:05:48 +05:30
= gl_tab_link_to s_('Branches|All'), project_branches_filtered_path(@project, state: 'all'), { item_active: %w[overview active stale].exclude?(@mode), title: s_('Branches|Show all branches') }
2019-12-04 20:38:33 +05:30
.nav-controls
2023-04-23 21:23:45 +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,
show_dropdown: @mode == 'overview' ? 'false' : 'true',
sorted_by: @sort }
}
2016-09-13 17:45:13 +05:30
2023-05-27 22:25:52 +05:30
- if is_branch_rules_available
= link_to project_settings_repository_path(@project, anchor: 'js-branch-rules'), class: 'gl-button btn btn-default' do
= s_('Branches|View branch rules')
- if can_push_code
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')
2023-07-09 08:55:56 +05:30
.js-delete-merged-branches{ data: {
default_branch: @project.repository.root_ref,
form_path: project_merged_branches_path(@project) }
}
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
2023-05-27 22:25:52 +05:30
- if is_branch_rules_available
= render 'branch_rules_info'
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 } }
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-07-16 23:28:13 +05:30
- if Feature.enabled?(:branch_list_keyset_pagination, @project)
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