ishapi 0.1.8.194 → 0.1.8.195

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -3
  3. data/app/controllers/ishapi/application_controller.rb +12 -14
  4. data/app/controllers/ishapi/galleries_controller.rb +0 -4
  5. data/app/controllers/ishapi/maps_controller.rb +2 -6
  6. data/app/controllers/ishapi/users/registrations_controller.rb +1 -1
  7. data/app/controllers/ishapi/users/sessions_controller.rb +3 -3
  8. data/app/controllers/ishapi/users_controller.rb +32 -34
  9. data/app/controllers/ishapi/videos_controller.rb +0 -9
  10. data/app/helpers/ishapi/application_helper.rb +1 -1
  11. data/app/models/ishapi/ability.rb +8 -25
  12. data/app/views/ishapi/application/_meta.jbuilder +0 -10
  13. data/app/views/ishapi/galleries/_show.jbuilder +1 -1
  14. data/app/views/ishapi/galleries/index.jbuilder +1 -4
  15. data/app/views/ishapi/maps/_show.jbuilder +1 -5
  16. data/app/views/ishapi/maps/show.jbuilder +1 -1
  17. data/app/views/ishapi/markers/_index.jbuilder +2 -2
  18. data/app/views/ishapi/newsitems/_index.jbuilder +4 -4
  19. data/app/views/ishapi/reports/_index.jbuilder +0 -2
  20. data/app/views/ishapi/reports/show.jbuilder +0 -3
  21. data/app/views/ishapi/user_profiles/_account.jbuilder +21 -0
  22. data/app/views/ishapi/{users → user_profiles}/_index.jbuilder +0 -0
  23. data/app/views/ishapi/user_profiles/account.jbuilder +2 -0
  24. data/app/views/ishapi/user_profiles/login.jbuilder +5 -0
  25. data/app/views/ishapi/user_profiles/show.jbuilder +0 -4
  26. data/app/views/ishapi/{users/show.jbuilder → user_profiles/show.jbuilder-bk} +1 -4
  27. data/app/views/ishapi/videos/_show.jbuilder +2 -10
  28. data/config/routes.rb +6 -22
  29. data/lib/ishapi/engine.rb +1 -1
  30. metadata +7 -36
  31. data/app/controllers/ishapi/application_controller.rb-trash +0 -275
  32. data/app/controllers/ishapi/articles_controller.rb +0 -62
  33. data/app/controllers/ishapi/cities_controller.rb +0 -35
  34. data/app/controllers/ishapi/events_controller.rb +0 -21
  35. data/app/controllers/ishapi/measurements_controller.rb +0 -26
  36. data/app/controllers/ishapi/sites_controller.rb +0 -55
  37. data/app/controllers/ishapi/tags_controller.rb +0 -24
  38. data/app/controllers/ishapi/venues_controller.rb +0 -20
  39. data/app/models/tmp_user.rb +0 -49
  40. data/app/views/ishapi/articles/_form.html.erb +0 -27
  41. data/app/views/ishapi/articles/edit.html.erb +0 -6
  42. data/app/views/ishapi/articles/index.html.erb +0 -29
  43. data/app/views/ishapi/articles/new.html.erb +0 -5
  44. data/app/views/ishapi/articles/show.html.erb +0 -14
  45. data/app/views/ishapi/cities/_index.jbuilder +0 -16
  46. data/app/views/ishapi/cities/features.jbuilder +0 -9
  47. data/app/views/ishapi/cities/index.jbuilder +0 -9
  48. data/app/views/ishapi/cities/show.jbuilder +0 -30
  49. data/app/views/ishapi/events/_index.jbuilder +0 -13
  50. data/app/views/ishapi/events/show.jbuilder +0 -11
  51. data/app/views/ishapi/features/_index.jbuilder +0 -41
  52. data/app/views/ishapi/sites/show.jbuilder +0 -31
  53. data/app/views/ishapi/tags/_index.jbuilder +0 -14
  54. data/app/views/ishapi/tags/_widget.jbuilder +0 -11
  55. data/app/views/ishapi/tags/index.jbuilder +0 -10
  56. data/app/views/ishapi/tags/show.jbuilder +0 -14
  57. data/app/views/ishapi/users/_account.jbuilder +0 -21
  58. data/app/views/ishapi/users/account.jbuilder +0 -2
  59. data/app/views/ishapi/users/login.jbuilder +0 -5
  60. data/app/views/ishapi/venues/_index.jbuilder +0 -21
  61. data/app/views/ishapi/venues/index.jbuilder +0 -2
  62. data/app/views/ishapi/venues/show.jbuilder +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59e8e484d3741e6599d8d8397cfad5dd499635f956c92ed0ed9265172ea30e73
