ishapi 0.1.8.151 → 0.1.8.156

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: 48a60ea3b0572e7a03c6367c503ade90a23d0c9c668f7126328cf69fb6edd6f0
4
- data.tar.gz: '059b472d0856d0984b540d92207035c0c7e5593a050ae0693d4e309351427f02'
3
+ metadata.gz: ca2785d45981a8774ae17fafe3dbbb247d3dd2adb9d034aa6721c4522141e147
4
+ data.tar.gz: f6c2de7de0d655170fb5b2cf15c9bba1ba9512f36423d75f3d5442f0026ba3df
5
5
  SHA512:
6
- metadata.gz: 9730c397b9c7468348771f3f25d26a20d3544ab22930ad58363f7b0b79ee1bc9a61b625e7d6c7f1a92c76e12eee9dc875f7b857fe597c9f839e179a29e982978
7
- data.tar.gz: 53770e986e3fb7f2f84ff09ac672444961d8eeb79dbafc285fc1961017866a4ca6ef85732b805064b5fc70df61a93f5977a30eec1ab51f8e9135503a89190701
6
+ metadata.gz: 650bbe02d71b2a79eed5ca226d67697942e84735115ee447a05c94fe2ea7d6244a0c003495499242644da099a708e3fb0770be48da2d8c4da8ac33b4a7993b3c
7
+ data.tar.gz: 7fd1e99ced3c7784f7ceae4a8d21dd96ade99b668593ec1deb1cf5988c7cceead07e881dc31856cb50d77d38580dcd568f9be640dfe0c360217bcfb376ed40a8
@@ -9,7 +9,7 @@ module Ishapi
9
9
  params['domain'] = 'tgm.piousbox.com'
10
10
 
11
11
  response = ::HTTParty.get "https://graph.facebook.com/v5.0/oauth/access_token?grant_type=fb_exchange_token&" +
12
- "client_id=#{FB[params['domain']][:app]}&client_secret=#{FB[params['domain']][:secret]}&" +
12
+ "client_id=#{::FB[params['domain']][:app]}&client_secret=#{::FB[params['domain']][:secret]}&" +
13
13
  "fb_exchange_token=#{accessToken}"
14
14
  j = JSON.parse response.body
15
15
  @long_term_token = j['access_token']
@@ -35,7 +35,6 @@ module Ishapi
35
35
  decoded = decode(params[:jwt_token])
36
36
  @current_user = User.find decoded['user_id']
37
37
  rescue JWT::ExpiredSignature, JWT::DecodeError => e
38
- puts! e, 'ee1'
39
38
  flash[:notice] = 'You arent logged in, or you have been logged out.'
40
39
  # @current_user = User.new
41
40
  end
@@ -61,7 +60,7 @@ module Ishapi
61
60
  end
62
61
 
63
62
  # jwt
64
- def encode(payload, exp = 2.hours.from_now)
63
+ def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
65
64
  payload[:exp] = exp.to_i
66
65
  JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
67
66
  end
@@ -1,16 +1,8 @@
1
1
  require_dependency "ishapi/application_controller"
2
2
  module Ishapi
3
3
  class MapsController < ApplicationController
4
-
5
4
  before_action :check_profile, only: [ :show ]
6
5
 
7
- =begin
8
- def index
9
- authorize! :index, ::Gameui::Map
10
- @maps = ::Gameui::Map.all
11
- end
12
- =end
13
-
14
6
  def show
15
7
  @map = ::Gameui::Map.find_by slug: params[:slug]
16
8
  @markers = @map.markers.where( is_active: true )
@@ -23,16 +15,14 @@ module Ishapi
23
15
  @markers = @markers.order_by( ordering: :asc )
24
16
  end
25
17
 
26
- # @TODO: move to models
18
+ ## @TODO: figure this out eventually
27
19
  if city = City.where( cityname: @map.slug ).first
28
- @newsitems = city.newsitems
20
+ # @newsitems = city.newsitems
29
21
  @galleries = city.galleries
