ishapi 0.1.8.187 → 0.1.8.189

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: 5b91bea724899fddcf337cc42d851e504a800c2e13dd89fa6089c9c4389e488f
4
- data.tar.gz: 97329cc032016ef06d074c52630b00a581e0ac01f544049872141184fa731656
3
+ metadata.gz: e7b88652fb9949a0f69a25a7a2972f569ebeb2353014464aee3622de87c0ba5f
4
+ data.tar.gz: 175c76708f9cd360743a0752d22dcb8fc2a47dcc022e4ea1be7bec30044b5d97
5
5
  SHA512:
6
- metadata.gz: 884d13540d009af213e8737ec76952c934657f63f71c4a2b5ff257ab633aceb76c0853443869defaa3f0fe24cacc0f67e18f53c7d99e9875de94705145d4a08a
7
- data.tar.gz: '0148e6510d6afcc9b54201482dcc09b815076ff78bad90230debfff9a2570df29f37ead0586cd5c0ee5c638c10390134a9105203036b6c4052af983869b7dfe6'
6
+ metadata.gz: 5b16b8d679909aea31a2bf1fefd6e325b350d8f3acf326190e595c4aab8a229cab56a9f5914c9603cd21fa94501362c8507ef8f0d6584ace1d5f187db2fa5b78
7
+ data.tar.gz: ca30eabd8eeb8f25476f2ee400ce1a278e6e738bc5bf28714da8caeeeca700c12906c48211e3b51d2520f6a997561dc9891211f0378eb678cd5264f645da276a
@@ -12,7 +12,7 @@ class Ishapi::MapsController < Ishapi::ApplicationController
12
12
  authorize! :show, @map
13
13
  @newsitems = @location.newsitems
14
14
 
15
- @markers = @map.markers.permitted_to(@current_user.profile)
15
+ @markers = @map.markers.permitted_to(@current_user.profile).order_by(ordering: :asc)
16
16
 
17
17
  @tags = @map.tags
18
18
 
@@ -23,14 +23,6 @@ class Ishapi::MapsController < Ishapi::ApplicationController
23
23
  # @markers = @markers.order_by( ordering: :asc )
24
24
  # end
25
25
 
26
- # ## @TODO: figure this out eventually
27
- # if city = City.where( cityname: @map.slug ).first
28
- # # @newsitems = city.newsitems
29
- # @galleries = city.galleries
30
- # @reports = city.reports
31
- # @videos = city.videos
32
- # end
33
-
34
26
  end
35
27
 
36
28
  def show_marker
@@ -10,6 +10,7 @@ class Ishapi::Users::SessionsController < Devise::SessionsController
10
10
  # respond_with resource, location: after_sign_in_path_for(resource)
11
11
 
12
12
  ## Send the jwt to client
13
+ @current_user = resource
13
14
  @jwt_token = encode(user_id: @current_user.id.to_s)
14
15
  @profile = @current_user.profile
15
16
  render 'ishapi/users/login', format: :json, layout: false
@@ -2,31 +2,60 @@
2
2
  # ishapi / maps / _show
3
3
  #
4
4
 
5
- ## @TODO: make sure that _show.jbuilder and show.jbuilder are reasonably deduped
6
-
7
- this_key = [ map.id, map.updated_at, params.permit! ]
5
+ this_key = [ map.id, map.updated_at ]
8
6
  json.cache! this_key do
7
+
9
8
  json.map do
10
- json.id map.id.to_s
11
- json.slug map.slug
12
- json.parent_slug map.parent_slug
13
- json.description map.description
14
- json.w map.w
15
- json.h map.h
16
- json.img_path map.image.image.url(:original)
17
- json.updated_at map.updated_at
18
- json.rated map.rated
19
-
20
- json.partial! 'ishapi/markers/index', map: map
21
-
22
- ## I removed json parsing from here! _vp_ 2021-10-14
23
- ## I added json parsing here! _vo_ 2021-10-19
24
- if map.parent_slug.present?
25
- json.config JSON.parse @map.parent.config
26
- json.labels JSON.parse @map.parent.labels
9
+ json.id map.id.to_s
10
+ json.slug map.slug
11
+ json.parent_slug map.parent_slug
12
+ json.description map.description
13
+ json.w map.w
14
+ json.h map.h
15
+ json.x map.x
16
+ json.y map.y
17
+ json.map_type map.map_type
18
+ json.img_path map.image.image.url(:original)
19
+ json.updated_at map.updated_at
20
+ json.rated map.rated
21
+ json.name map.name
22
+ json.premium_tier map.premium_tier
23
+ json.is_premium map.is_premium
24
+
25
+ json.breadcrumbs do
26
+ json.array! map.breadcrumbs do |b|
27
+ json.name b[:name]
28
+ json.slug b[:slug]
29
+ json.link b[:link]
30
+ end
31
+ end
32
+
33
+ if markers
34
+ json.partial! 'ishapi/markers/index', markers: markers
35
+ end
36
+
37
+ if newsitems
38
+ json.partial! 'ishapi/newsitems/index', newsitems: newsitems
39
+ end
40
+
41
+ if tags
42
+ json.partial! 'ishapi/tags/index', tags: tags
43
+ end
44
+
45
+ if map.map
46
+ json.partial! 'ishapi/maps/show', map: map.map
47
+ end
48
+
49
+ ## _vp_ 2021-10-14 I removed json parsing from here!
50
+ ## _vp_ 2021-10-19 I added json parsing here!
51
+ ## _vp_ 2022-09-13 Must use my own config, example: 3D -> geodesic. Parent is MapPanelNoZoom, but self is ThreePanelV1
52
+ ## Maybe it's if map_slug is present, rather than parent_slug?
53
+ if map.map_slug.present?
54
+ json.config JSON.parse map.map.config
55
+ json.labels JSON.parse map.map.labels
27
56
  else