4
- data.tar.gz: 5a1c6b3c8a307cf402167ced6ae4280d943f26c2791848e7cf084a7cee336c24
3
+ metadata.gz: db2768cbb516aab064a7038386c990a31af404056ccdeb0cdbc22aa59a4e65d7
4
+ data.tar.gz: 72a798d3882e44af5b9567882c4b94dc58034c45e6a5c83a7279b55793a74bed
5
5
  SHA512:
6
- metadata.gz: b7dba64e22efac66fc5167e3d9dfbca15572adfdf0d867f0abe74ab464fbae30020eae2038b59e52b48f2826f66dedd08bc0680c7a6e42eddfc80cd6729eee92
7
- data.tar.gz: 7eaaccd91a551e98134431730f4cdee21f85bc580d9d7953054a9bb7abc2b9351418de9a32e3ed9bcce5eeca901c2882419f7b5f83957ff479eddf0758584365
6
+ metadata.gz: 72afce72b3ceb745fd358889589939e5088da0d7cd2b999d50234980be82f6721b6415bb925f34cba8e431ac92e0c94b5b01666f6363eeff1c4d39c0eb44d550
7
+ data.tar.gz: 8df8d085834e683ff0efac5fdb34e36cda116e5312a88894ece276ff1b8d474d6b1fa7ddd1256a3ca93f962413e1b1a1dd862f80643eb53bbfcb084b62efedcc
data/Rakefile CHANGED
@@ -17,11 +17,8 @@ end
17
17
  APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
18
  load 'rails/tasks/engine.rake'
19
19
 
20
-
21
20
  load 'rails/tasks/statistics.rake'
22
21
 
23
-
24
-
25
22
  require 'bundler/gem_tasks'
26
23
 
27
24
  require 'rake/testtask'
@@ -19,7 +19,7 @@ class Ishapi::ApplicationController < ActionController::Base
19
19
  @long_term_token = j['access_token']
20
20
  @graph = Koala::Facebook::API.new( accessToken )
21
21
  @me = @graph.get_object( 'me', :fields => 'email' )
22
- @current_user = TmpUser.where( :email => @me['email'] ).first
22
+ @current_user = User.where( :email => @me['email'] ).first
23
23
 
24
24
  # send the jwt to client
25
25
  @jwt_token = encode(user_id: @current_user.id.to_s)
@@ -28,7 +28,7 @@ class Ishapi::ApplicationController < ActionController::Base
28
28
  email: @current_user.email,
29
29
  jwt_token: @jwt_token,
30
30
  long_term_token: @long_term_token,
31
- n_unlocks: @current_user.profile.n_unlocks,
31
+ n_unlocks: @current_profile.n_unlocks,
32
32
  }
33
33
  end
34
34
 
@@ -56,26 +56,24 @@ class Ishapi::ApplicationController < ActionController::Base
56
56
 
57
57
  private
58
58
 
59
- ## This returns an empty user if not logged in!
59
+ ## This returns an empty profile if not logged in!
60
60
  def check_profile
61
61
  begin
62
62
  decoded = decode(params[:jwt_token])
63
- @current_user = User.find decoded['user_id']
63
+ @current_profile = Ish::UserProfile.find decoded['user_profile_id']
64
64
  rescue JWT::ExpiredSignature, JWT::DecodeError => e
