ishapi 0.1.8.156 → 0.1.8.160

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: ca2785d45981a8774ae17fafe3dbbb247d3dd2adb9d034aa6721c4522141e147
4
- data.tar.gz: f6c2de7de0d655170fb5b2cf15c9bba1ba9512f36423d75f3d5442f0026ba3df
3
+ metadata.gz: b2b7dd2fe41b5b2baefc24243c83b8549d36e801a069b6f1e75678ec9c504b1d
4
+ data.tar.gz: 3db877da0b170defc108a103fdf1066b2bfb2f7364967f8e3c2e7f93a5a3379f
5
5
  SHA512:
6
- metadata.gz: 650bbe02d71b2a79eed5ca226d67697942e84735115ee447a05c94fe2ea7d6244a0c003495499242644da099a708e3fb0770be48da2d8c4da8ac33b4a7993b3c
7
- data.tar.gz: 7fd1e99ced3c7784f7ceae4a8d21dd96ade99b668593ec1deb1cf5988c7cceead07e881dc31856cb50d77d38580dcd568f9be640dfe0c360217bcfb376ed40a8
6
+ metadata.gz: 69811c54dadf3fb41b549737e72fdba571479c3e46a8a9fa463ee33d78ceba120a998855c743ba75ec9adc40487dd6e6b5feed9c9dd59f01e7bd092e208481de
7
+ data.tar.gz: 8f598ecc134132e63c275e2d645bf224147d4302c8a9d0b301c8503f0bc87df35298a69ea04994cef902f74a2a8fdcfb5e5a4e1e82663f480619ef88a656d80d
@@ -21,7 +21,7 @@ module Ishapi
21
21
  end
22
22
 
23
23
  def show
24
- @gallery = ::Gallery.unscoped.find_by :galleryname => params[:galleryname]
24
+ @gallery = ::Gallery.unscoped.find_by :slug => params[:slug]
25
25
  authorize! :show, @gallery
26
26
  if @gallery.premium?
27
27
  if current_user&.profile&.has_premium_purchase( @gallery )
@@ -31,7 +31,7 @@ json.features do
31
31
  r = feature.gallery
32
32
  json.name r.name
33
33
  json.subhead r.subhead
34
- json.galleryname r.galleryname
34
+ json.slug r.slug
35
35
  if r.photos[0]
36
36
  json.photo_url r.photos[0].photo.url( :thumb )
37
37
  end
@@ -7,11 +7,11 @@
7
7
  json.id gallery.id.to_s
8
8
  json.item_type gallery.class.name
9
9
  json.name gallery.name
10
- json.galleryname gallery.galleryname
10
+ json.slug gallery.slug
11
11
  json.description gallery.description
12
12
  json.username gallery.username || 'piousbox'
13
13
  json.n_photos gallery.photos.length
14
- json.slug gallery.galleryname
14
+ json.slug gallery.slug
15
15
  json.subhead gallery.subhead
16
16
  json.partial! 'ishapi/application/meta', :item => gallery
17
17
  if gallery.is_premium
@@ -6,8 +6,8 @@
6
6
  json.array! @galleries do |gallery|
7
7
  json.id gallery.id.to_s
8
8
  json.name gallery.name
9
- json.galleryname gallery.galleryname
10
- json.slug gallery.galleryname
9
+ json.slug gallery.slug
10
+ json.slug gallery.slug
11
11
  json.subhead gallery.subhead
12
12
  json.username gallery.user_profile.name
13
13
  json.cityname gallery.city.name if gallery.city
@@ -2,7 +2,9 @@
2
2
  # ishapi / maps / _show
3
3
  #
4
4
 
5
- this_key = [ map, params.permit! ]
5
+ ## @TODO: make sure that _show.jbuilder and show.jbuilder are reasonably deduped
6
+
7
+ this_key = [ map.id, map.updated_at, params.permit! ]
6
8
  json.cache! this_key do
7
9
  json.map do
8
10
  json.id map.id.to_s
@@ -16,6 +18,16 @@ json.cache! this_key do
16
18
 
17
19
  json.partial! 'ishapi/markers/index', map: map
18
20
 
21
+ ## I removed json parsing from here! _vp_ 2021-10-14
22
+ ## I added json parsing here! _vo_ 2021-10-19
23
+ if map.parent_slug.present?
24
+ json.config JSON.parse @map.parent.config
25
+ json.labels JSON.parse @map.parent.labels
26
+ else
27
+ json.config JSON.parse @map.config
28
+ json.labels JSON.parse @map.labels
29
+ end
30
+
19
31
  end
20
32
  end
21
33
 
@@ -26,18 +26,18 @@ json.cache! this_key do
26
26
  end
27
27
  end
28
28
 
29
+ ## Hmm with austin -> wasya_co , neither config nor labels can be used from parent.
30
+ # if @map.parent_slug.present?
31
+ # json.config JSON.parse @map.parent.config
32
+ # json.labels JSON.parse @map.parent.labels
33
+ # else
29
34
  ## 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
35
+ ## I added json parsing here! _vo_ 2021-10-19
36
+ json.config JSON.parse @map.config
37
+ json.labels JSON.parse @map.labels
37
38
 
38
39
  json.partial! 'ishapi/markers/index', map: @map
39
40
 
40
- puts! @newsitems, 'these first'
41
41
  if @newsitems
42
42
  json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
43
43
  end
@@ -17,10 +17,10 @@ json.newsitems do
17
17
  json.id item.gallery_id.to_s
18
18
  json.item_type item.gallery.class.name
19
19
  json.name item.gallery.name
20
- json.galleryname item.gallery.galleryname
20
+ json.slug item.gallery.slug
21
21
  json.username item.username || item.gallery.username || 'donor-default'
22
22
  json.n_photos item.gallery.photos.length
23
- json.slug item.gallery.galleryname
23
+ json.slug item.gallery.slug
24
24
  json.subhead item.gallery.subhead
25
25
  json.partial! 'ishapi/application/meta', :item => item.gallery
26
26
  if item.gallery.is_premium
@@ -1,15 +1,15 @@
1
1
 
2
2
 
3
- json.name @profile.name
4
- # json.username @profile.username
5
- json.email @profile.email
3
+ json.name @profile.name
4
+ json.username @profile.username
5
+ json.email @profile.email
6
+ json.profile_photo_url @profile.profile_photo.photo.url( :thumb ) if @profile.profile_photo
6
7
 
7
8
  json.n_reports @profile.reports.count
8
9
  json.n_galleries @profile.galleries.count
9
10
  json.n_videos @profile.videos.count
10
- json.n_stars @profile.n_stars
11
-
12
- json.n_unlocks @profile.n_unlocks
11
+ json.n_stars @profile.n_stars # @TODO: which one is deprecated?
12
+ json.n_unlocks @profile.n_unlocks # @TODO: which one is deprecated?
13
13
 
14
14
  if @profile.current_city
15
15
  json.current_city @profile.current_city
data/config/routes.rb CHANGED
@@ -19,8 +19,8 @@ Ishapi::Engine.routes.draw do
19
19
 
20
20
  get 'galleries', :to => 'galleries#index'
21
21
  post 'galleries', :to => 'galleries#index'
22
- get 'galleries/view/:galleryname', :to => 'galleries#show'
23
- post 'galleries/view/:galleryname', :to => 'galleries#show'
22
+ get 'galleries/view/:slug', :to => 'galleries#show'
23
+ post 'galleries/view/:slug', :to => 'galleries#show'
24
24
 
25
25
  post 'invoices/search', :to => 'invoices#search'
26
26
 
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.156
4
+ version: 0.1.8.160
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-17 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails