To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / plugins / redmine_checkout / lib / checkout / repositories_helper_patch.rb @ 1318:9c2a5a4514a8
History | View | Annotate | Download (1.15 KB)
| 1 |
require_dependency 'repositories_helper'
|
|---|---|
| 2 |
|
| 3 |
module Checkout |
| 4 |
module RepositoriesHelperPatch |
| 5 |
def self.included(base) # :nodoc: |
| 6 |
base.send(:include, InstanceMethods) |
| 7 |
|
| 8 |
base.class_eval do
|
| 9 |
alias_method_chain :repository_field_tags, :checkout |
| 10 |
alias_method_chain :scm_select_tag, :javascript |
| 11 |
end
|
| 12 |
end
|
| 13 |
|
| 14 |
module InstanceMethods |
| 15 |
def repository_field_tags_with_checkout(form, repository) |
| 16 |
tags = repository_field_tags_without_checkout(form, repository) || ""
|
| 17 |
return tags if repository.class.name == "Repository" |
| 18 |
|
| 19 |
tags + @controller.send(:render_to_string, :partial => 'projects/settings/repository_checkout', :locals => {:form => form, :repository => repository, :scm => repository.scm_name}) |
| 20 |
end
|
| 21 |
|
| 22 |
def scm_select_tag_with_javascript(*args) |
| 23 |
content_for :header_tags do |
| 24 |
javascript_include_tag('subform', :plugin => 'redmine_checkout') + |
| 25 |
stylesheet_link_tag('checkout', :plugin => 'redmine_checkout') |
| 26 |
end
|
| 27 |
scm_select_tag_without_javascript(*args) |
| 28 |
end
|
| 29 |
end
|
| 30 |
end
|
| 31 |
end
|
| 32 |
|
| 33 |
RepositoriesHelper.send(:include, Checkout::RepositoriesHelperPatch) |
| 34 |
|