Sha256: 9e66d21bf5e174412b8d09044286d953404323c9822878779c9a25e5e6bb2567

Contents?: true

Size: 1.29 KB

Versions: 111

Compression:

Stored size: 1.29 KB

Contents

#
# ishapi / reports / show
#

params.permit!
key = [ @report, params ]
json.cache! key do
  json.report do
    json.id          @report.id.to_s
    json.item_type   @report.class.name
    json.name        @report.name
    json.reportname  @report.slug # @TODO: @deprecated, remove
    json.slug        @report.slug
    if @report.photo
      json.photo_url   @report.photo.photo.url( :small )
      json.thumb_url   @report.photo.photo.url( :thumb )
    end

    # @TODO: move this to meta
    json.created_at  @report.created_at
    json.updated_at  @report.updated_at
    json.username    @report.user_profile.name if @report.user_profile
    json.subhead     @report.subhead

    case @report.item_type
    when 'wordpress'
      json.raw_json    JSON.parse(@report.raw_json)
    else
      json.description @report.descr
    end

    if @report.photo
      json.photo do
        json.thumb_url @report.photo.photo.url :thumb
        json.small_url @report.photo.photo.url :small
        json.large_url @report.photo.photo.url :large
      end
    end
  end

  # @deprecated, but specs use this _vp_ 20180423
  if @report.photo
    json.photo do
      json.thumb_url @report.photo.photo.url :thumb
      json.small_url @report.photo.photo.url :small
      json.large_url @report.photo.photo.url :large
    end
  end

end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
ishapi-0.1.8.316 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.315 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.314 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.313 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.312 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.310 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.309 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.308 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.307 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.306 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.305 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.304 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.303 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.302 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.301 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.300 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.298 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.297 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.296 app/views/ishapi/reports/show.jbuilder
ishapi-0.1.8.295 app/views/ishapi/reports/show.jbuilder