summaryrefslogtreecommitdiff
path: root/app/views/projects/branches
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-07-25 12:07:29 +0000
committerDouwe Maan <douwe@gitlab.com>2016-07-25 12:07:29 +0000
commit8ce5b4f1a30c0ab904f67c544a6b7de1bb49e664 (patch)
treefc9625d19726506d7d459327ec972071e6a3175a /app/views/projects/branches
parent83180110348af1b244d56e9cdf5f29c5d6f84db0 (diff)
parent850813d29867aac5935e1128880784f97071a6d8 (diff)
downloadgitlab-ce-8ce5b4f1a30c0ab904f67c544a6b7de1bb49e664.tar.gz
Merge branch 'filter-branch-by-name' into 'master'
Users can filter branches by name on project branches page This MR aims to solve #18674 by adding the possibility to filter project branches by name ![Screen_Shot_2016-07-07_at_17.21.25](/uploads/b674765d2b1cb8a121c2101715a4568b/Screen_Shot_2016-07-07_at_17.21.25.png) See merge request !5144
Diffstat (limited to 'app/views/projects/branches')
-rw-r--r--app/views/projects/branches/index.html.haml20
1 files changed, 12 insertions, 8 deletions
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
index 77b405f1f39..6f806e3ce53 100644
--- a/app/views/projects/branches/index.html.haml
+++ b/app/views/projects/branches/index.html.haml
@@ -9,26 +9,30 @@
- if can? current_user, :push_code, @project
.nav-controls
- = link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do
- New branch
+ = form_tag(filter_branches_path, method: :get) do
+ = search_field_tag :search, params[:search], { placeholder: 'Filter by branch name', id: 'branch-search', class: 'form-control search-text-input input-short', spellcheck: false }
.dropdown.inline
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
%span.light
- - if @sort.present?
- = @sort.humanize
+ - if params[:sort].present?
+ = params[:sort].humanize
- else
Name
%b.caret
%ul.dropdown-menu.dropdown-menu-align-right
%li
- = link_to namespace_project_branches_path(sort: nil) do
- Name
- = link_to namespace_project_branches_path(sort: 'recently_updated') do
+ = link_to filter_branches_path(sort: nil) do
+ = sort_title_name
+ = link_to filter_branches_path(sort: 'recently_updated') do
= sort_title_recently_updated
- = link_to namespace_project_branches_path(sort: 'last_updated') do
+ = link_to filter_branches_path(sort: 'last_updated') do
= sort_title_oldest_updated
+ = link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do
+ New branch
- if @branches.any?
%ul.content-list.all-branches
- @branches.each do |branch|
= render "projects/branches/branch", branch: branch
= paginate @branches, theme: 'gitlab'
+ - else
+ .nothing-here-block No branches to show