30
22
  @reports = city.reports
31
23
  @videos = city.videos
32
24
  end
33
25
 
34
- puts! @map, 'prod map'
35
-
36
26
  authorize! :show, @map
37
27
  end
38
28
 
@@ -3,7 +3,7 @@ module Ishapi
3
3
  class ReportsController < ApplicationController
4
4
 
5
5
  def show
6
- @report = Report.unscoped.find_by :name_seo => params[:name_seo]
6
+ @report = Report.unscoped.find_by :slug => params[:slug]
7
7
  authorize! :show, @report
8
8
  end
9
9
 
@@ -13,9 +13,9 @@ module Ishapi
13
13
 
14
14
  def show
15
15
  begin
16
- @tag = Tag.find_by( :name_seo => params[:tagname] )
16
+ @tag = Tag.find_by( slug: params[:slug] )
17
17
  rescue Mongoid::Errors::DocumentNotFound
18
- @tag = Tag.find params[:tagname]
18
+ @tag = Tag.find params[:slug]
19
19
  end
20
20
  authorize! :show, @tag
21
21
  end
@@ -12,7 +12,7 @@ module Ishapi
12
12
  end
13
13
 
14
14
  def show
15
- @venue = Venue.find_by :name_seo => params[:venuename]
15
+ @venue = Venue.find_by :slug => params[:venuename]
16
16
  authorize! :show, @venue
17
17
  end
18
18
 
@@ -3,7 +3,7 @@ module Ishapi
3
3
  class VideosController < ApplicationController
4
4
 
5
5
  def show
6
- @video = Video.unscoped.find_by :name_seo => params[:name_seo]
6
+ @video = Video.unscoped.find_by :slug => params[:slug]
7
7
  authorize! :show, @video
8
8
  end
9
9
 
@@ -14,7 +14,7 @@ if item.city
14
14
  json.name item.city.name
15
15
  json.slug item.city.cityname
16
16
  end
17
- json.cityname item.city.cityname
17
+ json.cityname item.city.cityname
18
18
  end
19
19
  json.subhead item.subhead
20
- json.description item.descr
20
+ json.description item.descr
@@ -21,7 +21,7 @@ json.features do
21
21
  r = feature.report
22
22
  json.name r.name
23
23
  json.subhead r.subhead
24
- json.reportname r.name_seo
24
+ json.reportname r.slug
25
25
  if r.photo
26
26
  json.photo_url r.photo.photo.url( :thumb )
27
27
  end
@@ -1,8 +1,11 @@
1
1
  #
2
2
  # ishapi / galleries / _show
3
3
  #
4
+
5
+ # @TODO: remove this file, this looks like a newsitem
6
+
4
7
  json.id gallery.id.to_s
5
- json.item_type 'gallery'
8
+ json.item_type gallery.class.name
6
9
  json.name gallery.name
7
10
  json.galleryname gallery.galleryname
8
11
  json.description gallery.description
@@ -18,4 +21,4 @@ if gallery.is_premium
18
21
  json.partial! 'ishapi/photos/index', :photos => [ gallery.photos[0] ]
19
22
  else
20
23
  json.partial! 'ishapi/photos/index', :photos => gallery.photos
21
- end
24
+ end
@@ -11,7 +11,7 @@ json.array! @galleries do |gallery|
11
11
  json.subhead gallery.subhead
12
12
  json.username gallery.user_profile.name
13
13
  json.cityname gallery.city.name if gallery.city
14
- json.tag_names gallery.tags.map &:name_seo
14
+ json.tag_names gallery.tags.map &:slug
15
15
  json.venuename gallery.venue.name if gallery.venue
16
16
  json.partial! 'ishapi/photos/index', :photos => gallery.photos
17
17
  end
@@ -5,7 +5,10 @@
5
5
  this_key = [ @gallery, params.permit! ]
6
6
  json.cache! this_key do
7
7
  json.gallery do
