Revision 400c9573
Added by Marc Dequènes almost 15 years ago
- ID 400c9573a42ad9bc114bb9a095bf21db1d860414
app/helpers/application_helper.rb | ||
---|---|---|
|
||
def display_new_action(text = nil)
|
||
text = sprintf(_("New %s"), _(resource_model.human_name)) if text.nil?
|
||
res = resource_family(resource_model.new)
|
||
link_to(display_icon_tag('actions/document-new', :medium, :title => text) +
|
||
" <span class=\"middle\">" + text + "</span>", new_polymorphic_path(res.dup))
|
||
" <span class=\"middle\">" + text + "</span>", new_resource_path)
|
||
end
|
||
|
||
def display_standard_form_buttons(submit_label)
|
||
res = resource_family(resource_model.new)
|
||
"<div class=\"actions\">" + display_image_submit_tag('actions/gtk-ok', :medium, :title => submit_label) +
|
||
"<div class=\"big-action-placeholder\"></div>" +
|
||
link_to(display_icon_tag('actions/gtk-cancel', :medium, :title => _("Cancel")), polymorphic_path(res.dup)) +
|
||
link_to(display_icon_tag('actions/gtk-cancel', :medium, :title => _("Cancel")), resource_index_path) +
|
||
"</div>"
|
||
end
|
||
|
||
... | ... | |
image_tag(img.public_filename(thumb_name))
|
||
end
|
||
|
||
# MyCyma-specific, should be removed or adapted for Verard
|
||
def display_image_frame(image, params = {})
|
||
frame_type = params.has_key?(:frame_type) ? params[:frame_type] : :classic
|
||
size = params[:size] || :thumb_big
|
||
... | ... | |
style += " margin: #{frame_margin}px; display: inline-block;"
|
||
end
|
||
|
||
html = "<div class=\"artwork_frame\" style=\"" + style + "\">"
|
||
html = "<div class=\"image_frame\" style=\"" + style + "\">"
|
||
html += "<div style=\"padding: #{image_padding}px #{image_padding}px 0; margin: 0px;\">" + display_thumbnail(image, size) + "</div>"
|
||
html += "<div>"
|
||
infos = []
|
||
... | ... | |
|
||
with_link ? link_to(html, :controller => '/view', :action => 'artwork', :id => image.artwork.id) : html
|
||
end
|
||
|
||
def display_link_to_obj(obj, text_method)
|
||
return if obj.nil?
|
||
link_to_resource(obj, obj.send(text_method))
|
||
end
|
||
end
|
Also available in: Unified diff
[evol] improved and updated application helpers for new restfull_plugin version