ishapi 0.1.8.189 → 0.1.8.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7b88652fb9949a0f69a25a7a2972f569ebeb2353014464aee3622de87c0ba5f
4
- data.tar.gz: 175c76708f9cd360743a0752d22dcb8fc2a47dcc022e4ea1be7bec30044b5d97
3
+ metadata.gz: f891100a3a85dcf7b3b9dfaae2582cbd897c62707c8a461cb7db2028180a3746
4
+ data.tar.gz: 2a8abf11cff24eb963e1a58c09e97521c5bfbdc0b5e2b2f71a7f1ae9f4a9a18a
5
5
  SHA512:
6
- metadata.gz: 5b16b8d679909aea31a2bf1fefd6e325b350d8f3acf326190e595c4aab8a229cab56a9f5914c9603cd21fa94501362c8507ef8f0d6584ace1d5f187db2fa5b78
7
- data.tar.gz: ca30eabd8eeb8f25476f2ee400ce1a278e6e738bc5bf28714da8caeeeca700c12906c48211e3b51d2520f6a997561dc9891211f0378eb678cd5264f645da276a
6
+ metadata.gz: 4b450ae541f0ccb3a85865af3c3fd41133cc280b20985c002a87756b7ea4dad7063546237a2c3dd6c4f4f15be05003e361141768b9b7f6ed56736d02dbc73c81
7
+ data.tar.gz: bee01f4ad4dc3715fffebe4f18894333df46141c923347ef1fcff0eb6cbd5eeef5115fe105313ddd738fcb17f5deef12d5203d82c879f4142d731560f53e28a4
@@ -10,7 +10,9 @@ class Ishapi::MapsController < Ishapi::ApplicationController
10
10
  @map = @location.map || @location
11
11
 
12
12
  authorize! :show, @map
13
- @newsitems = @location.newsitems
13
+
14
+ @newsitems = @location.newsitems.page( params[:newsitems_page]
15
+ ).per( @location.newsitems_page_size )
14
16
 
15
17
  @markers = @map.markers.permitted_to(@current_user.profile).order_by(ordering: :asc)
16
18
 
@@ -0,0 +1,11 @@
1
+
2
+ ## From: https://gist.github.com/be9/6446051
3
+
4
+ current, total, per_page = collection.current_page, collection.total_pages, collection.limit_value
5
+
6
+ json.current current
7
+ json.previous (current > 1 ? (current - 1) : nil)
8
+ json.next (current == total ? nil : (current + 1))
9
+ json.per_page per_page
10
+ json.pages total
11
+ json.count collection.total_count
@@ -14,7 +14,7 @@ json.cache! this_key do
14
14
  json.h map.h
15
15
  json.x map.x
16
16
  json.y map.y
17
- json.map_type map.map_type
17
+ # json.map_type map.map_type
18
18
  json.img_path map.image.image.url(:original)
19
19
  json.updated_at map.updated_at
20
20
  json.rated map.rated
@@ -19,14 +19,15 @@ json.markers do
19
19
  json.asset3d_path marker.asset3d ? marker.asset3d.object.url : ''
20
20
 
21
21
  ## @TODO: this is copy-pasted and should be abstracted.
22
- destination = marker.destination
23
- json.destination_slug destination.slug
24
- json.premium_tier destination.premium_tier
25
- json.is_premium destination.is_premium
26
- json.id destination.id.to_s
27
- if destination.is_premium
28
- if current_user && current_user.profile
29
- json.is_purchased current_user.profile.has_premium_purchase( destination )
22
+ if destination = marker.destination
23
+ json.destination_slug destination.slug
24
+ json.premium_tier destination.premium_tier
25
+ json.is_premium destination.is_premium
26
+ json.id destination.id.to_s
27
+ if destination.is_premium
28
+ if current_user && current_user.profile
29
+ json.is_purchased current_user.profile.has_premium_purchase( destination )
30
+ end
30
31
  end
31
32
  end
32
33
 
@@ -2,8 +2,11 @@
2
2
  # ishapi / newsitems / _index
3
3
  #
4
4
 
5
- json.n_newsitems newsitems.count
5
+ json.newsitems_pagination do
6
+ json.partial! "ishapi/application/pagination", collection: newsitems
7
+ end
6
8
  json.newsitems do
9
+
7
10
  json.array! newsitems do |item|
8
11
  json.newsitem_id item.id.to_s
9
12
  json.name item.name
@@ -46,7 +49,6 @@ json.newsitems do
46
49
  json.id item.report_id.to_s
47
50
  json.item_type item.report.class.name
48
51
  json.name item.report.name
49
- json.reportname item.report.slug # @TODO: @deprecated, remove
50
52
  json.slug item.report.slug
51
53
  json.subhead item.report.subhead
52
54
  json.username item.report.user_profile.name if item.report.user_profile
@@ -23,7 +23,13 @@ json.cache! key do
23
23
  json.username @report.user_profile.name if @report.user_profile
24
24
  json.cityname @report.city.cityname if @report.city
25
25
  json.subhead @report.subhead
26
- json.description @report.descr
26
+
27
+ case @report.item_type
28
+ when 'wordpress'
29
+ json.raw_json JSON.parse(@report.raw_json)
30
+ else
31
+ json.description @report.descr
32
+ end
27
33
 
28
34
  if @report.photo
29
35
  json.photo do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.189
4
+ version: 0.1.8.190
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-18 00:00:00.000000000 Z
11
+ date: 2022-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -299,6 +299,7 @@ files:
299
299
  - app/models/ishapi/ability.rb
300
300
  - app/views/ishapi/addresses/_show.jbuilder
301
301
  - app/views/ishapi/application/_meta.jbuilder
302
+ - app/views/ishapi/application/_pagination.jbuilder
302
303
  - app/views/ishapi/articles/_form.html.erb
303
304
  - app/views/ishapi/articles/edit.html.erb
304
305
  - app/views/ishapi/articles/index.html.erb