8
- json.message "This is premium content - please purchase it to view!"
8
+
9
+ json.id @gallery.id.to_s
10
+ json.item_type @gallery.class.name
11
+
9
12
  json.premium_tier @gallery.premium_tier
10
13
  json.is_premium @gallery.is_premium
11
14
  json.is_purchased false
@@ -13,5 +16,6 @@ json.cache! this_key do
13
16
  # json.partial! 'ishapi/galleries/show', gallery: @gallery
14
17
  # json.partial! 'ishapi/photos/index', :photos => [ @gallery.photos[0] ]
15
18
  end
19
+ json.message "This is premium content - please purchase it to view!"
16
20
  end
17
21
 
@@ -26,8 +26,18 @@ json.cache! this_key do
26
26
  end
27
27
  end
28
28
 
29
+ ## I removed json parsing from here! _vp_ 2021-10-14
30
+ if @map.parent_slug.present?
31
+ json.config @map.parent.config
32
+ json.labels @map.parent.labels
33
+ else
34
+ json.config @map.config
35
+ json.labels @map.labels
36
+ end
37
+
29
38
  json.partial! 'ishapi/markers/index', map: @map
30
39
 
40
+ puts! @newsitems, 'these first'
31
41
  if @newsitems
32
42
  json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
33
43
  end
@@ -2,20 +2,23 @@
2
2
  # ishapi / newsitems / _index
3
3
  #
4
4
 
5
+ puts! newsitems, 'newsitems idx'
6
+
5
7
  json.n_newsitems newsitems.count
6
8
  json.newsitems do
7
9
  json.array! newsitems do |item|
8
-
9
- json.id item.id.to_s
10
10
  json.name item.name
11
11
  json.created_at item.created_at
12
12
  json.updated_at item.updated_at
13
13
 
14
+ json.description item.description
15
+
14
16
  if item.gallery
15
- json.item_type 'gallery'
17
+ json.id item.gallery_id.to_s
18
+ json.item_type item.gallery.class.name
16
19
  json.name item.gallery.name
17
20
  json.galleryname item.gallery.galleryname
18
- json.username item.username || item.gallery.username || 'piousbox'
21
+ json.username item.username || item.gallery.username || 'donor-default'
19
22
  json.n_photos item.gallery.photos.length
20
23
  json.slug item.gallery.galleryname
21
24
  json.subhead item.gallery.subhead
@@ -26,38 +29,48 @@ json.newsitems do
26
29
  json.is_purchased current_user&.profile&.has_premium_purchase( item.gallery )
27
30
  json.partial! 'ishapi/photos/index', :photos => [ item.gallery.photos[0] ]
28
31
  else
29
- json.partial! 'ishapi/photos/index', :photos => item.gallery.photos
32
+ json.partial! 'ishapi/photos/index', :photos => item.gallery.photos[0...3]
30
33
  end
31
34
  end
32
35
 
33
36
  if item.report
34
- json.item_type 'report'
35
- json.name item.report.name
36
- json.reportname item.report.name_seo
37
- json.subhead item.report.subhead
38
- json.report_id item.report_id.to_s
39
- json.username item.report.user_profile.name if item.report.user_profile
37
+ if item.report.item_type == 'longscroll' # this allows you to have a wall of scrollable text instead of clickable items
38
+ json.description item.report.descr
40
39
 
41
- if item.report.photo
42
- json.photo_s169_url item.report.photo.photo.url( :s169 )
43
- json.photo_thumb2_url item.report.photo.photo.url( :thumb2 )
44
- end
40
+ else
41
+ json.id item.report_id.to_s
42
+ json.item_type item.report.class.name
43
+ json.name item.report.name
44
+ json.reportname item.report.slug
45
+ json.subhead item.report.subhead
46
+ json.username item.report.user_profile.name if item.report.user_profile
47
+
48
+ if item.report.photo
49
+ json.photo_s169_url item.report.photo.photo.url( :s169 )
50
+ json.photo_thumb2_url item.report.photo.photo.url( :thumb2 )
51
+ end
45
52
 
