bisscomm/refinerycms-image-slideshows

View on GitHub
app/views/refinery/image_slideshows/admin/image_slides/_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_for [refinery, :image_slideshows_admin, @image_slideshow, @image_slide] do |f| %>
  <%= render '/refinery/admin/error_messages',
              :object => @image_slide,
              :include_object_name => true %>

  <%= render '/refinery/admin/locale_picker',
              :current_locale => Globalize.locale %>

  <%= f.hidden_field :image_slideshow_id, :value => @image_slideshow.id  %>

  <div class='field'>
    <%= f.label :title %>
    <%= f.text_field :title, :class => 'larger widest'  %>
  </div>

  <div class='field'>
    <%= f.label :image %>
    <%= render '/refinery/admin/image_picker',
               :f => f,
               :field => :image_id,
               :image => @image_slide.image,
               :toggle_image_display => false %>
  </div>

  <div class='field'>
    <%= f.label :caption %>
    <%= f.text_field :caption %>
  </div>

  <div class='field'>
    <%= f.label :link_url %>
    <%= f.text_field :link_url %>
  </div>

  <div class='field'>
    <%= f.label :body %>
    <%= f.text_area :body, :rows => 5, :class => 'widest wymeditor' -%>
  </div>
  <% delete_url = @image_slide.id ? refinery.image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, @image_slide) : nil %>

  <%= render '/refinery/admin/form_actions', :f => f,
             :continue_editing => false,
             :delete_title => t('delete', :scope => 'refinery.image_slideshows.admin.image_slides.image_slide'),
             :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @image_slide.title),
             :delete_url => delete_url,
             :cancel_url => refinery.image_slideshows_admin_image_slideshow_image_slides_path(@image_slideshow) %>
<% end %>