diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-03 03:30:10 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-03 03:30:10 +0000 |
commit | bc09628249a9046544a493bae2f0153606782d11 (patch) | |
tree | db70212719de81b07063b160a49189a3ee4ceed2 /app/helpers | |
parent | c3e8fc5f1a2daac4b2972effd79e9cf5e4e6cba6 (diff) | |
download | redmine-bc09628249a9046544a493bae2f0153606782d11.tar.gz redmine-bc09628249a9046544a493bae2f0153606782d11.zip |
scm: code clean up repositories_helper.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4990 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/repositories_helper.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 9af2838e2..1ae13463d 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -25,13 +25,13 @@ module RepositoriesHelper revision.to_s end end - + def truncate_at_line_break(text, length = 255) if text text.gsub(%r{^(.{#{length}}[^\n]*)\n.+$}m, '\\1...') end end - + def render_properties(properties) unless properties.nil? || properties.empty? content = '' @@ -41,7 +41,7 @@ module RepositoriesHelper content_tag('ul', content, :class => 'properties') end end - + def render_changeset_changes changes = @changeset.changes.find(:all, :limit => 1000, :order => 'path').collect do |change| case change.action @@ -75,10 +75,10 @@ module RepositoriesHelper render_changes_tree(tree[:s]) end - + def render_changes_tree(tree) return '' if tree.nil? - + output = '' output << '<ul>' tree.keys.sort.each do |file| @@ -115,14 +115,14 @@ module RepositoriesHelper output << '</ul>' output end - + def to_utf8(str) return str if str.blank? if str.respond_to?(:force_encoding) str.force_encoding('UTF-8') else # TODO: - # Japanese Shift_JIS(CP932) is not compatible with ASCII. + # Japanese Shift_JIS(CP932) is not compatible with ASCII. # UTF-7 and Japanese ISO-2022-JP are 7bits clean. return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii end @@ -192,10 +192,11 @@ module RepositoriesHelper :disabled => (repository && !repository.root_url.blank?)) + '<br />(file:///, http://, https://, svn://, svn+[tunnelscheme]://)') + 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]';")) + 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 def darcs_field_tags(form, repository) |