Project

General

Profile

« Previous | Next » 

Revision c7dd4b36

Added by Marc Dequènes almost 15 years ago

  • ID c7dd4b36a429fbcb4b8ac26f141b914bae774149

[evol] created display_artwork_frame() helper function and now use it in the welcome page + created a set/group tree view with it too

View differences:

app/helpers/application_helper.rb
end
image_tag(img.public_filename(thumb_name))
end
def display_artwork_frame(artwork, params = {})
frame_type = params.has_key?(:frame_type) ? params[:frame_type] : :classic
size = params[:size] || :thumb_big
display_title = params.has_key?(:display_title) ? params[:display_title] : true
display_size = params.has_key?(:display_size) ? params[:display_size] : true
style = "text-align: center; padding: 0px;"
case frame_type
when :classic
style += " margin: 7px;"
when :cell
style += " padding-left: 3px; padding-right: 3px; margin-top: 7px; margin-bottom: 7px; margin-left: auto; margin-right: auto;"
when :float
style += " margin: 7px; float: left;"
end
html = "<div style=\"" + style + "\">"
html += "<div style=\padding: 0px; margin: 0px;\">" + display_thumbnail(artwork.image, size) + "</div>"
infos = []
if display_title
title = params[:force_title] ? params[:force_title] : artwork.title
infos << title
end
if display_size
infos << "<span style=\"font-size: smaller;\">(" + artwork.artwork_size.human_size + ")</span>"
end
html += infos.join("<br />")
html += "</div>"
end
end

Also available in: Unified diff