ishapi 0.1.8.193 → 0.1.8.195
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/Rakefile +0 -3
- data/app/controllers/ishapi/application_controller.rb +11 -13
- data/app/controllers/ishapi/galleries_controller.rb +0 -4
- data/app/controllers/ishapi/maps_controller.rb +2 -6
- data/app/controllers/ishapi/users/registrations_controller.rb +1 -1
- data/app/controllers/ishapi/users/sessions_controller.rb +3 -3
- data/app/controllers/ishapi/users_controller.rb +32 -34
- data/app/controllers/ishapi/videos_controller.rb +0 -9
- data/app/helpers/ishapi/application_helper.rb +1 -1
- data/app/models/ishapi/ability.rb +8 -25
- data/app/views/ishapi/application/_meta.jbuilder +0 -10
- data/app/views/ishapi/galleries/_show.jbuilder +1 -1
- data/app/views/ishapi/galleries/index.jbuilder +1 -4
- data/app/views/ishapi/maps/_show.jbuilder +1 -5
- data/app/views/ishapi/maps/show.jbuilder +1 -1
- data/app/views/ishapi/markers/_index.jbuilder +2 -2
- data/app/views/ishapi/newsitems/_index.jbuilder +4 -4
- data/app/views/ishapi/reports/_index.jbuilder +0 -2
- data/app/views/ishapi/reports/show.jbuilder +0 -3
- data/app/views/ishapi/user_profiles/_account.jbuilder +21 -0
- data/app/views/ishapi/{users → user_profiles}/_index.jbuilder +0 -0
- data/app/views/ishapi/user_profiles/account.jbuilder +2 -0
- data/app/views/ishapi/user_profiles/login.jbuilder +5 -0
- data/app/views/ishapi/user_profiles/show.jbuilder +0 -4
- data/app/views/ishapi/{users/show.jbuilder → user_profiles/show.jbuilder-bk} +1 -4
- data/app/views/ishapi/videos/_show.jbuilder +2 -10
- data/config/routes.rb +6 -22
- data/lib/ishapi/engine.rb +1 -1
- metadata +7 -35
- data/app/controllers/ishapi/application_controller.rb-trash +0 -275
- data/app/controllers/ishapi/articles_controller.rb +0 -62
- data/app/controllers/ishapi/cities_controller.rb +0 -35
- data/app/controllers/ishapi/events_controller.rb +0 -21
- data/app/controllers/ishapi/measurements_controller.rb +0 -26
- data/app/controllers/ishapi/sites_controller.rb +0 -55
- data/app/controllers/ishapi/tags_controller.rb +0 -24
- data/app/controllers/ishapi/venues_controller.rb +0 -20
- data/app/views/ishapi/articles/_form.html.erb +0 -27
- data/app/views/ishapi/articles/edit.html.erb +0 -6
- data/app/views/ishapi/articles/index.html.erb +0 -29
- data/app/views/ishapi/articles/new.html.erb +0 -5
- data/app/views/ishapi/articles/show.html.erb +0 -14
- data/app/views/ishapi/cities/_index.jbuilder +0 -16
- data/app/views/ishapi/cities/features.jbuilder +0 -9
- data/app/views/ishapi/cities/index.jbuilder +0 -9
- data/app/views/ishapi/cities/show.jbuilder +0 -30
- data/app/views/ishapi/events/_index.jbuilder +0 -13
- data/app/views/ishapi/events/show.jbuilder +0 -11
- data/app/views/ishapi/features/_index.jbuilder +0 -41
- data/app/views/ishapi/sites/show.jbuilder +0 -31
- data/app/views/ishapi/tags/_index.jbuilder +0 -14
- data/app/views/ishapi/tags/_widget.jbuilder +0 -11
- data/app/views/ishapi/tags/index.jbuilder +0 -10
- data/app/views/ishapi/tags/show.jbuilder +0 -14
- data/app/views/ishapi/users/_account.jbuilder +0 -21
- data/app/views/ishapi/users/account.jbuilder +0 -2
- data/app/views/ishapi/users/login.jbuilder +0 -5
- data/app/views/ishapi/venues/_index.jbuilder +0 -21
- data/app/views/ishapi/venues/index.jbuilder +0 -2
- data/app/views/ishapi/venues/show.jbuilder +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db2768cbb516aab064a7038386c990a31af404056ccdeb0cdbc22aa59a4e65d7
|
4
|
+
data.tar.gz: 72a798d3882e44af5b9567882c4b94dc58034c45e6a5c83a7279b55793a74bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72afce72b3ceb745fd358889589939e5088da0d7cd2b999d50234980be82f6721b6415bb925f34cba8e431ac92e0c94b5b01666f6363eeff1c4d39c0eb44d550
|
7
|
+
data.tar.gz: 8df8d085834e683ff0efac5fdb34e36cda116e5312a88894ece276ff1b8d474d6b1fa7ddd1256a3ca93f962413e1b1a1dd862f80643eb53bbfcb084b62efedcc
|
data/Rakefile
CHANGED
@@ -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: @
|
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
|
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
|
-
@
|
63
|
+
@current_profile = Ish::UserProfile.find decoded['user_profile_id']
|
64
64
|
rescue JWT::ExpiredSignature, JWT::DecodeError => e
|
65
|
-
|
66
|
-
|
67
|
-
@current_user = User.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
|
-
##
|
72
|
-
def
|
70
|
+
## If not logged in, errors out
|
71
|
+
def check_profile!
|
73
72
|
begin
|
74
73
|
decoded = decode(params[:jwt_token])
|
75
|
-
@
|
74
|
+
@current_profile = Ish::UserProfile.find decoded['user_profile_id']
|
76
75
|
rescue JWT::ExpiredSignature, JWT::DecodeError => e
|
77
|
-
|
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
|
-
@
|
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( @
|
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(@
|
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
|
-
@
|
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
|
-
|
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
|
-
@
|
15
|
-
@
|
16
|
-
render 'ishapi/
|
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
|
-
|
4
|
-
|
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
|
-
|
8
|
+
skip_authorization_check only: %i| create fb_sign_in login |
|
7
9
|
|
10
|
+
before_action :check_profile!, only: %i| account |
|
8
11
|
|
9
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
22
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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://
|
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
|
5
|
+
def initialize user_profile
|
6
6
|
#
|
7
|
-
# signed in
|
7
|
+
# signed in user_profile
|
8
8
|
#
|
9
|
-
if !
|
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 ==
|
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?(
|
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 ==
|
20
|
+
map.creator_profile == user_profile
|
25
21
|
end
|
26
22
|
|
27
23
|
can [ :destroy ], Newsitem do |n|
|
28
|
-
n.map.creator_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?(
|
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
|
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
|
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
|
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
|
@@ -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
|
29
|
-
json.is_purchased
|
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 @
|
20
|
-
json.current_user_vote_value item.vote_value(@
|
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
|
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
|
66
|
+
json.is_purchased @current_profile&.has_premium_purchase( item.report )
|
67
67
|
end
|
68
68
|
end
|
69
69
|
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
|
+
|
File without changes
|
@@ -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
|
38
|
-
json.is_purchased
|
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
|
28
|
-
get
|
29
|
-
get 'reports',
|
30
|
-
get 'videos',
|
31
|
-
post 'videos',
|
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
|
-
|
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
|