Skip to content

#734 fix protected_branches list and sort order #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/repository_protected_branches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def clone
end

def sort
params[:repository_protected_branche].each_with_index do |id, index|
params[:protected_branch].each_with_index do |id, index|
@repository.protected_branches.where(id: id).update_all(position: index + 1)
end
# Update Gitolite repository
call_use_case
render nothing: true
head :ok
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/views/repository_protected_branches/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ div
= link_to "(#{l(:label_gitolite_documentation)})", 'https://gitolite.com/gitolite/conf.html#rules', class: 'external'

- if @repository_protected_branches.any?
table#protected_branches.table.table-hover data="update-url: #{sort_repository_protected_branches_url}", style: "opacity: #{@repository.protected_branches_enabled? ? '1' : '0.5'};" }
table#protected_branches.table.table-hover data-update-url="#{sort_repository_protected_branches_url}" style="opacity: #{@repository.protected_branches_enabled? ? '1' : '0.5'};"
thead
tr
th
Expand Down