|
|
|
@ -126,6 +126,14 @@ module RepositoriesHelper
|
|
|
|
|
send(method, form, repository)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# by xianbo
|
|
|
|
|
def repository_field_tags_new(form, repository)
|
|
|
|
|
method = repository.class.name.demodulize.underscore + "_field_tags_new"
|
|
|
|
|
if repository.is_a?(Repository) &&
|
|
|
|
|
respond_to?(method) && method != 'repository_field_tags_new'
|
|
|
|
|
send(method, form, repository)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def scm_select_tag(repository)
|
|
|
|
|
scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']]
|
|
|
|
@ -154,37 +162,40 @@ module RepositoriesHelper
|
|
|
|
|
:disabled => !repository.safe_attribute?('url')) +
|
|
|
|
|
'<br />'.html_safe +
|
|
|
|
|
'(file:///, http://, https://, svn://, svn+[tunnelscheme]://)') +
|
|
|
|
|
content_tag('p', form.text_field(:login, :size => 30)) +
|
|
|
|
|
content_tag('p', form.text_field(:login, :size => 30))+
|
|
|
|
|
content_tag('p', form.password_field(
|
|
|
|
|
:password, :size => 30, :name => 'ignore',
|
|
|
|
|
:value => ((repository.new_record? || repository.password.blank?) ? '' : ('x'*15)),
|
|
|
|
|
:onfocus => "this.value=''; this.name='repository[password]';",
|
|
|
|
|
:onchange => "this.name='repository[password]';"))
|
|
|
|
|
end
|
|
|
|
|
# by xianbo
|
|
|
|
|
def subversion_field_tags_new(form, repository)
|
|
|
|
|
|
|
|
|
|
def darcs_field_tags(form, repository)
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
|
:url, :label => l(:field_path_to_repository),
|
|
|
|
|
:size => 60, :required => true,
|
|
|
|
|
:disabled => !repository.safe_attribute?('url'))) +
|
|
|
|
|
content_tag('p', form.select(
|
|
|
|
|
:log_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
:label => l(:field_commit_logs_encoding), :required => true))
|
|
|
|
|
end
|
|
|
|
|
# def darcs_field_tags(form, repository)
|
|
|
|
|
# content_tag('p', form.text_field(
|
|
|
|
|
# :url, :label => l(:field_path_to_repository),
|
|
|
|
|
# :size => 60, :required => true,
|
|
|
|
|
# :disabled => !repository.safe_attribute?('url'))) +
|
|
|
|
|
# content_tag('p', form.select(
|
|
|
|
|
# :log_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
# :label => l(:field_commit_logs_encoding), :required => true))
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def mercurial_field_tags(form, repository)
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
|
:url, :label => l(:field_path_to_repository),
|
|
|
|
|
:size => 60, :required => true,
|
|
|
|
|
:disabled => !repository.safe_attribute?('url')
|
|
|
|
|
) +
|
|
|
|
|
'<br />'.html_safe + l(:text_mercurial_repository_note)) +
|
|
|
|
|
content_tag('p', form.select(
|
|
|
|
|
:path_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
:label => l(:field_scm_path_encoding)
|
|
|
|
|
) +
|
|
|
|
|
'<br />'.html_safe + l(:text_scm_path_encoding_note))
|
|
|
|
|
end
|
|
|
|
|
# def mercurial_field_tags(form, repository)
|
|
|
|
|
# content_tag('p', form.text_field(
|
|
|
|
|
# :url, :label => l(:field_path_to_repository),
|
|
|
|
|
# :size => 60, :required => true,
|
|
|
|
|
# :disabled => !repository.safe_attribute?('url')
|
|
|
|
|
# ) +
|
|
|
|
|
# '<br />'.html_safe + l(:text_mercurial_repository_note)) +
|
|
|
|
|
# content_tag('p', form.select(
|
|
|
|
|
# :path_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
# :label => l(:field_scm_path_encoding)
|
|
|
|
|
# ) +
|
|
|
|
|
# '<br />'.html_safe + l(:text_scm_path_encoding_note))
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def git_field_tags(form, repository)
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
@ -204,37 +215,43 @@ module RepositoriesHelper
|
|
|
|
|
:label => l(:label_git_report_last_commit)
|
|
|
|
|
))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def cvs_field_tags(form, repository)
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
|
:root_url,
|
|
|
|
|
:label => l(:field_cvsroot),
|
|
|
|
|
:size => 60, :required => true,
|
|
|
|
|
:disabled => !repository.safe_attribute?('root_url'))) +
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
|
:url,
|
|
|
|
|
:label => l(:field_cvs_module),
|
|
|
|
|
:size => 30, :required => true,
|
|
|
|
|
:disabled => !repository.safe_attribute?('url'))) +
|
|
|
|
|
content_tag('p', form.select(
|
|
|
|
|
:log_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
:label => l(:field_commit_logs_encoding), :required => true)) +
|
|
|
|
|
content_tag('p', form.select(
|
|
|
|
|
:path_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
:label => l(:field_scm_path_encoding)
|
|
|
|
|
) +
|
|
|
|
|
'<br />'.html_safe + l(:text_scm_path_encoding_note))
|
|
|
|
|
# by xianbo
|
|
|
|
|
def git_field_tags_new(form, repository)
|
|
|
|
|
content_tag('p', form.check_box(
|
|
|
|
|
:extra_report_last_commit,
|
|
|
|
|
:label => l(:label_git_report_last_commit)
|
|
|
|
|
))
|
|
|
|
|
end
|
|
|
|
|
# def cvs_field_tags(form, repository)
|
|
|
|
|
# content_tag('p', form.text_field(
|
|
|
|
|
# :root_url,
|
|
|
|
|
# :label => l(:field_cvsroot),
|
|
|
|
|
# :size => 60, :required => true,
|
|
|
|
|
# :disabled => !repository.safe_attribute?('root_url'))) +
|
|
|
|
|
# content_tag('p', form.text_field(
|
|
|
|
|
# :url,
|
|
|
|
|
# :label => l(:field_cvs_module),
|
|
|
|
|
# :size => 30, :required => true,
|
|
|
|
|
# :disabled => !repository.safe_attribute?('url'))) +
|
|
|
|
|
# content_tag('p', form.select(
|
|
|
|
|
# :log_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
# :label => l(:field_commit_logs_encoding), :required => true)) +
|
|
|
|
|
# content_tag('p', form.select(
|
|
|
|
|
# :path_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
# :label => l(:field_scm_path_encoding)
|
|
|
|
|
# ) +
|
|
|
|
|
# '<br />'.html_safe + l(:text_scm_path_encoding_note))
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def bazaar_field_tags(form, repository)
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
|
:url, :label => l(:field_path_to_repository),
|
|
|
|
|
:size => 60, :required => true,
|
|
|
|
|
:disabled => !repository.safe_attribute?('url'))) +
|
|
|
|
|
content_tag('p', form.select(
|
|
|
|
|
:log_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
:label => l(:field_commit_logs_encoding), :required => true))
|
|
|
|
|
end
|
|
|
|
|
# def bazaar_field_tags(form, repository)
|
|
|
|
|
# content_tag('p', form.text_field(
|
|
|
|
|
# :url, :label => l(:field_path_to_repository),
|
|
|
|
|
# :size => 60, :required => true,
|
|
|
|
|
# :disabled => !repository.safe_attribute?('url'))) +
|
|
|
|
|
# content_tag('p', form.select(
|
|
|
|
|
# :log_encoding, [nil] + Setting::ENCODINGS,
|
|
|
|
|
# :label => l(:field_commit_logs_encoding), :required => true))
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def filesystem_field_tags(form, repository)
|
|
|
|
|
content_tag('p', form.text_field(
|
|
|
|
@ -295,3 +312,5 @@ module RepositoriesHelper
|
|
|
|
|
max_space
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|