summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-12 15:49:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-12 15:49:29 +0000
commit690135e1c5bc5907690fde7111a67572104cce85 (patch)
treeaa4149f9c3c05c690b4e5178489addc8f2a1ae02 /lib/redmine
parent655057f08ba6bc4873ea91d99d515f29dc2fb6a3 (diff)
downloadredmine-690135e1c5bc5907690fde7111a67572104cce85.tar.gz
redmine-690135e1c5bc5907690fde7111a67572104cce85.zip
shorten long line of lib/redmine/wiki_formatting/macros.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20638 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/wiki_formatting/macros.rb38
1 files changed, 31 insertions, 7 deletions
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb
index fc907db91..07c57354e 100644
--- a/lib/redmine/wiki_formatting/macros.rb
+++ b/lib/redmine/wiki_formatting/macros.rb
@@ -224,7 +224,14 @@ module Redmine
raise t(:error_circular_inclusion) if @included_wiki_pages.include?(page.id)
@included_wiki_pages << page.id
- out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false, :inline_attachments => @@inline_attachments)
+ out =
+ textilizable(
+ page.content,
+ :text,
+ :attachments => page.attachments,
+ :headings => false,
+ :inline_attachments => @@inline_attachments
+ )
@included_wiki_pages.pop
out
end
@@ -239,8 +246,21 @@ module Redmine
js = "$('##{html_id}-show, ##{html_id}-hide').toggle(); $('##{html_id}').fadeToggle(150);"
out = ''.html_safe
out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'icon icon-collapsed collapsible')
- out << link_to_function(hide_label, js, :id => "#{html_id}-hide", :class => 'icon icon-expended collapsible', :style => 'display:none;')
- out << content_tag('div', textilizable(text, :object => obj, :headings => false, :inline_attachments => @@inline_attachments), :id => html_id, :class => 'collapsed-text', :style => 'display:none;')
+ out <<
+ link_to_function(
+ hide_label, js,
+ :id => "#{html_id}-hide",
+ :class => 'icon icon-expended collapsible',
+ :style => 'display:none;'
+ )
+ out <<
+ content_tag(
+ 'div',
+ textilizable(text, :object => obj, :headings => false,
+ :inline_attachments => @@inline_attachments),
+ :id => html_id, :class => 'collapsed-text',
+ :style => 'display:none;'
+ )
out
end
@@ -258,11 +278,15 @@ module Redmine
size = size.to_i
size = 200 unless size > 0
- if obj && obj.respond_to?(:attachments) && attachment = Attachment.latest_attach(obj.attachments, filename)
+ if obj && obj.respond_to?(:attachments) &&
+ attachment = Attachment.latest_attach(obj.attachments, filename)
title = options[:title] || attachment.title
- thumbnail_url = url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment, :size => size, :only_path => @only_path)
- image_url = url_for(:controller => 'attachments', :action => 'show', :id => attachment, :only_path => @only_path)
-
+ thumbnail_url =
+ url_for(:controller => 'attachments', :action => 'thumbnail',
+ :id => attachment, :size => size, :only_path => @only_path)
+ image_url =
+ url_for(:controller => 'attachments', :action => 'show',
+ :id => attachment, :only_path => @only_path)
img = image_tag(thumbnail_url, :alt => attachment.filename)
link_to(img, image_url, :class => 'thumbnail', :title => title)
else