ishapi 0.1.8.146 → 0.1.8.150
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 +4 -4
- data/app/controllers/ishapi/maps_controller.rb +6 -0
- data/app/controllers/ishapi/my/galleries_controller.rb +1 -2
- data/app/controllers/ishapi/my/{my_controller.rb → my_controller.rb-trash} +4 -2
- data/app/controllers/ishapi/users_controller.rb +18 -7
- data/app/views/ishapi/maps/_show.jbuilder +22 -0
- data/app/views/ishapi/maps/show.jbuilder +6 -14
- data/app/views/ishapi/markers/_index.jbuilder +20 -0
- data/app/views/ishapi/newsitems/_index.jbuilder +2 -2
- data/app/views/ishapi/sites/show.jbuilder +0 -2
- data/app/views/ishapi/{my/my/account.jbuilder → users/_account.jbuilder} +7 -1
- data/app/views/ishapi/users/account.jbuilder +2 -0
- data/app/views/ishapi/users/login.jbuilder +5 -0
- data/config/routes.rb +2 -2
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cac4c0f45c0f2c4a9b38b41270275390f3edda7d70678b73d4f09f33451f00a
|
4
|
+
data.tar.gz: 0c6aefe857915d2cb0732c180163d4b7191baba4258e84090ca4464634e23acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d23fede7459e5014c43b957f4bf8af5370d9d3eee4c208c19339fc9a66f597b96f6102f421af0f759da6cf131301820d2ad5f6576b0b8196af446cc15a9b223d
|
7
|
+
data.tar.gz: 5747e61ae8fcbdd13e37435d074dd9b3362050e275727bc6f18d7a417a6e1dc452f2b2f970432a96441b35fbb12e1e3954469e4140c461a20ef34d3dfc956d08
|
@@ -4,10 +4,12 @@ module Ishapi
|
|
4
4
|
|
5
5
|
before_action :check_profile, only: [ :show ]
|
6
6
|
|
7
|
+
=begin
|
7
8
|
def index
|
8
9
|
authorize! :index, ::Gameui::Map
|
9
10
|
@maps = ::Gameui::Map.all
|
10
11
|
end
|
12
|
+
=end
|
11
13
|
|
12
14
|
def show
|
13
15
|
@map = ::Gameui::Map.find_by slug: params[:slug]
|
@@ -21,12 +23,16 @@ module Ishapi
|
|
21
23
|
@markers = @markers.order_by( ordering: :asc )
|
22
24
|
end
|
23
25
|
|
26
|
+
# @TODO: move to models
|
24
27
|
if city = City.where( cityname: @map.slug ).first
|
25
28
|
@newsitems = city.newsitems
|
26
29
|
@galleries = city.galleries
|
27
30
|
@reports = city.reports
|
28
31
|
@videos = city.videos
|
29
32
|
end
|
33
|
+
|
34
|
+
puts! @map, 'prod map'
|
35
|
+
|
30
36
|
authorize! :show, @map
|
31
37
|
end
|
32
38
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
|
-
class Ishapi::My::GalleriesController < Ishapi::
|
2
|
+
class Ishapi::My::GalleriesController < Ishapi::ApplicationController
|
3
3
|
|
4
|
-
## expects params[:jwt_token]
|
5
4
|
def index
|
6
5
|
authorize! :my_index, Gallery
|
7
6
|
@galleries = @current_user.profile.galleries.unscoped.where( is_trash: false ).order_by( created_at: :desc ).limit(20)
|
@@ -3,19 +3,20 @@ module Ishapi
|
|
3
3
|
module My
|
4
4
|
class MyController < Ishapi::ApplicationController
|
5
5
|
|
6
|
-
# before_action :set_profile # this is DoS on FB - disabled
|
7
|
-
# before_action :do_login
|
8
6
|
before_action :check_profile
|
9
7
|
|
8
|
+
# @TODO: move to users_controller
|
10
9
|
def account
|
11
10
|
@profile = current_user&.profile
|
12
11
|
authorize! :show, @profile
|
12
|
+
render 'ishapi/users/account'
|
13
13
|
rescue CanCan::AccessDenied
|
14
14
|
render json: {
|
15
15
|
status: :not_ok,
|
16
16
|
}, status: 401
|
17
17
|
end
|
18
18
|
|
19
|
+
=begin
|
19
20
|
private
|
20
21
|
|
21
22
|
def do_login
|
@@ -33,6 +34,7 @@ module Ishapi
|
|
33
34
|
return
|
34
35
|
end
|
35
36
|
end
|
37
|
+
=end
|
36
38
|
|
37
39
|
end
|
38
40
|
end
|
@@ -2,9 +2,20 @@ require_dependency "ishapi/application_controller"
|
|
2
2
|
|
3
3
|
module Ishapi
|
4
4
|
class UsersController < ApplicationController
|
5
|
-
before_action :set_profile, :only => [ :fb_sign_in, :show ]
|
6
5
|
|
7
|
-
skip_authorization_check only: %i| login |
|
6
|
+
skip_authorization_check only: %i| fb_sign_in login |
|
7
|
+
|
8
|
+
before_action :check_profile, only: %i| account |
|
9
|
+
|
10
|
+
def account
|
11
|
+
@profile = current_user&.profile
|
12
|
+
authorize! :show, @profile
|
13
|
+
render 'ishapi/users/account'
|
14
|
+
rescue CanCan::AccessDenied
|
15
|
+
render json: {
|
16
|
+
status: :not_ok,
|
17
|
+
}, status: 401
|
18
|
+
end
|
8
19
|
|
9
20
|
def fb_sign_in
|
10
21
|
authorize! :fb_sign_in, Ishapi
|
@@ -12,10 +23,6 @@ module Ishapi
|
|
12
23
|
render :action => 'show'
|
13
24
|
end
|
14
25
|
|
15
|
-
def show
|
16
|
-
authorize! :fb_sign_in, Ishapi
|
17
|
-
end
|
18
|
-
|
19
26
|
def login
|
20
27
|
@current_user = User.where( email: params[:email] ).first
|
21
28
|
if !@current_user
|
@@ -27,12 +34,16 @@ module Ishapi
|
|
27
34
|
|
28
35
|
# send the jwt to client
|
29
36
|
@jwt_token = encode(user_id: @current_user.id.to_s)
|
37
|
+
@profile = @current_user.profile
|
38
|
+
|
39
|
+
=begin
|
30
40
|
render json: {
|
31
41
|
email: @current_user.email,
|
32
42
|
jwt_token: @jwt_token,
|
33
|
-
long_term_token: @long_term_token,
|
34
43
|
n_unlocks: @current_user.profile.n_unlocks,
|
35
44
|
}
|
45
|
+
=end
|
46
|
+
|
36
47
|
end
|
37
48
|
end
|
38
49
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# ishapi / maps / _show
|
3
|
+
#
|
4
|
+
|
5
|
+
this_key = [ map, params.permit! ]
|
6
|
+
json.cache! this_key do
|
7
|
+
json.map do
|
8
|
+
json.id map.id.to_s
|
9
|
+
json.slug map.slug
|
10
|
+
json.parent_slug map.parent_slug
|
11
|
+
json.description map.description
|
12
|
+
json.w map.w
|
13
|
+
json.h map.h
|
14
|
+
json.img_path map.image.image.url(:original)
|
15
|
+
json.updated_at map.updated_at
|
16
|
+
|
17
|
+
json.partial! 'ishapi/markers/index', map: map
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
@@ -11,9 +11,13 @@ json.cache! this_key do
|
|
11
11
|
json.description @map.description
|
12
12
|
json.w @map.w
|
13
13
|
json.h @map.h
|
14
|
-
json.img_path @map.
|
14
|
+
json.img_path @map.image.image.url(:original)
|
15
15
|
json.updated_at @map.updated_at
|
16
16
|
|
17
|
+
if @map.map
|
18
|
+
json.partial! 'ishapi/maps/show', map: @map.map
|
19
|
+
end
|
20
|
+
|
17
21
|
json.breadcrumbs do
|
18
22
|
json.array! @map.breadcrumbs do |b|
|
19
23
|
json.name b[:name]
|
@@ -22,19 +26,7 @@ json.cache! this_key do
|
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
25
|
-
json.markers
|
26
|
-
json.array! @markers do |marker|
|
27
|
-
json.name marker.name
|
28
|
-
json.slug marker.slug
|
29
|
-
json.x marker.x
|
30
|
-
json.y marker.y
|
31
|
-
json.w marker.w
|
32
|
-
json.h marker.h
|
33
|
-
json.img_path marker.img_path
|
34
|
-
json.title_img_path marker.title_img_path
|
35
|
-
json.item_type marker.item_type
|
36
|
-
end
|
37
|
-
end
|
29
|
+
json.partial! 'ishapi/markers/index', map: @map
|
38
30
|
|
39
31
|
if @newsitems
|
40
32
|
json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# ishapi / markers / _index
|
3
|
+
#
|
4
|
+
|
5
|
+
json.markers do
|
6
|
+
json.array! map.markers do |marker|
|
7
|
+
json.name marker.name
|
8
|
+
json.slug marker.slug
|
9
|
+
json.x marker.x
|
10
|
+
json.y marker.y
|
11
|
+
json.w marker.w
|
12
|
+
json.h marker.h
|
13
|
+
json.centerOffsetX marker.centerOffsetX
|
14
|
+
json.centerOffsetY marker.centerOffsetY
|
15
|
+
json.img_path marker.image.image.url(:original)
|
16
|
+
json.title_img_path marker.title_image.image.url(:thumb)
|
17
|
+
json.item_type marker.item_type
|
18
|
+
json.url marker.url
|
19
|
+
end
|
20
|
+
end
|
@@ -23,7 +23,7 @@ json.newsitems do
|
|
23
23
|
if item.gallery.is_premium
|
24
24
|
json.premium_tier item.gallery.premium_tier
|
25
25
|
json.is_premium item.gallery.premium_tier > 0
|
26
|
-
json.is_purchased current_user
|
26
|
+
json.is_purchased current_user&.profile&.has_premium_purchase( item.gallery )
|
27
27
|
json.partial! 'ishapi/photos/index', :photos => [ item.gallery.photos[0] ]
|
28
28
|
else
|
29
29
|
json.partial! 'ishapi/photos/index', :photos => item.gallery.photos
|
@@ -48,7 +48,7 @@ json.newsitems do
|
|
48
48
|
if item.report.is_premium
|
49
49
|
json.premium_tier item.report.premium_tier
|
50
50
|
json.is_premium item.report.premium_tier > 0
|
51
|
-
json.is_purchased current_user
|
51
|
+
json.is_purchased current_user&.profile&.has_premium_purchase( item.report )
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -13,8 +13,6 @@ json.cache! key do
|
|
13
13
|
json.subhead @site.subhead
|
14
14
|
json.description @site.description
|
15
15
|
|
16
|
-
json.email @current_user.email
|
17
|
-
|
18
16
|
json.is_ads_enabled @site.is_ads_enabled
|
19
17
|
json.play_videos_in_preview @site.play_videos_in_preview
|
20
18
|
json.newsitems_per_page @site.newsitems_per_page
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
|
+
|
2
3
|
json.name @profile.name
|
3
|
-
json.username @profile.username
|
4
|
+
# json.username @profile.username
|
4
5
|
json.email @profile.email
|
5
6
|
|
6
7
|
json.n_reports @profile.reports.count
|
@@ -14,3 +15,8 @@ if @profile.current_city
|
|
14
15
|
json.current_city @profile.current_city
|
15
16
|
end
|
16
17
|
|
18
|
+
json.bookmarks @profile.bookmarks do |b|
|
19
|
+
json.name b.name
|
20
|
+
json.slug b.slug
|
21
|
+
end
|
22
|
+
|
data/config/routes.rb
CHANGED
@@ -27,8 +27,8 @@ Ishapi::Engine.routes.draw do
|
|
27
27
|
get 'maps', to: 'maps#index'
|
28
28
|
get 'maps/view/:slug', to: 'maps#show'
|
29
29
|
get 'markers/view/:slug', to: 'maps#show_marker'
|
30
|
-
get "/my/account", to: "
|
31
|
-
post "/my/account", to: "
|
30
|
+
get "/my/account", to: "users#account"
|
31
|
+
post "/my/account", to: "users#account"
|
32
32
|
namespace :my do
|
33
33
|
get 'galleries', to: 'galleries#index'
|
34
34
|
get 'newsitems', to: 'newsitems#index'
|
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.150
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -206,7 +206,7 @@ files:
|
|
206
206
|
- app/controllers/ishapi/maps_controller.rb
|
207
207
|
- app/controllers/ishapi/measurements_controller.rb
|
208
208
|
- app/controllers/ishapi/my/galleries_controller.rb
|
209
|
-
- app/controllers/ishapi/my/my_controller.rb
|
209
|
+
- app/controllers/ishapi/my/my_controller.rb-trash
|
210
210
|
- app/controllers/ishapi/my/reports_controller.rb
|
211
211
|
- app/controllers/ishapi/my/videos_controller.rb
|
212
212
|
- app/controllers/ishapi/newsitems_controller.rb
|
@@ -247,10 +247,11 @@ files:
|
|
247
247
|
- app/views/ishapi/galleries/show.jbuilder
|
248
248
|
- app/views/ishapi/galleries/show_premium_locked.jbuilder
|
249
249
|
- app/views/ishapi/galleries/show_premium_unlocked.jbuilder
|
250
|
+
- app/views/ishapi/maps/_show.jbuilder
|
250
251
|
- app/views/ishapi/maps/index.jbuilder
|
251
252
|
- app/views/ishapi/maps/show.jbuilder
|
253
|
+
- app/views/ishapi/markers/_index.jbuilder
|
252
254
|
- app/views/ishapi/measurements/_show.jbuilder
|
253
|
-
- app/views/ishapi/my/my/account.jbuilder
|
254
255
|
- app/views/ishapi/my/videos/index.jbuilder
|
255
256
|
- app/views/ishapi/newsitems/_index.jbuilder
|
256
257
|
- app/views/ishapi/newsitems/index.jbuilder
|
@@ -268,7 +269,10 @@ files:
|
|
268
269
|
- app/views/ishapi/tags/index.jbuilder
|
269
270
|
- app/views/ishapi/tags/show.jbuilder
|
270
271
|
- app/views/ishapi/user_profiles/show.jbuilder
|
272
|
+
- app/views/ishapi/users/_account.jbuilder
|
271
273
|
- app/views/ishapi/users/_index.jbuilder
|
274
|
+
- app/views/ishapi/users/account.jbuilder
|
275
|
+
- app/views/ishapi/users/login.jbuilder
|
272
276
|
- app/views/ishapi/users/show.jbuilder
|
273
277
|
- app/views/ishapi/venues/_index.jbuilder
|
274
278
|
- app/views/ishapi/venues/index.jbuilder
|