2016-06-16 23:09:34 +05:30
|
|
|
- @no_container = true
|
2018-03-17 18:26:18 +05:30
|
|
|
- page_title _('Branches')
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
%div{ class: container_class }
|
2017-08-17 22:00:37 +05:30
|
|
|
.top-area.adjust
|
2018-03-27 19:54:05 +05:30
|
|
|
%ul.nav-links.issues-state-filters
|
|
|
|
%li{ class: active_when(@mode == 'overview') }>
|
|
|
|
= link_to s_('Branches|Overview'), project_branches_path(@project), title: s_('Branches|Show overview of the branches')
|
|
|
|
|
|
|
|
%li{ class: active_when(@mode == 'active') }>
|
|
|
|
= link_to s_('Branches|Active'), project_branches_filtered_path(@project, state: 'active'), title: s_('Branches|Show active branches')
|
|
|
|
|
|
|
|
%li{ class: active_when(@mode == 'stale') }>
|
|
|
|
= link_to s_('Branches|Stale'), project_branches_filtered_path(@project, state: 'stale'), title: s_('Branches|Show stale branches')
|
|
|
|
|
|
|
|
%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')
|
2016-06-16 23:09:34 +05:30
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
.nav-controls
|
2018-03-27 19:54:05 +05:30
|
|
|
= form_tag(project_branches_filtered_path(@project, state: 'all'), method: :get) do
|
2018-03-17 18:26:18 +05:30
|
|
|
= search_field_tag :search, params[:search], { placeholder: s_('Branches|Filter by branch name'), id: 'branch-search', class: 'form-control search-text-input input-short', spellcheck: false }
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
- unless @mode == 'overview'
|
|
|
|
.dropdown.inline>
|
|
|
|
%button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
|
|
|
|
%span.light
|
|
|
|
= branches_sort_options_hash[@sort]
|
|
|
|
= icon('chevron-down')
|
|
|
|
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
|
|
|
|
%li.dropdown-header
|
|
|
|
= s_('Branches|Sort by')
|
|
|
|
- branches_sort_options_hash.each do |value, title|
|
|
|
|
%li
|
|
|
|
= link_to title, project_branches_filtered_path(@project, state: 'all', search: params[:search], sort: value), class: ("is-active" if @sort == value)
|
2016-09-13 17:45:13 +05:30
|
|
|
|
|
|
|
- if can? current_user, :push_code, @project
|
2018-03-17 18:26:18 +05:30
|
|
|
= link_to project_merged_branches_path(@project),
|
|
|
|
class: 'btn btn-inverted btn-remove has-tooltip',
|
|
|
|
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')
|
2017-09-10 17:25:29 +05:30
|
|
|
= link_to new_project_branch_path(@project), class: 'btn btn-create' do
|
2018-03-17 18:26:18 +05:30
|
|
|
= s_('Branches|New branch')
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2018-03-27 19:54:05 +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 }
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
- elsif @branches.any?
|
2016-06-16 23:09:34 +05:30
|
|
|
%ul.content-list.all-branches
|
|
|
|
- @branches.each do |branch|
|
2018-03-17 18:26:18 +05:30
|
|
|
= render "projects/branches/branch", branch: branch, merged: @merged_branch_names.include?(branch.name)
|
2016-06-16 23:09:34 +05:30
|
|
|
= paginate @branches, theme: 'gitlab'
|
2016-08-24 12:49:21 +05:30
|
|
|
- else
|
2018-03-17 18:26:18 +05:30
|
|
|
.nothing-here-block
|
|
|
|
= s_('Branches|No branches to show')
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
= render 'projects/branches/delete_protected_modal'
|