redmine-git-remote/lib/redmine_git_remote/repositories_helper_patch.rb

24 lines
993 B
Ruby
Raw Normal View History

2014-11-28 22:35:33 +01:00
module RedmineGitRemote
2014-11-27 21:48:29 +01:00
module RepositoriesHelperPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
end
module InstanceMethods
2014-11-27 22:07:35 +01:00
def git_remote_field_tags(form, repository)
2014-11-28 22:35:33 +01:00
content_tag('p', form.text_field(:url,
:size => 60, :required => false,
2014-11-28 22:35:33 +01:00
:disabled => !repository.safe_attribute?('url'),
:label => l(:field_path_to_repository)) +
content_tag('em', l(:text_git_remote_path_note), :class => 'info') +
2014-11-27 21:48:29 +01:00
form.text_field(:extra_clone_url, :size => 60, :required => true,
2017-07-31 17:01:40 +02:00
:disabled => !repository.safe_attribute?('url'), name: 'repository[extra_info][extra_clone_url]') +
2014-11-28 22:35:33 +01:00
content_tag('em', l(:text_git_remote_url_note), :class => 'info')
2014-11-27 21:48:29 +01:00
)
end
end
end
RepositoriesHelper.send(:include, RepositoriesHelperPatch)
end