Skip to content

Commit

Permalink
Public API, expose place > date_with_qualifier to layer and map level…
Browse files Browse the repository at this point in the history
…, add layer_title and color to place API
  • Loading branch information
ut committed Oct 30, 2024
1 parent 465ccfa commit 6cf3475
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/public/layers/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ json.layer do
json.array! @places do |place|
next unless place.published

json.call(place, :id, :uid, :title, :subtitle, :teaser, :text, :sources, :link, :imagelink, :imagelink2, :audiolink, :published, :startdate, :enddate, :startdate_qualifier, :enddate_qualifier, :location, :address, :zip, :city, :text, :country, :featured, :layer_id, :icon_link, :icon_class, :icon_name)
json.call(place, :id, :uid, :title, :subtitle, :teaser, :text, :sources, :link, :imagelink, :imagelink2, :audiolink, :published, :date_with_qualifier, :startdate, :enddate, :startdate_qualifier, :enddate_qualifier, :location, :address, :zip, :city, :text, :country, :featured, :layer_id, :icon_link, :icon_class, :icon_name)
json.lat place.public_lat
json.lon place.public_lon
json.annotations place.annotations do |annotation|
Expand Down
2 changes: 1 addition & 1 deletion app/views/public/maps/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ json.map do
json.array! layer.places.published do |place|
next unless place.published

json.call(place, :id, :uid, :title, :subtitle, :teaser, :text, :sources, :link, :imagelink, :imagelink2, :audiolink, :published, :startdate, :enddate, :location, :address, :zip, :city, :text, :country, :featured, :shy, :layer_id, :icon_link, :icon_class, :icon_name)
json.call(place, :id, :uid, :title, :subtitle, :teaser, :text, :sources, :link, :imagelink, :imagelink2, :audiolink, :published, :date_with_qualifier, :startdate, :enddate, :location, :address, :zip, :city, :text, :country, :featured, :shy, :layer_id, :icon_link, :icon_class, :icon_name)
json.lat place.public_lat
json.lon place.public_lon
json.annotations place.annotations do |annotation|
Expand Down
2 changes: 1 addition & 1 deletion app/views/public/places/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
json.place do
next unless @place.published

json.call(@place, :id, :uid, :title, :subtitle, :teaser, :text, :sources, :link, :imagelink, :imagelink2, :audiolink, :published, :date, :date_with_qualifier, :startdate, :enddate, :startdate_qualifier, :enddate_qualifier, :location, :address, :zip, :city, :text, :country, :featured, :layer_id, :icon_link, :icon_class, :icon_name)
json.call(@place, :id, :uid, :title, :subtitle, :teaser, :text, :sources, :link, :imagelink, :imagelink2, :audiolink, :published, :date, :date_with_qualifier, :startdate, :enddate, :startdate_qualifier, :enddate_qualifier, :location, :address, :zip, :city, :text, :country, :featured, :layer_id, :layer_title, :color, :icon_link, :icon_class, :icon_name)
end
11 changes: 11 additions & 0 deletions spec/support/api/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
"imagelink2",
"audiolink",
"published",
"date_with_qualifier",
"startdate",
"enddate",
"lat",
Expand Down Expand Up @@ -398,6 +399,16 @@
true
]
},
"date_with_qualifier":{
"$id":"#/properties/map/properties/layer/items/properties/places/items/properties/date_with_qualifier",
"type":["string", "null"],
"title":"The date_with_qualifier Schema",
"default":"",
"examples":[
"ca. 1980 - 2000"
],
"pattern":"^(.*)$"
},
"startdate":{
"$id":"#/properties/map/properties/layer/items/properties/places/items/properties/startdate",
"type":["string", "null"],
Expand Down

0 comments on commit 6cf3475

Please sign in to comment.