46
- json.partial! 'ishapi/application/meta', :item => item.report
53
+ json.partial! 'ishapi/application/meta', :item => item.report
47
54
 
48
- if item.report.is_premium
49
- json.premium_tier item.report.premium_tier
50
- json.is_premium item.report.premium_tier > 0
51
- json.is_purchased current_user&.profile&.has_premium_purchase( item.report )
55
+ if item.report.is_premium
56
+ json.premium_tier item.report.premium_tier
57
+ json.is_premium item.report.premium_tier > 0
58
+ json.is_purchased current_user&.profile&.has_premium_purchase( item.report )
59
+ end
52
60
  end
53
61
  end
54
62
 
55
63
  if item.video_id
56
- json.partial! 'ishapi/videos/show', :video => Video.unscoped.find( item.video_id )
64
+ json.id item.video_id.to_s
65
+ # @TODO: why this relation is so weird here?!
66
+ video = Video.unscoped.find( item.video_id )
67
+ json.item_type video.class.name
68
+ json.partial! 'ishapi/videos/show', :video => video
57
69
  end
58
70
 
59
71
  if item.photo
60
- json.item_type 'photo'
72
+ json.id item.photo.id.to_s
73
+ json.item_type item.photo.class.name
61
74
  json.partial! 'ishapi/photos/index', :photos => [ item.photo ]
62
75
  end
63
76
 
@@ -8,4 +8,4 @@ json.photos do
8
8
  json.array! photos do |photo|
9
9
  json.partial! 'ishapi/photos/show', :photo => photo
10
10
  end
11
- end
11
+ end
@@ -9,7 +9,7 @@ json.reports do
9
9
  # json.id report.id.to_s
10
10
  json.created_at report.created_at
11
11
  json.name report.name
12
- json.slug report.name_seo
12
+ json.slug report.slug
13
13
  json.description report.descr
14
14
 
15
15
  if report.photo
@@ -9,7 +9,7 @@ json.cache! key do
9
9
  json.report do
10
10
  json.id @report.id.to_s
11
11
  json.name @report.name
12
- json.reportname @report.name_seo
12
+ json.reportname @report.slug
13
13
  if @report.photo
14
14
  json.photo_url @report.photo.photo.url( :small )
15
15
  json.thumb_url @report.photo.photo.url( :thumb )
@@ -6,7 +6,7 @@
6
6
  json.tags do
7
7
  json.array! tags do |tag|
8
8
  json.name tag.name
9
- json.slug tag.name_seo
9
+ json.slug tag.slug
10
10
  end
11
11
  end
12
12
 
@@ -6,6 +6,6 @@
6
6
 
7
7
  json.id tag.id.to_s
8
8
  json.name tag.name
9
- json.tagname tag.tagname
9
+ json.slug tag.slug
10
10
 
11
11
  json.partial! 'ishapi/newsitems/index', :newsitems => tag.newsitems.limit(1)
@@ -5,6 +5,6 @@
5
5
 
6
6
  json.array! @tags do |tag|
7
7
  json.name tag.name
8
- json.slug tag.name_seo
8
+ json.slug tag.slug
9
9
  end
10
10
 
@@ -5,8 +5,9 @@
5
5
  #
6
6
 
7
7
  json.name @tag.name
8
- json.slug @tag.tagname
8
+ json.slug @tag.slug
9
9
 
10
+ json.partial! 'ishapi/features/index', :features => @tag.features, :resource => @tag
10
11
  json.partial! 'ishapi/newsitems/index', :newsitems => @tag.newsitems.page( params[:newsitems_page] ).per( params[:newsitems_per] || 25 )
11
12
  json.partial! 'ishapi/reports/index', :reports => @tag.reports.page( params[:reports_page] ).per( params[:reports_per] || 25 )
12
13
  json.partial! 'ishapi/galleries/index', :galleries => @tag.galleries.page( params[:galleries_page] ).per( params[:galleries_per] || 25 )
@@ -7,13 +7,15 @@ json.n_venues venues.count
7
7
  json.venues do