65
- # flash[:notice] = 'You are not logged in, or you have been logged out.'
66
- # puts! 'You are not logged in, or you have been logged out.'
67
- @current_user = TmpUser.new({ profile: Ish::UserProfile.new })
65
+ flash[:notice] = 'You are not logged in, or you have been logged out.'
66
+ @current_profile = Ish::UserProfile.new
68
67
  end
69
68
  end
70
69
 
71
- ## This errors out if not logged in!
72
- def check_profile_hard
70
+ ## If not logged in, errors out
71
+ def check_profile!
73
72
  begin
74
73
  decoded = decode(params[:jwt_token])
75
- @current_user = TmpUser.find decoded['user_id']
74
+ @current_profile = Ish::UserProfile.find decoded['user_profile_id']
76
75
  rescue JWT::ExpiredSignature, JWT::DecodeError => e
77
- # flash[:notice] = 'You are not logged in, or you have been logged out.'
78
- # puts! 'You are not logged in, or you have been logged out.'
76
+ flash[:notice] = 'You are not logged in, or you have been logged out.'
79
77
  end
80
78
  end
81
79
 
@@ -83,7 +81,7 @@ class Ishapi::ApplicationController < ActionController::Base
83
81
  def check_jwt
84
82
  begin
85
83
  decoded = decode(params[:jwt_token])
86
- @current_user = TmpUser.find decoded['user_id']
84
+ @current_profile = Ish::UserProfile.find decoded['user_profile_id']
87
85
  rescue JWT::ExpiredSignature
88
86
  Rails.logger.info("JWT::ExpiredSignature")
89
87
  rescue JWT::DecodeError
@@ -105,7 +103,7 @@ class Ishapi::ApplicationController < ActionController::Base
105
103
  end
106
104
 
107
105
  def current_ability
108
- @current_ability ||= Ishapi::Ability.new( @current_user )
106
+ @current_ability ||= Ishapi::Ability.new( @current_profile )
109
107
  end
110
108
 
111
109
  end
@@ -9,10 +9,6 @@ module Ishapi
9
9
  def index
10
10
  @galleries = Gallery.all
11
11
  authorize! :index, Gallery
12
- if params[:cityname]
13
- city = City.find_by :cityname => params[:cityname]
14
- @galleries = @galleries.where( :city => city )
15
- end
16
12
  if params[:domain]
17
13
  @site = Site.find_by( :domain => params[:domain], :lang => 'en' )
18
14
  @galleries = @galleries.where( :site => @site )
@@ -14,7 +14,7 @@ class Ishapi::MapsController < Ishapi::ApplicationController
14
14
  @newsitems = @location.newsitems.page( params[:newsitems_page]
15
15
  ).per( @location.newsitems_page_size )
16
16
 
17
- @markers = @map.markers.permitted_to(@current_user.profile).order_by(ordering: :asc)
17
+ @markers = @map.markers.permitted_to(@current_profile).order_by(ordering: :asc)
18
18
  # case @map.ordering_type
19
19
  # when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
20
20
  # @markers = @markers.order_by( name: :asc )
@@ -22,15 +22,11 @@ class Ishapi::MapsController < Ishapi::ApplicationController
22
22
  # @markers = @markers.order_by( ordering: :asc )
23
23
  # end
24
24
 
25
- @tags = @map.tags
26
-
27
- if @map.is_premium && !@current_user.profile.has_premium_purchase( @map )
25
+ if @map.is_premium && !@current_profile.has_premium_purchase( @map )
28
26
  render 'show_restricted'
29
27
  else
30
28
  render 'show'
31
29
  end
32
-
33
-
34
30
  end
35
31
 
36
32
  def show_marker
@@ -5,7 +5,7 @@ class Ishapi::Users::RegistrationsController < Devise::RegistrationsController
5
5
  def create
6
6
  build_resource(sign_up_params)
7
7
  resource.save
8
- resource.profile = Ish::UserProfile.create({ user: resource, email: resource.email })
8
+ user_profile = Ish::UserProfile.create({ email: resource.email })
9
9
  yield resource if block_given?
