Commit 41d598ce authored by Connor Shea's avatar Connor Shea

Initial implementation of an async branch dropdown for Revert and Cherry Pick.

parent 83bbca26
.modal-body { .modal-body {
position: relative; position: relative;
overflow-y: auto;
padding: 15px; padding: 15px;
.form-actions { .form-actions {
......
...@@ -15,6 +15,13 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -15,6 +15,13 @@ class Projects::BranchesController < Projects::ApplicationController
diverging_commit_counts = repository.diverging_commit_counts(branch) diverging_commit_counts = repository.diverging_commit_counts(branch)
[memo, diverging_commit_counts[:behind], diverging_commit_counts[:ahead]].max [memo, diverging_commit_counts[:behind], diverging_commit_counts[:ahead]].max
end end
respond_to do |format|
format.html
format.json do
render json: @repository.branch_names.to_json
end
end
end end
def recent def recent
......
...@@ -17,7 +17,14 @@ ...@@ -17,7 +17,14 @@
.form-group.branch .form-group.branch
= label_tag 'target_branch', target_label, class: 'control-label' = label_tag 'target_branch', target_label, class: 'control-label'
.col-sm-10 .col-sm-10
= select_tag "target_branch", project_branches, class: "select2 select2-sm js-target-branch" .dropdown
= dropdown_toggle @project.default_branch, { toggle: "dropdown", selected: @project.default_branch, ref: @ref, refs_url: branches_namespace_project_path(@project.namespace, @project) }, { toggle_class: "js-project-refs-dropdown js-target-branch" }
.dropdown-menu.dropdown-menu-selectable
= dropdown_title "Switch branch"
= dropdown_filter "Search branches"
= dropdown_content
= dropdown_loading
- if can?(current_user, :push_code, @project) - if can?(current_user, :push_code, @project)
.js-create-merge-request-container .js-create-merge-request-container
.checkbox .checkbox
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment