|
|
@ -182,11 +182,27 @@ module ApplicationHelper
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def thumbnail_tag(attachment)
|
|
|
|
def thumbnail_tag(attachment)
|
|
|
|
link_to image_tag(thumbnail_path(attachment)),
|
|
|
|
imagepath = named_attachment_path(attachment, attachment.filename)
|
|
|
|
named_attachment_path(attachment, attachment.filename),
|
|
|
|
link_to image_tag(imagepath),
|
|
|
|
|
|
|
|
imagepath ,
|
|
|
|
:title => attachment.filename
|
|
|
|
:title => attachment.filename
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 图片缩略图链接
|
|
|
|
|
|
|
|
def thumbnail_small_tag(attachment)
|
|
|
|
|
|
|
|
imagesize = attachment.thumbnail(:size => "200*200")
|
|
|
|
|
|
|
|
imagepath = named_attachment_path(attachment, attachment.filename)
|
|
|
|
|
|
|
|
if imagesize
|
|
|
|
|
|
|
|
link_to image_tag(imagesize),
|
|
|
|
|
|
|
|
imagepath,
|
|
|
|
|
|
|
|
:title => attachment.filename
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
link_to image_tag(imagepath , height: '200', width: '250'),
|
|
|
|
|
|
|
|
imagepath,
|
|
|
|
|
|
|
|
:title => attachment.filename
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def toggle_link(name, id, options={})
|
|
|
|
def toggle_link(name, id, options={})
|
|
|
|
onclick = "$('##{id}').toggle(); "
|
|
|
|
onclick = "$('##{id}').toggle(); "
|
|
|
|
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
|
|
|
|
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
|
|
|
|