10
10
  if resource.persisted?
11
11
  render json: {
@@ -11,9 +11,9 @@ class Ishapi::Users::SessionsController < Devise::SessionsController
11
11
 
12
12
  ## Send the jwt to client
13
13
  @current_user = resource
14
- @jwt_token = encode(user_id: @current_user.id.to_s)
15
- @profile = @current_user.profile
16
- render 'ishapi/users/login', format: :json, layout: false
14
+ @current_profile = Ish::UserProfile.find_by({ email: @current_user.email })
15
+ @jwt_token = encode(user_profile_id: @current_profile.id.to_s)
16
+ render 'ishapi/user_profiles/login', format: :json, layout: false
17
17
  end
18
18
 
19
19
  private
@@ -1,45 +1,43 @@
1
- # require_dependency "ishapi/application_controller"
2
1
 
3
- module Ishapi
4
- class UsersController < Ishapi::ApplicationController
2
+ ##
3
+ ## Cannot move this class right now - it gets hit verifying user's account, every time.
4
+ ## @TODO: merge with user_profiles_controller. _vp_ 2022-10-13
5
+ ##
6
+ class ::Ishapi::UsersController < Ishapi::ApplicationController
5
7
 
6
- skip_authorization_check only: %i| create fb_sign_in login |
8
+ skip_authorization_check only: %i| create fb_sign_in login |
7
9
 
10
+ before_action :check_profile!, only: %i| account |
8
11
 
9
- before_action :check_profile_hard, only: %i| account |
12
+ def account
13
+ authorize! :show, @current_profile
14
+ render 'ishapi/user_profiles/account'
15
+ rescue CanCan::AccessDenied
16
+ render json: {
17
+ status: :not_ok,
18
+ }, status: 401
19
+ end
10
20
 
11
- def account
12
- @profile = @current_user&.profile
13
- authorize! :show, @profile
14
- render 'ishapi/users/account'
15
- rescue CanCan::AccessDenied
16
- render json: {
17
- status: :not_ok,
18
- }, status: 401
19
- end
21
+ def create
22
+ authorize! :open_permission, Ishapi
23
+ new_user_params = params[:user].permit!
20
24
 
21
- def create
22
- authorize! :open_permission, Ishapi
23
- new_user_params = params[:user].permit!
24
-
25
- @profile = Profile.new( email: new_user_params[:email] )
26
- @user = User.new( email: new_user_params[:email], password: new_user_params[:password], profile: @profile )
27
-
28
- if @profile.save && @user.save
29
- @jwt_token = encode(user_id: @user.id.to_s)
30
- render 'login'
31
- else
32
- render json: {
33
- messages: @user.errors.messages.merge( @profile.errors.messages ),
34
- }, status: 400
35
- end
36
- end
25
+ @profile = Profile.new( email: new_user_params[:email] )
26
+ @user = User.new( email: new_user_params[:email], password: new_user_params[:password], profile: @profile )
37
27
 
38
- def fb_sign_in
39
- authorize! :fb_sign_in, Ishapi
40
- # render :json => { :status => :ok }
41
- render :action => 'show'
28
+ if @profile.save && @user.save
29
+ @jwt_token = encode(user_id: @user.id.to_s)
30
+ render 'ishapi/user_profiles/login'
31
+ else
32
+ render json: {
33
+ messages: @user.errors.messages.merge( @profile.errors.messages ),
34
+ }, status: 400
42
35
  end
36
+ end
43
37
 
38
+ def fb_sign_in
39
+ authorize! :fb_sign_in, Ishapi
40
+ render 'ishapi/user_profiles/show'
44
41
  end
42
+
45
43
  end
@@ -10,15 +10,6 @@ module Ishapi
10
10
  def index
11
11
  authorize! :index, Video
12
12
  @videos = Video.all
13
- if params[:cityname]
14
- city = City.find_by :cityname => params[:cityname]
15
- @videos = @videos.where( :city_id => city.id )
16
- end
17
- if params[:domain]
18
- site = Site.find_by :domain => params[:domain], :lang => :en
19
- @videos = @videos.where( :site_id => site.id )
20
- end
21
-
22
13
  @videos = @videos.page( params[:videos_page] ).per( 10 )
23
14
  end
24
15
 
@@ -2,7 +2,7 @@ module Ishapi
2
2
  module ApplicationHelper
3
3
 
4
4
  def image_missing
5
- 'https://s3.amazonaws.com/ish-wp/wp-content/uploads/2022/02/25232018/100x100_crossout.png'
5
+ 'https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2022/02/25232018/100x100_crossout.png'
6
6
  end
7
7
 
8
8
  end
@@ -2,30 +2,26 @@
2
2
  class Ishapi::Ability
3
3
  include ::CanCan::Ability
4
4
 
5
- def initialize user
5
+ def initialize user_profile
6
6
  #
7
- # signed in user
7
+ # signed in user_profile
8
8
  #
9
- if !user.blank?
10
-
11
- # if user.profile && user.profile.sudoer?
12
- # can :manage, :all
13
- # end
9
+ if !user_profile.blank?
14
10
 
15
11
  can [ :my_index ], Gallery
16
12
  can [ :show ], Gallery do |gallery|
17
- gallery.user_profile == user.profile || # my own
13
+ gallery.user_profile == user_profile || # my own
18
14
  (!gallery.is_trash && gallery.is_public ) || # public
19
- (!gallery.is_trash && gallery.shared_profiles.include?( user.profile ) ) # shared with me
15
+ (!gallery.is_trash && gallery.shared_profiles.include?( user_profile ) ) # shared with me
20
16
  end
21
17
 
22
18
  can [ :do_purchase ], ::Gameui
23
19
  can [ :show ], ::Gameui::Map do |map|
24
- map.creator_profile == user.profile
20
+ map.creator_profile == user_profile
25
21
  end
26
22
 
27
23
  can [ :destroy ], Newsitem do |n|
28
- n.map.creator_profile.id == user.profile.id
24
+ n.map.creator_profile.id == user_profile.id
29
25
  end
30
26
 
31
27
  can [ :create, :unlock ], ::Ish::Payment
@@ -43,10 +39,6 @@ class Ishapi::Ability
43
39
  p.user.id.to_s == user.id.to_s
44
40
  end
45
41
 
46
- can [ :index, :show ], City
47
-
48
- can [ :index, :show ], Event
49
-
50
42
  #
51
43
  # G
52
44
  #
@@ -65,7 +57,7 @@ class Ishapi::Ability
65
57
  #
66
58
  can [ :index ], ::Gameui::Map
67
59
  can [ :show ], ::Gameui::Map do |map|
68
- map.is_public || map.shared_profiles.include?( user.profile )
60
+ map.is_public || map.shared_profiles.include?( user_profile )
69
61
  end
70
62
  can [ :show ], ::Gameui::Marker do |m|
71
63
  m.is_public
@@ -87,23 +79,14 @@ class Ishapi::Ability
87
79
  #
88
80
  # S
89
81
  #
90
- can [ :index, :show ], Site
91
82
 
92
83
  #
93
84
  # T
94
85
  #
95
- can [ :index ], Tag
96
- can [ :show ], Tag do |tag|
97
- tag.is_public
98
- end
99
86
 
100
87
  #
101
88
  # V
102
89
  #
103
- can [ :index ], Venue
104
- can [ :show ], Venue do |venue|
105
- venue.is_public
106
- end
107
90
  can [ :index, :my_index ], Video
108
91
  can [ :show ], Video do |video|
109
92
  video.is_public
@@ -3,18 +3,8 @@
3
3
  # ishapi / application / _meta
4
4
  #
5
5
 
6
- if !item.tags.blank?
7
- json.partial! 'ishapi/tags/index', tags: item.tags
8
- end
9
6
  json.created_at item.created_at
10
7
  json.updated_at item.updated_at
11
8
  json.username item.user_profile.name if item.user_profile
12
- if item.city
13
- json.city do
14
- json.name item.city.name
15
- json.slug item.city.cityname
16
- end
17
- json.cityname item.city.cityname
18
- end
19
9
  json.subhead item.subhead
20
10
  json.description item.descr
@@ -17,7 +17,7 @@ json.partial! 'ishapi/application/meta', :item => gallery
17
17
  if gallery.is_premium
18
18
  json.premium_tier gallery.premium_tier
19
19
  json.is_premium gallery.premium_tier > 0
20
- json.is_purchased current_user&.profile&.has_premium_purchase( gallery )
20
+ json.is_purchased @current_profile&.has_premium_purchase( gallery )
21
21
  json.partial! 'ishapi/photos/index', :photos => [ gallery.photos[0] ]
22
22
  else
23
23
  json.partial! 'ishapi/photos/index', :photos => gallery.photos
@@ -6,13 +6,10 @@
6
6
  json.array! @galleries do |gallery|
7
7
  json.id gallery.id.to_s
8
8
  json.name gallery.name
9
- json.slug gallery.slug
9
+ json.slug gallery.slug
10
10
  json.slug gallery.slug
11
11
  json.subhead gallery.subhead
12
12
  json.username gallery.user_profile.name
13
- json.cityname gallery.city.name if gallery.city
14
- json.tag_names gallery.tags.map &:slug
15
- json.venuename gallery.venue.name if gallery.venue
16
13
  json.partial! 'ishapi/photos/index', :photos => gallery.photos
17
14
  end
18
15
 
@@ -22,7 +22,7 @@ json.cache! this_key do
22
22
 
23
23
  json.premium_tier map.premium_tier
24
24
  json.is_premium map.is_premium
25
- json.is_purchased current_user&.profile&.has_premium_purchase( map )
25
+ json.is_purchased @current_profile&.has_premium_purchase( map )
26
26
 
27
27
  json.breadcrumbs do
28
28
  json.array! map.breadcrumbs do |b|
@@ -40,10 +40,6 @@ json.cache! this_key do
40
40
  json.partial! 'ishapi/newsitems/index', newsitems: newsitems
41
41
  end
42
42
 
43
- if tags
44
- json.partial! 'ishapi/tags/index', tags: tags
45
- end
46
-
47
43
  if map.map
48
44
  json.partial! 'ishapi/maps/show', map: map.map
49
45
  end
@@ -2,5 +2,5 @@
2
2
  # ishapi / maps / show
3
3
  #
4
4
 
5
- json.partial! 'ishapi/maps/show', map: @map, markers: @markers, newsitems: @newsitems, tags: @tags
5
+ json.partial! 'ishapi/maps/show', map: @map, markers: @markers, newsitems: @newsitems
6
6
 
@@ -25,8 +25,8 @@ json.markers do
25
25
  json.is_premium destination.is_premium
26
26
  json.id destination.id.to_s
27
27
  if destination.is_premium
28
- if current_user && current_user.profile
29
- json.is_purchased current_user.profile.has_premium_purchase( destination )
28
+ if @current_profile
29
+ json.is_purchased @current_profile.has_premium_purchase( destination )
30
30
  end
31
31
  end
32
32
  end
@@ -16,8 +16,8 @@ json.newsitems do
16
16
  json.description item.description
17
17
 
18
18
  json.votes_score item.votes_score
19
- if @current_user&.profile
20
- json.current_user_vote_value item.vote_value(@current_user.profile.id)
19
+ if @current_profile
20
+ json.current_user_vote_value item.vote_value(@current_profile.id)
21
21
  end
22
22
 
23
23
 
@@ -34,7 +34,7 @@ json.newsitems do
34
34
  if item.gallery.is_premium
35
35
  json.premium_tier item.gallery.premium_tier
36
36
  json.is_premium item.gallery.premium_tier > 0
37
- json.is_purchased current_user&.profile&.has_premium_purchase( item.gallery )
37
+ json.is_purchased @current_profile&.has_premium_purchase( item.gallery )
38
38
  json.partial! 'ishapi/photos/index', :photos => [ item.gallery.photos[0] ]
39
39
  else
40
40
  json.partial! 'ishapi/photos/index', :photos => item.gallery.photos[0...3]
@@ -63,7 +63,7 @@ json.newsitems do
63
63
  if item.report.is_premium
64
64
  json.premium_tier item.report.premium_tier
65
65
  json.is_premium item.report.premium_tier > 0
66
- json.is_purchased current_user&.profile&.has_premium_purchase( item.report )
66
+ json.is_purchased @current_profile&.has_premium_purchase( item.report )
67
67
  end
68
68
  end
69
69
  end
@@ -20,7 +20,5 @@ json.reports do
20
20
  end
21
21
  end
22
22
 
23
- json.partial! 'ishapi/tags/index', tags: report.tags unless report.tags.blank?
24
-
25
23
  end
26
24
  end
@@ -21,7 +21,6 @@ json.cache! key do
21
21
  json.created_at @report.created_at
22
22
  json.updated_at @report.updated_at
23
23
  json.username @report.user_profile.name if @report.user_profile
24
- json.cityname @report.city.cityname if @report.city
25
24
  json.subhead @report.subhead
26
25
 
27
26
  case @report.item_type
@@ -38,8 +37,6 @@ json.cache! key do
38
37
  json.large_url @report.photo.photo.url :large
39
38
  end
40
39
  end
41
-
42
- json.partial! 'ishapi/tags/index', :tags => @report.tags
43
40
  end
44
41
 
45
42
  # @deprecated, but specs use this _vp_ 20180423
@@ -0,0 +1,21 @@
1
+
2
+ json.id profile.id.to_s
3
+ json.name profile.name
4
+ json.email profile.email
5
+ json.profile_photo_url profile.profile_photo.photo.url( :thumb ) if profile.profile_photo
6
+
7
+ json.n_reports profile.reports.count
8
+ json.n_galleries profile.galleries.count
9
+ json.n_videos profile.videos.count
10
+ # json.n_stars profile.n_stars # @TODO: which one is deprecated?
11
+ json.n_unlocks profile.n_unlocks # @TODO: which one is deprecated?
12
+ json.is_purchasing profile.is_purchasing
13
+ if profile.current_city
14
+ json.current_city profile.current_city
15
+ end
16
+
17
+ json.bookmarks profile.bookmarks do |b|
18
+ json.name b.name
19
+ json.slug b.slug
20
+ end
21
+
@@ -0,0 +1,2 @@
1
+
2
+ json.partial! 'ishapi/user_profiles/account', profile: @current_profile
@@ -0,0 +1,5 @@
1
+
2
+ json.email @current_profile.email
3
+ json.n_unlocks @current_profile.n_unlocks
4
+ json.jwt_token @jwt_token
5
+ json.partial! 'ishapi/user_profiles/account', profile: @current_profile
@@ -7,7 +7,3 @@ json.n_galleries @profile.galleries.count
7
7
  json.n_videos @profile.videos.count
8
8
  json.n_stars @profile.n_stars
9
9
 
10
- if @profile.current_city
11
- json.current_city @profile.current_city
12
- end
13
-
@@ -1,7 +1,4 @@
1
1
 
2
- #
3
- # ishapi / users / show.jbuilder
4
- #
5
2
 
6
3
  json.email @current_profile.email
7
4
  json.about @current_profile.about
@@ -23,5 +20,5 @@ if @current_profile.measurement
23
20
  json.partial! 'ishapi/measurements/show', :measurement => @current_profile.measurement
24
21
  end
25
22
 
26
- json.partial! 'ishapi/orders/show', :order => @current_order
23
+ # json.partial! 'ishapi/orders/show', :order => @current_order
27
24
 
@@ -13,14 +13,6 @@ json.x video.x
13
13
  json.y video.y
14
14
  json.url video.video.url
15
15
 
16
- if video.city
17
- json.cityname video.city.cityname
18
- json.city do
19
- json.name video.city.name
20
- json.slug video.city.cityname
21
- end
22
- end
23
-
24
16
  json.tags [ { slug: 'adventure', name: 'Adventure' },
25
17
  { slug: 'bars-and-clubs', name: 'Bars & Clubs' },
26
18
  { slug: 'food', name: 'Food' },
@@ -34,8 +26,8 @@ end
34
26
  if video.is_premium
35
27
  json.premium_tier video.premium_tier
36
28
  json.is_premium video.premium_tier > 0
37
- if current_user && current_user.profile
38
- json.is_purchased current_user.profile.has_premium_purchase( video )
29
+ if @current_profile
30
+ json.is_purchased @current_profile.has_premium_purchase( video )
39
31
  end
40
32
  end
41
33
 
data/config/routes.rb CHANGED
@@ -6,12 +6,6 @@ Ishapi::Engine.routes.draw do
6
6
 
7
7
  resources :addresses
8
8
 
9
- get 'cities', :to => 'cities#index'
10
- get 'cities/view/:cityname', :to => 'cities#show'
11
- get 'cities/features', :to => 'cities#features'
12
-
13
- get 'events/view/:eventname', :to => 'events#show'
14
-
15
9
  get 'galleries', :to => 'galleries#index'
16
10
  post 'galleries', :to => 'galleries#index'
17
11
  get 'galleries/view/:slug', :to => 'galleries#show'
@@ -24,11 +18,11 @@ Ishapi::Engine.routes.draw do
24
18
  get 'markers/view/:slug', to: 'maps#show_marker'
25
19
  match "/my/account", to: "users#account", via: [ :get, :post ]
26
20
  namespace :my do
27
- get 'galleries', to: 'galleries#index'
28
- get 'newsitems', to: 'newsitems#index'
29
- get 'reports', to: 'reports#index'
30
- get 'videos', to: 'videos#index'
31
- post 'videos', to: 'videos#index'
21
+ get 'galleries', to: 'galleries#index'
22
+ get 'newsitems', to: 'newsitems#index'
23
+ get 'reports', to: 'reports#index'
24
+ get 'videos', to: 'videos#index'
25
+ post 'videos', to: 'videos#index'
32
26
  end
33
27
 
34
28
  # N
@@ -47,19 +41,12 @@ Ishapi::Engine.routes.draw do
47
41
  get 'reports', :to => 'reports#index'
48
42
  get 'reports/view/:slug', :to => 'reports#show'
49
43
 
50
- get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
51
- post 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
52
- get 'sites/view/:domain/newsitems/:newsitems_page', :to => 'newsitems#index', :constraints => { :domain => /[^\/]+/ }
53
- get 'sites/view/:domain/reports', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
54
- get 'sites/view/:domain/reports/page/:reports_page', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
55
- get 'sites/view/:domain/tags', :to => 'tags#index', :constraints => { :domain => /[^\/]+/ }
56
-
57
44
  post 'stars/buy', to: 'gameui#buy_stars'
58
45
 
59
46
  ## 2022-02-12 moved to iron_warbler gem _vp_
60
47
  # resources "stock_watches"
61
48
 
62
- get 'tags/view/:slug', :to => 'tags#show'
49
+
63
50
  get 'test', to: 'application#test'
64
51
 
65
52
  post 'users/fb_sign_in', to: 'users#fb_sign_in'
@@ -75,9 +62,6 @@ Ishapi::Engine.routes.draw do
75
62
 
76
63
  post 'v1/vote/:votee_class_name/:votee_id/:voter_id/:value', to: 'application#vote'
77
64
 
78
- get 'venues', :to => 'venues#index'
79
- get 'venues/view/:venuename', :to => 'venues#show'
80
-
81
65
  resources :videos
82
66
 
83
67
  end
data/lib/ishapi/engine.rb CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  require 'rubygems'
3
3
  require 'rack/throttle'
4
- # require 'jbuilder'
4
+ require 'jbuilder' # _vp_ 2022-10-07 - otherwise host app cant find templates
5
5
 
6
6
  module Ishapi
7
7
  class Engine < ::Rails::Engine