Module: Admin::AttachmentHelper
- Defined in:
- app/helpers/admin/attachment_helper.rb
Instance Method Summary collapse
-
#display_visual(object_name, picture, name = 'picture') ⇒ Object
Display object visual ####.
-
#display_visuals(object_name, pictures) ⇒ Object
Display object visuals ####.
Instance Method Details
#display_visual(object_name, picture, name = 'picture') ⇒ Object
Display object visual ####
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/admin/attachment_helper.rb', line 4 def display_visual(object_name, picture, name = 'picture') content_tag :div, :class => 'fieldset open' do link_to(t(:name, :scope => [object_name, name]), '#', :class => 'small-icons panel') + content_tag(:div, :class =>'option-panel-content') do label = (picture.nil? ? t(:add, :scope => [object_name,name]) : t(:change, :scope => [object_name, name])).capitalize picture.nil? ? picture_id = '' : picture_id = picture.id hidden_field_tag("#{object_name}[#{name}_id]", picture_id, :id => name) + link_to(content_tag(:span, label,:class => 'big-icons add-picture'), '#', :class => "add-#{name}picture backgrounds button right") + content_tag(:div, :class => 'grid_9', :id => "#{name}-picture") do content_tag(:ul, :class => 'sortable') do unless picture.nil? content_tag(:li) do image_tag(picture.public_filename(:normal)) + link_to_function('', "$(this).parents('li').remove(); $('##{name}').val('null');", :title => t('media.picture.destroy.confirm').capitalize, :class => 'big-icons delete') end end end end end + content_tag(:div,'', :class => 'clear') end end |
#display_visuals(object_name, pictures) ⇒ Object
Display object visuals ####
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/helpers/admin/attachment_helper.rb', line 29 def display_visuals(object_name, pictures) content_tag :div, :class => 'fieldset open' do link_to(t("#{object_name}.visuals.name"), '#', :class => 'small-icons panel') + content_tag(:div, :class =>'option-panel-content') do link_to(content_tag(:span, t("add_picture").capitalize, :class => 'big-icons add-picture'), '#', :class => 'add-visualpictures backgrounds button right') + content_tag(:div, :class => 'grid_9', :id => 'visuals-picture') do content_tag(:ul, :class => 'sortable') do pictures.collect{ |picture| content_tag(:li) do link_to_function('', "$(this).parents('li').remove();", :title => t('media.picture.destroy.confirm').capitalize, :class => 'big-icons delete') + hidden_field_tag("#{object_name}[attachment_ids][]", picture.id, :id => "attachment_#{picture.id}") + image_tag(picture.public_filename(:thumb)) + content_tag(:div, :class => 'handler') do content_tag(:div,'',:class => 'inner') end end }.join + content_tag(:li,'', :class => 'clear') end end end + content_tag(:div,'', :class => 'clear') end end |