ishapi 0.1.8.154 → 0.1.8.155

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: 3ea85f1095f4e6b36f17cdf09ca7df8bc74b42bde53e25b55b9ef99b1ed96694
4
- data.tar.gz: 24e3d614854cf2b338b1feb4817b0f32de3faa6a9d65a88a09b1091662b0345f
3
+ metadata.gz: 2b273dbf478b4af579ef9471c57c58394351daf23243a8ccc5ae51105962cbe2
4
+ data.tar.gz: 8f909caebcdbdd20602e2245ee9306897e6dd467be8b68cb9de4a7472bdf964d
5
5
  SHA512:
6
- metadata.gz: a7bad7a0b0452a1da5ba93c9b75270dd7ab041873bf159d9f39540f69616a6bf1b6e8e7d89babd4f49f00f78e6d9952cebc7d76388f973fa202d7e93ff8a928a
7
- data.tar.gz: 18fcd94cef51deb507f136e5d6cc21a881d0c04fd4061b546d11105aa7a8d7e1c59d43d01c933ed357fd91799294f3f03de24f15dc3d0ef684516d36324208fc
6
+ metadata.gz: f9eb5d1a81fd3488f2fcf0ecd3fe746ff0857cab76fa71da05bc8c3d6401f6fcce9c7f46f872d1d0aaf575517aeaf1c049c2ffc8f318aa74cb8094d972a4f87f
7
+ data.tar.gz: 1aa269a44ee60f9bde3b145c0d85291d7f0a341eff7351db79c2675b355849fd3964d491a3b2bb8455aef21904545e73d31b973eff370b50b0d4f892fee29865
@@ -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
 
@@ -17,4 +17,4 @@ if item.city
17
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
@@ -21,4 +21,4 @@ if gallery.is_premium
21
21
  json.partial! 'ishapi/photos/index', :photos => [ gallery.photos[0] ]
22
22
  else
23
23
  json.partial! 'ishapi/photos/index', :photos => gallery.photos
24
- 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
@@ -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,6 +2,8 @@
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|
@@ -9,6 +11,8 @@ json.newsitems do
9
11
  json.created_at item.created_at
10
12
  json.updated_at item.updated_at
11
13
 
14
+ json.description item.description
15
+
12
16
  if item.gallery
13
17
  json.id item.gallery_id.to_s
14
18
  json.item_type item.gallery.class.name
@@ -30,24 +34,29 @@ json.newsitems do
30
34
  end
31
35
 
32
36
  if item.report
33
- json.id item.report_id.to_s
34
- json.item_type item.report.class.name
35
- json.name item.report.name
36
- json.reportname item.report.name_seo
37
- json.subhead item.report.subhead
38
- 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
39
39
 
40
- if item.report.photo
41
- json.photo_s169_url item.report.photo.photo.url( :s169 )
42
- json.photo_thumb2_url item.report.photo.photo.url( :thumb2 )
43
- 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
44
52
 
45
- json.partial! 'ishapi/application/meta', :item => item.report
53
+ json.partial! 'ishapi/application/meta', :item => item.report
46
54
 
47
- if item.report.is_premium
48
- json.premium_tier item.report.premium_tier
49
- json.is_premium item.report.premium_tier > 0
50
- 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
51
60
  end
52
61
  end
53
62
 
@@ -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
 
@@ -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 )
@@ -10,7 +10,7 @@ json.venues do
10
10
 
11
11
  json.address venue.address if venue.address.present?
12
12
  json.name venue.name
13
- json.name_seo venue.name_seo
13
+ json.slug venue.slug
14
14
  json.subhead venue.subhead
15
15
  json.description venue.descr
16
16
  json.x venue.x
@@ -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
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.154
4
+ version: 0.1.8.155
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-02 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