ishapi 0.1.8.149 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cd7a53ae8d95d217a973a346a43735501330d08ff96705fe24ebf42014a10ba
4
- data.tar.gz: 1d85e34875c2f3c3b026e92eda83e21d4a4409aada61d57cbd9bf3c547c08c02
3
+ metadata.gz: 1cac4c0f45c0f2c4a9b38b41270275390f3edda7d70678b73d4f09f33451f00a
4
+ data.tar.gz: 0c6aefe857915d2cb0732c180163d4b7191baba4258e84090ca4464634e23acd
5
5
  SHA512:
6
- metadata.gz: 629a76c8e71f990c024cc5968ab41572216d852c73ababc8101327e74dceb998a28a3a480c8a9d657aa4c8cbe531400b8859830e0d8a5ca853fa2510cd36ee9b
7
- data.tar.gz: 89da2fef64a91d1560b6a76da8403573ad43978fe22da94a4385c014e74ed5aa36da38a58380f0a00397d97ace7062756eee3473611a8eef1e0aa915943510c6
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::My::MyController
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
 
@@ -11,22 +11,10 @@ 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.img_path
14
+ json.img_path map.image.image.url(:original)
15
15
  json.updated_at map.updated_at
16
16
 
17
- json.markers do
18
- json.array! map.markers do |marker|
19
- json.name marker.name
20
- json.slug marker.slug
21
- json.x marker.x
22
- json.y marker.y
23
- json.w marker.w
24
- json.h marker.h
25
- json.img_path marker.img_path
26
- json.title_img_path marker.title_img_path
27
- json.item_type marker.item_type
28
- end
29
- end
17
+ json.partial! 'ishapi/markers/index', map: map
30
18
 
31
19
  end
32
20
  end
@@ -11,7 +11,7 @@ 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.img_path
14
+ json.img_path @map.image.image.url(:original)
15
15
  json.updated_at @map.updated_at
16
16
 
17
17
  if @map.map
@@ -26,19 +26,7 @@ json.cache! this_key do
26
26
  end
27
27
  end
28
28
 
29
- json.markers do
30
- json.array! @markers do |marker|
31
- json.name marker.name
32
- json.slug marker.slug
33
- json.x marker.x
34
- json.y marker.y
35
- json.w marker.w
36
- json.h marker.h
37
- json.img_path marker.img_path
38
- json.title_img_path marker.title_img_path
39
- json.item_type marker.item_type
40
- end
41
- end
29
+ json.partial! 'ishapi/markers/index', map: @map
42
30
 
43
31
  if @newsitems
44
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
@@ -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
+
@@ -0,0 +1,2 @@
1
+
2
+ json.partial! 'account'
@@ -0,0 +1,5 @@
1
+
2
+ json.email @profile.email
3
+ json.n_unlocks @profile.n_unlocks
4
+ json.jwt_token @jwt_token
5
+ json.partial! 'account'
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: "my/my#account"
31
- post "/my/account", to: "my/my#account"
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.149
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-17 00:00:00.000000000 Z
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
@@ -250,8 +250,8 @@ files:
250
250
  - app/views/ishapi/maps/_show.jbuilder
251
251
  - app/views/ishapi/maps/index.jbuilder
252
252
  - app/views/ishapi/maps/show.jbuilder
253
+ - app/views/ishapi/markers/_index.jbuilder
253
254
  - app/views/ishapi/measurements/_show.jbuilder
254
- - app/views/ishapi/my/my/account.jbuilder
255
255
  - app/views/ishapi/my/videos/index.jbuilder
256
256
  - app/views/ishapi/newsitems/_index.jbuilder
257
257
  - app/views/ishapi/newsitems/index.jbuilder
@@ -269,7 +269,10 @@ files:
269
269
  - app/views/ishapi/tags/index.jbuilder
270
270
  - app/views/ishapi/tags/show.jbuilder
271
271
  - app/views/ishapi/user_profiles/show.jbuilder
272
+ - app/views/ishapi/users/_account.jbuilder
272
273
  - app/views/ishapi/users/_index.jbuilder
274
+ - app/views/ishapi/users/account.jbuilder
275
+ - app/views/ishapi/users/login.jbuilder
273
276
  - app/views/ishapi/users/show.jbuilder
274
277
  - app/views/ishapi/venues/_index.jbuilder
275
278
  - app/views/ishapi/venues/index.jbuilder