ishapi 0.1.8.190 → 0.1.8.191
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6810b728f6c15f3cbe1033a35e6f63bf46fa5407b6949195b838423862c2f7a9
|
4
|
+
data.tar.gz: 50353e0c352130b314da53a9a250aaed054c28af118dc9c53e233ed5f8b7a99b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee30b8a0815c5eecf6c9e8bd74896212c7006e85083982fc44831b3228bee1837c2336ddf17fef4a73e108b0cf2446bd6a149b529b3549a90c972b3d0bd3a116
|
7
|
+
data.tar.gz: 2f1836cd62c6d6cb1351dfb6022b9a803dcf92c8f4dca78735e951035deb8f7541d24f004b82f4a27950553349ec6eb61bfc0dad2f09f879996617d33001f4e4
|
@@ -15,9 +15,6 @@ class Ishapi::MapsController < Ishapi::ApplicationController
|
|
15
15
|
).per( @location.newsitems_page_size )
|
16
16
|
|
17
17
|
@markers = @map.markers.permitted_to(@current_user.profile).order_by(ordering: :asc)
|
18
|
-
|
19
|
-
@tags = @map.tags
|
20
|
-
|
21
18
|
# case @map.ordering_type
|
22
19
|
# when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
|
23
20
|
# @markers = @markers.order_by( name: :asc )
|
@@ -25,6 +22,15 @@ class Ishapi::MapsController < Ishapi::ApplicationController
|
|
25
22
|
# @markers = @markers.order_by( ordering: :asc )
|
26
23
|
# end
|
27
24
|
|
25
|
+
@tags = @map.tags
|
26
|
+
|
27
|
+
if @map.is_premium && !@current_user.profile.has_premium_purchase( @map )
|
28
|
+
render 'show_restricted'
|
29
|
+
else
|
30
|
+
render 'show'
|
31
|
+
end
|
32
|
+
|
33
|
+
|
28
34
|
end
|
29
35
|
|
30
36
|
def show_marker
|
@@ -12,15 +12,17 @@ json.cache! this_key do
|
|
12
12
|
json.description map.description
|
13
13
|
json.w map.w
|
14
14
|
json.h map.h
|
15
|
-
json.x map.x
|
16
|
-
json.y map.y
|
15
|
+
# json.x map.x
|
16
|
+
# json.y map.y
|
17
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
|
21
21
|
json.name map.name
|
22
|
+
|
22
23
|
json.premium_tier map.premium_tier
|
23
24
|
json.is_premium map.is_premium
|
25
|
+
json.is_purchased current_user&.profile&.has_premium_purchase( map )
|
24
26
|
|
25
27
|
json.breadcrumbs do
|
26
28
|
json.array! map.breadcrumbs do |b|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# ishapi / maps / show_restricted
|
3
|
+
#
|
4
|
+
map = @map
|
5
|
+
|
6
|
+
this_key = [ map.id, map.updated_at ]
|
7
|
+
json.cache! this_key do
|
8
|
+
|
9
|
+
json.map do
|
10
|
+
json.id map.id.to_s
|
11
|
+
json.slug map.slug
|
12
|
+
json.parent_slug map.parent_slug
|
13
|
+
json.updated_at map.updated_at
|
14
|
+
json.rated map.rated
|
15
|
+
json.name map.name
|
16
|
+
json.premium_tier map.premium_tier
|
17
|
+
json.is_premium map.is_premium
|
18
|
+
|
19
|
+
json.breadcrumbs do
|
20
|
+
json.array! map.breadcrumbs do |b|
|
21
|
+
json.name b[:name]
|
22
|
+
json.slug b[:slug]
|
23
|
+
json.link b[:link]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
## _vp_ 2021-10-14 I removed json parsing from here!
|
28
|
+
## _vp_ 2021-10-19 I added json parsing here!
|
29
|
+
## _vp_ 2022-09-13 Must use my own config, example: 3D -> geodesic. Parent is MapPanelNoZoom, but self is ThreePanelV1
|
30
|
+
## Maybe it's if map_slug is present, rather than parent_slug?
|
31
|
+
if map.map_slug.present?
|
32
|
+
json.config JSON.parse map.map.config
|
33
|
+
json.labels JSON.parse map.map.labels
|
34
|
+
else
|
35
|
+
json.config JSON.parse map.config
|
36
|
+
json.labels JSON.parse map.labels
|
37
|
+
end
|
38
|
+
|
39
|
+
# json.map({ config: {} })
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
@@ -5,7 +5,6 @@
|
|
5
5
|
json.markers do
|
6
6
|
json.array! markers do |marker|
|
7
7
|
json.name marker.name
|
8
|
-
json.slug marker.slug
|
9
8
|
json.x marker.x
|
10
9
|
json.y marker.y
|
11
10
|
json.w marker.w
|
@@ -20,10 +19,11 @@ json.markers do
|
|
20
19
|
|
21
20
|
## @TODO: this is copy-pasted and should be abstracted.
|
22
21
|
if destination = marker.destination
|
23
|
-
json.destination_slug destination.slug
|
24
|
-
json.
|
25
|
-
json.
|
26
|
-
json.
|
22
|
+
json.destination_slug destination.slug # @TODO: this looks obsolete, if I'm using slug instead. _vp_ 2022-09-23
|
23
|
+
json.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
27
|
if destination.is_premium
|
28
28
|
if current_user && current_user.profile
|
29
29
|
json.is_purchased current_user.profile.has_premium_purchase( destination )
|
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.
|
4
|
+
version: 0.1.8.191
|
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-
|
11
|
+
date: 2022-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -327,6 +327,7 @@ files:
|
|
327
327
|
- app/views/ishapi/maps/_show_lite.jbuilder-trash
|
328
328
|
- app/views/ishapi/maps/index.jbuilder
|
329
329
|
- app/views/ishapi/maps/show.jbuilder
|
330
|
+
- app/views/ishapi/maps/show_restricted.jbuilder
|
330
331
|
- app/views/ishapi/markers/_index.jbuilder
|
331
332
|
- app/views/ishapi/my/videos/index.jbuilder
|
332
333
|
- app/views/ishapi/newsitems/_index.jbuilder
|