2016-06-03 14:09:45 -04:00
|
|
|
- @no_container = true
|
2017-09-22 12:01:20 -04:00
|
|
|
- page_title _('Branches')
|
2016-06-03 14:09:45 -04:00
|
|
|
|
2016-06-30 09:01:26 -04:00
|
|
|
%div{ class: container_class }
|
2016-12-22 18:18:01 -05:00
|
|
|
.top-area.adjust
|
2017-07-18 12:55:48 -04:00
|
|
|
- if can?(current_user, :admin_project, @project)
|
|
|
|
.nav-text
|
2017-09-22 12:01:20 -04:00
|
|
|
- project_settings_link = link_to s_('Branches|project settings'), project_protected_branches_path(@project)
|
|
|
|
= s_('Branches|Protected branches can be managed in %{project_settings_link}').html_safe % { project_settings_link: project_settings_link }
|
2016-06-08 11:23:45 -04:00
|
|
|
|
2016-07-24 16:13:46 -04:00
|
|
|
.nav-controls
|
|
|
|
= form_tag(filter_branches_path, method: :get) do
|
2017-09-22 12:01:20 -04:00
|
|
|
= 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-07-24 16:13:46 -04:00
|
|
|
|
2017-01-19 13:56:15 -05:00
|
|
|
.dropdown.inline>
|
2016-12-26 05:47:16 -05:00
|
|
|
%button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
|
2016-07-24 16:13:46 -04:00
|
|
|
%span.light
|
2017-04-18 08:48:52 -04:00
|
|
|
= branches_sort_options_hash[@sort]
|
2016-11-22 16:28:07 -05:00
|
|
|
= icon('chevron-down')
|
2017-04-18 08:48:52 -04:00
|
|
|
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
|
|
|
|
%li.dropdown-header
|
2017-09-22 12:01:20 -04:00
|
|
|
= s_('Branches|Sort by')
|
2017-04-18 08:48:52 -04:00
|
|
|
- branches_sort_options_hash.each do |value, title|
|
|
|
|
%li
|
|
|
|
= link_to title, filter_branches_path(sort: value), class: ("is-active" if @sort == value)
|
2016-07-24 16:13:46 -04:00
|
|
|
|
|
|
|
- if can? current_user, :push_code, @project
|
2017-09-22 12:01:20 -04:00
|
|
|
= 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-06-29 13:06:35 -04:00
|
|
|
= link_to new_project_branch_path(@project), class: 'btn btn-create' do
|
2017-09-22 12:01:20 -04:00
|
|
|
= s_('Branches|New branch')
|
2016-07-24 16:13:46 -04:00
|
|
|
|
2016-06-30 09:01:26 -04:00
|
|
|
- if @branches.any?
|
2016-06-03 14:09:45 -04:00
|
|
|
%ul.content-list.all-branches
|
|
|
|
- @branches.each do |branch|
|
2017-11-17 13:13:45 -05:00
|
|
|
= render "projects/branches/branch", branch: branch, merged: @merged_branch_names.include?(branch.name)
|
2016-06-03 14:09:45 -04:00
|
|
|
= paginate @branches, theme: 'gitlab'
|
2016-07-07 12:19:21 -04:00
|
|
|
- else
|
2017-09-22 12:01:20 -04:00
|
|
|
.nothing-here-block
|
|
|
|
= s_('Branches|No branches to show')
|
2017-05-08 03:41:58 -04:00
|
|
|
|
|
|
|
= render 'projects/branches/delete_protected_modal'
|