diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-06 20:45:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-06 20:45:13 +0000 |
commit | 4da77616beb031c5524648978b761d8b38260e25 (patch) | |
tree | 204f79c89eacd669621feec556d4a7e727da0e9c /app/helpers/repositories_helper.rb | |
parent | fee3a3ae5067638792d7d6549475d9cbbbd99a9d (diff) | |
download | redmine-4da77616beb031c5524648978b761d8b38260e25.tar.gz redmine-4da77616beb031c5524648978b761d8b38260e25.zip |
Code cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@13568 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/repositories_helper.rb')
-rw-r--r-- | app/helpers/repositories_helper.rb | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index a5fd132f5..32b72ec54 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -166,9 +166,7 @@ module RepositoriesHelper :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)) + scm_log_encoding_tag(form, repository) end def mercurial_field_tags(form, repository) @@ -178,11 +176,7 @@ module RepositoriesHelper :disabled => !repository.safe_attribute?('url') ) + content_tag('em', l(:text_mercurial_repository_note), :class => 'info')) + - content_tag('p', form.select( - :path_encoding, [nil] + Setting::ENCODINGS, - :label => l(:field_scm_path_encoding) - ) + - content_tag('em', l(:text_scm_path_encoding_note), :class => 'info')) + scm_path_encoding_tag(form, repository) end def git_field_tags(form, repository) @@ -192,11 +186,7 @@ module RepositoriesHelper :disabled => !repository.safe_attribute?('url') ) + content_tag('em', l(:text_git_repository_note), :class => 'info')) + - content_tag('p', form.select( - :path_encoding, [nil] + Setting::ENCODINGS, - :label => l(:field_scm_path_encoding) - ) + - content_tag('em', l(:text_scm_path_encoding_note), :class => 'info')) + + scm_path_encoding_tag(form, repository) + content_tag('p', form.check_box( :extra_report_last_commit, :label => l(:label_git_report_last_commit) @@ -214,14 +204,8 @@ module RepositoriesHelper :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) - ) + - content_tag('em', l(:text_scm_path_encoding_note), :class => 'info')) + scm_log_encoding_tag(form, repository) + + scm_path_encoding_tag(form, repository) end def bazaar_field_tags(form, repository) @@ -229,9 +213,7 @@ module RepositoriesHelper :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)) + scm_log_encoding_tag(form, repository) end def filesystem_field_tags(form, repository) @@ -239,11 +221,26 @@ module RepositoriesHelper :url, :label => l(:field_root_directory), :size => 60, :required => true, :disabled => !repository.safe_attribute?('url'))) + - content_tag('p', form.select( - :path_encoding, [nil] + Setting::ENCODINGS, - :label => l(:field_scm_path_encoding) - ) + - content_tag('em', l(:text_scm_path_encoding_note), :class => 'info')) + scm_path_encoding_tag(form, repository) + end + + def scm_log_encoding_tag(form, repository) + select = form.select( + :log_encoding, + [nil] + Setting::ENCODINGS, + :label => l(:field_commit_logs_encoding), + :required => true + ) + content_tag('p', select) + end + + def scm_path_encoding_tag(form, repository) + select = form.select( + :path_encoding, + [nil] + Setting::ENCODINGS, + :label => l(:field_scm_path_encoding) + ) + content_tag('p', select + content_tag('em', l(:text_scm_path_encoding_note), :class => 'info')) end def index_commits(commits, heads) |