8
8
  json.array! venues do |venue|
9
9
  json.id venue.id.to_s
10
+
11
+ json.address venue.address if venue.address.present?
10
12
  json.name venue.name
11
- json.name_seo venue.name_seo
13
+ json.slug venue.slug
12
14
  json.subhead venue.subhead
13
15
  json.description venue.descr
14
16
  json.x venue.x
15
17
  json.y venue.y
16
- json.photo venue.profile_photo.photo.url( :thumb ) if venue.profile_photo
18
+ json.photo venue.profile_photo ? venue.profile_photo.photo.url( :thumb ) : image_url('missing.png')
17
19
  json.partial! 'ishapi/tags/index', :tags => venue.tags
18
20
  end
19
21
  end
@@ -7,7 +7,7 @@ key = [ @venue, params.permit! ]
7
7
  json.cache! key do
8
8
  json.venue do
9
9
  json.name @venue.name
10
- json.venuename @venue.name_seo
10
+ json.venuename @venue.slug
11
11
  json.description @venue.descr
12
12
  end
13
13
  end
@@ -11,8 +11,7 @@ json.description video.descr
11
11
  json.subhead video.subhead
12
12
  json.x video.x
13
13
  json.y video.y
14
- json.url video.video.url
15
- json.item_type 'video'
14
+ json.url video.video.url
16
15
 
17
16
  if video.city
18
17
  json.cityname video.city.cityname
@@ -40,6 +39,6 @@ if video.is_premium
40
39
  end
41
40
 
42
41
  if video.thumb
43
- json.photo_s169_url video.thumb.url( :s169 )
42
+ json.photo_s169_url video.thumb.url( :s169 )
44
43
  json.photo_thumb2_url video.thumb.url( :thumb2 )
45
44
  end
data/config/routes.rb CHANGED
@@ -47,7 +47,7 @@ Ishapi::Engine.routes.draw do
47
47
  get 'profiles/view/:username', :to => 'user_profiles#show'
48
48
 
49
49
  get 'reports', :to => 'reports#index'
50
- get 'reports/view/:name_seo', :to => 'reports#show'
50
+ get 'reports/view/:slug', :to => 'reports#show'
51
51
 
52
52
  get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
53
53
  post 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
@@ -58,7 +58,7 @@ Ishapi::Engine.routes.draw do
58
58
 
59
59
  post 'stars/buy', to: 'gameui#buy_stars'
60
60
 
61
- get 'tags/view/:tagname', :to => 'tags#show'
61
+ get 'tags/view/:slug', :to => 'tags#show'
62
62
  get 'test', to: 'application#test'
63
63
 
64
64
  post 'users/fb_sign_in', :to => 'users#fb_sign_in'
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.151
4
+ version: 0.1.8.156
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-24 00:00:00.000000000 Z
11
+ date: 2021-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -251,7 +251,6 @@ files:
251
251
  - app/views/ishapi/maps/index.jbuilder
252
252
  - app/views/ishapi/maps/show.jbuilder
253
253
  - app/views/ishapi/markers/_index.jbuilder
254
- - app/views/ishapi/measurements/_show.jbuilder
255
254
  - app/views/ishapi/my/videos/index.jbuilder
256
255
  - app/views/ishapi/newsitems/_index.jbuilder
257
256
  - app/views/ishapi/newsitems/index.jbuilder
@@ -1,14 +0,0 @@
1
-
2
- # _vp_ 20180309
3
- # MEASUREMENT_PARAMS = [ :neck_around, :chest_around, :waist_around, :sleeve_length, :shoulder_width, :shirt_length, :bicep_around ]
4
- #
5
-
6
- json.measurement do
7
- json.neck_around measurement.neck_around
8
- json.chest_around measurement.chest_around
9
- json.waist_around measurement.waist_around
10
- json.sleeve_length measurement.sleeve_length
11
- json.shoulder_width measurement.shoulder_width
12
- json.shirt_length measurement.shirt_length
13
- json.bicep_around measurement.bicep_around
14
- end