Sha256: 8c1036c007e776cdbc98b7c1567f0d0dafb4930261d013ec5f317859e4a45641

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

#
# ishapi / markers / _index
#

json.markers do
  json.array! markers do |marker|
    json.name marker.name
    json.slug marker.slug
    json.x    marker.x
    json.y    marker.y
    json.w    marker.w
    json.h    marker.h
    json.centerOffsetX  marker.centerOffsetX
    json.centerOffsetY  marker.centerOffsetY
    json.img_path       marker.image ? marker.image.image.url(:original) : image_missing
    json.title_img_path marker.title_image ? marker.title_image.image.url(:thumb) : image_missing
    json.item_type      marker.item_type
    json.url            marker.url

    ## @TODO: this is copy-pasted and should be abstracted.
    destination = marker.destination
    json.premium_tier destination.premium_tier
    json.id           destination.id.to_s
    if destination.is_premium
      json.premium_tier destination.premium_tier
      json.is_premium   destination.premium_tier > 0
      if current_user && current_user.profile
        json.is_purchased current_user.profile.has_premium_purchase( destination )
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ishapi-0.1.8.175 app/views/ishapi/markers/_index.jbuilder
ishapi-0.1.8.174 app/views/ishapi/markers/_index.jbuilder
ishapi-0.1.8.173 app/views/ishapi/markers/_index.jbuilder
ishapi-0.1.8.172 app/views/ishapi/markers/_index.jbuilder