Skip to content

Commit 17c289f

Browse files
author
root
committed
Add a jump box to switch repositories in edit view
1 parent 3705bc5 commit 17c289f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: app/helpers/extend_repositories_helper.rb

+6
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ def repository_branches_list(branches)
3232
options_for_select(branches.collect{ |b| [b.to_s, b.to_s] }, selected: branches.find{ |b| b.is_default}.to_s)
3333
end
3434

35+
36+
def render_repository_quick_jump(repository)
37+
options = repository.project.repositories.map{ |r| [r.redmine_name, edit_repository_path(r)] }
38+
select_tag('repository_quick_jump_box', options_for_select(options, selected: edit_repository_path(repository)), onchange: 'if (this.value != \'\') { window.location = this.value; }')
39+
end
40+
3541
end

Diff for: app/views/repositories/edit.html.haml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.contextual
2+
= render_repository_quick_jump(@repository)
3+
14
%h2
25
= link_to l(:label_settings), settings_project_path(@repository.project, tab: 'repositories')
36
»

0 commit comments

Comments
 (0)