28
- json.config JSON.parse @map.config
29
- json.labels JSON.parse @map.labels
57
+ json.config JSON.parse map.config
58
+ json.labels JSON.parse map.labels
30
59
  end
31
60
 
32
61
  end
@@ -0,0 +1,16 @@
1
+
2
+ ##
3
+ ## @deprecated? I've never used this. _vp_ 2022-09-06
4
+ ##
5
+
6
+ json.map do
7
+ json.id map.id.to_s
8
+ json.slug map.slug
9
+ json.parent_slug map.parent_slug
10
+ json.description map.description
11
+ json.w map.w
12
+ json.h map.h
13
+ json.img_path map.image.image.url(:original)
14
+ json.updated_at map.updated_at
15
+ json.rated map.rated
16
+ end
@@ -2,63 +2,5 @@
2
2
  # ishapi / maps / show
3
3
  #
4
4
 
5
- # this_key = [
6
- # @map.id, @map.updated_at,
7
- # current_user&.profile&.updated_at,
8
- # params.permit!
9
- # ]
10
- # json.cache! this_key do
11
- json.map do
12
- json.id @map.id.to_s
13
- json.slug @map.slug
14
- json.parent_slug @map.parent_slug
15
- json.description @map.description
16
- json.w @map.w
17
- json.h @map.h
18
- json.img_path @map.image ? @map.image.image.url(:original) : image_missing
19
- json.updated_at @map.updated_at
20
- json.rated @map.rated
21
-
22
- if @map.is_premium
23
- json.premium_tier @map.premium_tier
24
- json.is_premium @map.premium_tier > 0
25
- json.is_purchased current_user&.profile&.has_premium_purchase( @map )
26
- end
27
-
28
- if @map.map
29
- json.partial! 'ishapi/maps/show', map: @map.map
30
- json.config JSON.parse @map.parent.config
31
- json.labels JSON.parse @map.parent.labels
32
- json.partial! 'ishapi/markers/index', markers: @markers
33
- else
34
- ## I removed json parsing from here! _vp_ 2021-10-14
35
- ## I added json parsing here, and is seems right. _vp_ 2021-10-19
36
- json.config JSON.parse @map.config
37
- json.labels JSON.parse @map.labels
38
- json.partial! 'ishapi/markers/index', markers: @markers
39
- end
40
-
41
- json.breadcrumbs do
42
- json.array! @map.breadcrumbs do |b|
43
- json.name b[:name]
44
- json.slug b[:slug]
45
- json.link b[:link]
46
- end
47
- end
48
-
49
- if @newsitems
50
- json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
51
- end
52
-
53
- if @galleries
54
- json.partial! 'ishapi/galleries/index', galleries: @galleries
55
- end
56
-
57
- if @tags
58
- json.partial! 'ishapi/tags/index', tags: @tags
59
- end
60
-
61
- end
62
- # end
63
-
5
+ json.partial! 'ishapi/maps/show', map: @map, markers: @markers, newsitems: @newsitems, tags: @tags
64
6
 
@@ -20,6 +20,7 @@ json.markers do
20
20
 
21
21
  ## @TODO: this is copy-pasted and should be abstracted.
22
22
  destination = marker.destination
23
+ json.destination_slug destination.slug
23
24
  json.premium_tier destination.premium_tier
24
25
  json.is_premium destination.is_premium
25
26
  json.id destination.id.to_s
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.187
4
+ version: 0.1.8.189
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-04 00:00:00.000000000 Z
11
+ date: 2022-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -323,6 +323,7 @@ files:
323
323
  - app/views/ishapi/mailer/reset_password_instructions.html.erb
324
324
  - app/views/ishapi/mailer/unlock_instructions.html.erb
325
325
  - app/views/ishapi/maps/_show.jbuilder
326
+ - app/views/ishapi/maps/_show_lite.jbuilder-trash
326
327
  - app/views/ishapi/maps/index.jbuilder
327
328
  - app/views/ishapi/maps/show.jbuilder
328
329
  - app/views/ishapi/markers/_index.jbuilder