madwire/type_station

New collection view helper

madwire opened this issue · 1 comments

A way of repeating content (see dsl below) - should fit must use cases

Everything inside the ts_collection is inserted into a <script> tag as a template. The ts_new allows the user to add to the collection (js binds to that li)

%ul
  = ts_new collection: 'gallery_name', @page, :gallery_name, content_tag: :li do
    + Add
  = ts_collection @page, :gallery_name, content_tag: :li do
    .image
      = ts_editable @page, :image, type: :image do |image|
        = ts_image_tag(image.identifier, width: 200, height: 200, class: 'test', crop: :fill)
    .caption
      = ts_editable @page, :caption do
        Default Caption

After some thinking I'm not sure this is the way to go.