Sha256: 5c57eed237e6fdb4c747ee5197665c441b8126f7bae43bf1a6368a2046234280

Contents?: true

Size: 1.12 KB

Versions: 10

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

json.links do
  json.self url_for(search_state.to_h.merge(only_path: false))
  json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
  json.next url_for(search_state.to_h.merge(only_path: false, page: @response.next_page.to_s)) if @response.next_page
  json.last url_for(search_state.to_h.merge(only_path: false, page: @response.total_pages.to_s))
end

json.meta do
  json.pages @presenter.pagination_info
end

json.data do
  json.array! @presenter.documents do |document|
    json.id document.id
  end
end

json.included do
  json.array! search_fields do |(label, key)|
    json.type "search_field"
    json.id key
    json.attributes do
      json.label label
    end
    json.links do
      json.self url_for(search_state.to_h.merge(search_field: key, only_path: false))
    end
  end

  json.array! active_sort_fields do |key, field|
    json.type "sort"
    json.id key
    json.attributes do
      json.label field.label
    end
    json.links do
      json.self url_for(search_state.to_h.merge(sort: key, only_path: false))
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
geoblacklight_admin-0.5.1 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.5.0 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.4.2 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.4.1 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.4.0 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.3.2 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.3.1 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.3.0 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.2.1 app/views/admin/ids/index.json.jbuilder
geoblacklight_admin-0.1.0 app/views/admin/ids/index.json.jbuilder