Sha256: a8c447948e1064bd5e8a85bae63a4371176ad7ca0c342a53b059c514c71fa000

Contents?: true

Size: 1.46 KB

Versions: 8

Compression:

Stored size: 1.46 KB

Contents

#
# ishapi / newsitems / _index
#

json.n_newsitems newsitems.count
json.newsitems do
  json.array! newsitems do |item|
    json.created_at item.created_at
    json.descr item.descr
    json.name      item.name
    
    if item.gallery
      json.item_type  'gallery' #@TODO: should be a constant
      json.name        item.gallery.name
      json.galleryname item.gallery.galleryname
     
      json.partial!    'ishapi/application/meta', :item => item.gallery
      json.partial!    'ishapi/photos/index',     :photos => item.gallery.photos.limit( 6 )
    end
    if item.report
      json.item_type  'report'
      json.name       item.report.name
      json.reportname item.report.name_seo
      json.descr      item.report.subhead
      json.report_id  item.report_id.to_s
      json.username   item.report.user_profile.name if item.report.user_profile
      if item.report.photo
        json.photo_url item.report.photo.photo.url( :small ) 
        json.thumb_url item.report.photo.photo.url( :thumb )
      end
    end
    
    if item.video
      json.partial! 'ishapi/videos/show', :video => item.video
      
      json.item_type  'video'
      json.name       item.video.name
      json.descr      item.video.descr
      json.x          item.video.x
      json.y          item.video.y
      json.youtube_id item.video.youtube_id
    end
    if item.photo
      json.item_type 'photo'
      json.partial! 'ishapi/photos/index', :photos => [ item.photo ]
    end
    
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ishapi-0.1.8.55 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.54 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.53 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.52 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.49 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.48 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.47 app/views/ishapi/newsitems/_index.jbuilder
ishapi-0.1.8.46 app/views/ishapi/newsitems/_index.jbuilder