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 {
position: relative;
overflow-y: auto;
padding: 15px;
.form-actions {
......
......@@ -15,6 +15,13 @@ class Projects::BranchesController < Projects::ApplicationController
diverging_commit_counts = repository.diverging_commit_counts(branch)
[memo, diverging_commit_counts[:behind], diverging_commit_counts[:ahead]].max
end
respond_to do |format|
format.html
format.json do
render json: @repository.branch_names.to_json
end
end
end
def recent
......
......@@ -17,7 +17,14 @@
.form-group.branch
= label_tag 'target_branch', target_label, class: 'control-label'
.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)
.js-create-merge-request-container
.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