Initial implementation of an async branch dropdown for Revert and Cherry Pick.
This commit is contained in:
parent
83bbca26f4
commit
41d598ce50
|
@ -1,6 +1,5 @@
|
|||
.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
|
||||
|
|
Loading…
Reference in New Issue