ishapi 0.1.8.214 → 0.1.8.215

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58df7355b06e137c32c5c076108df226222315a82816ee0ffa2db20014eb93af
4
- data.tar.gz: 5d901f1a635f0756cdc49e8113faa20c84374f5d6d2d4e545979e7f99fb53399
3
+ metadata.gz: 908d42fcfe99cabb27c82e7c99144efe71ff92ce74b96bfcf85162b2dd14141c
4
+ data.tar.gz: cea7d86798ed13c2835396d141bfc6e796bb45f4ce42508fc9c46ed3a5523ab7
5
5
  SHA512:
6
- metadata.gz: 64f74a5d1fa78d4a6581fa023dfc8a9918423870659a2ffdbd1e8978c5346a0a2f78ac525ecd023f0bc9e6776cda06eefecaf042d6810f6c07f1dbbc786aefb1
7
- data.tar.gz: f4201ad33e8703999bc6bf96e8b5f31cf16c6d2993065b1287d73075a5e56100f98715ef220e2dc06c0ff115414bc8e5613081b3203c0544fd0b3bb711024f3a
6
+ metadata.gz: a5e3a23fcba44eea22651cdb19e4458bb3e62df19b402ecd64749f9d47ae0c2da185f97a9e47bda05e385c98cadbe51d7e8cca5ea9f225b3862aa4b4d741d26c
7
+ data.tar.gz: eb0658150810d1ec02dbe487161fffb4992cb0d67734987b1992f24f7097a88e53cea1010b1de6988b5b6db5d39df9b1577c07eab2ef494f39f4b84e79abcf2d
@@ -10,6 +10,6 @@
10
10
  * files in this directory. Styles in this file should be added after the last require_* statement.
11
11
  * It is generally better to create a new file per style scope.
12
12
  *
13
- *= require_tree .
13
+ *= require ./galleries.scss
14
14
  *= require_self
15
15
  */
@@ -0,0 +1,46 @@
1
+
2
+ .galleries-show {
3
+ // border: 1px solid gray;
4
+
5
+ width: 910px;
6
+ margin: auto;
7
+
8
+ padding: 3em 0;
9
+
10
+ .photos-mini {
11
+ display: flex;
12
+ flex-wrap: wrap;
13
+
14
+ margin-bottom: 1em;
15
+ }
16
+
17
+ .photos-thumb {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+
21
+ margin-bottom: 1em;
22
+
23
+ img {
24
+ width: 100px;
25
+ }
26
+ }
27
+
28
+ .photos-large {
29
+ .item {
30
+ background: #eee;
31
+ border: 1px solid gray;
32
+
33
+ margin: 1em 0;
34
+
35
+ display: flex;
36
+ flex-direction: column;
37
+ align-items: center;
38
+
39
+ img {
40
+ margin: 2em;
41
+ }
42
+
43
+ }
44
+ }
45
+
46
+ }
@@ -17,16 +17,38 @@ module Ishapi
17
17
  end
18
18
 
19
19
  def show
20
- @gallery = ::Gallery.unscoped.find_by :slug => params[:slug]
20
+ @gallery = ::Gallery.unscoped.where( slug: params[:slug] ).first
21
+ @gallery ||= ::Gallery.unscoped.where( id: params[:slug] ).first
21
22
  authorize! :show, @gallery
22
- if @gallery.premium?
23
- if @current_user&.profile&.has_premium_purchase( @gallery )
24
- render 'show_premium_unlocked'
25
- else
26
- render 'show_premium_locked'
23
+
24
+ @photos = @gallery.photos.order_by( ordering: :asc )
25
+ respond_to do |format|
26
+ format.json do
27
+
28
+ if @gallery.premium?
29
+ if @current_user&.profile&.has_premium_purchase( @gallery )
30
+ render 'show_premium_unlocked'
31
+ else
32
+ render 'show_premium_locked'
33
+ end
34
+ else
35
+ render 'show'
36
+ end
37
+
38
+ end
39
+ format.html do
40
+
41
+ if @gallery.premium?
42
+ if @current_user&.profile&.has_premium_purchase( @gallery )
43
+ render 'show_premium_unlocked'
44
+ else
45
+ render 'show_premium_locked'
46
+ end
47
+ else
48
+ render 'show'
49
+ end
50
+
27
51
  end
28
- else
29
- render 'show'
30
52
  end
31
53
  end
32
54
 
@@ -24,6 +24,7 @@ module Ishapi
24
24
  end
25
25
  end
26
26
 
27
+ ## this is in scratchpadjs / done
27
28
  =begin
28
29
 
29
30
  SELECT symbol, bid, ask, MAX(`timestamp`) as a
@@ -76,7 +76,7 @@ class Ishapi::Ability
76
76
  #
77
77
  # O
78
78
  #
79
- # can [ :view_chain ], ::Iro::OptionPriceItem
79
+ can [ :view_chain ], ::Iro::OptionPriceItem
80
80
 
81
81
  #
82
82
  # P
@@ -10,7 +10,7 @@ json.name gallery.name
10
10
  json.slug gallery.slug
11
11
  json.description gallery.description
12
12
  json.username gallery.username || 'piousbox'
13
- json.n_photos gallery.photos.length
13
+ json.n_photos photos.length
14
14
  json.slug gallery.slug
15
15
  json.subhead gallery.subhead
16
16
  json.partial! 'ishapi/application/meta', :item => gallery
@@ -18,7 +18,7 @@ if gallery.is_premium
18
18
  json.premium_tier gallery.premium_tier
19
19
  json.is_premium gallery.premium_tier > 0
20
20
  json.is_purchased @current_profile&.has_premium_purchase( gallery )
21
- json.partial! 'ishapi/photos/index', :photos => [ gallery.photos[0] ]
21
+ json.partial! 'ishapi/photos/index', :photos => [ photos[0] ]
22
22
  else
23
- json.partial! 'ishapi/photos/index', :photos => gallery.photos
23
+ json.partial! 'ishapi/photos/index', :photos => photos
24
24
  end
@@ -0,0 +1,20 @@
1
+
2
+ .galleries-show
3
+
4
+ .header
5
+ %h2.title= @gallery.name
6
+
7
+ .photos-mini
8
+ - @photos.each do |photo|
9
+ .item= image_tag photo.photo.url( :mini )
10
+ .photos-thumb
11
+ - @photos.each do |photo|
12
+ .item= image_tag photo.photo.url( :thumb2 )
13
+ .photos-large
14
+ - @photos.each do |photo|
15
+ .item= image_tag photo.photo.url( :large )
16
+
17
+ -# json.thumb_url photo.photo.url( :thumb )
18
+ -# json.small_url photo.photo.url( :small )
19
+ -# json.large_url photo.photo.url( :large )
20
+ -# json.original_url photo.photo.url( :original )
@@ -6,7 +6,7 @@ this_key = [ @gallery, params.permit! ]
6
6
  json.cache! this_key do
7
7
  json.gallery do
8
8
  json.partial! 'ishapi/application/meta', item: @gallery
9
- json.partial! 'ishapi/galleries/show', gallery: @gallery
9
+ json.partial! 'ishapi/galleries/show', gallery: @gallery, photos: @photos
10
10
  end
11
11
  end
12
12
 
@@ -12,6 +12,7 @@ json.array! @opis do |opi|
12
12
  json.last opi.last
13
13
  # json.lastPrice opi.lastPrice
14
14
  # json.open opi.openPrice
15
- json.timestamp opi.timestamp
15
+ json.timestamp opi.timestamp.strftime('%H:%M:%S')
16
+ json.seconds opi.timestamp.to_i
16
17
  end
17
18
 
@@ -6,6 +6,14 @@
6
6
 
7
7
  json.photos do
8
8
  json.array! photos do |photo|
9
- json.partial! 'ishapi/photos/show', :photo => photo
9
+
10
+ json.mini_url photo.photo.url( :mini )
11
+ json.thumb_url photo.photo.url( :thumb2 )
12
+ json.small_url photo.photo.url( :small )
13
+ json.large_url photo.photo.url( :large )
14
+ json.original_url photo.photo.url( :original )
15
+
16
+ json.name photo.name
17
+
10
18
  end
11
19
  end
@@ -0,0 +1,38 @@
1
+ -#
2
+ -# copied from ish_manager layout application
3
+ -#
4
+
5
+ !!!
6
+ %html
7
+ %head
8
+ %title #{@page_title}| PiousboxCMS
9
+ %link{ :rel => 'icon', :href => "/favicon_#{ENV['RAILS_ENV']}.gif" }
10
+ %meta{ :name => :viewport, :content => 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=2' }
11
+ %meta{ :charset => 'UTF-8' }
12
+ %meta{ :description => @page_description }
13
+
14
+ = javascript_include_tag "//code.jquery.com/jquery-3.3.1.min.js"
15
+
16
+ = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
17
+ = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
18
+
19
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
20
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"
21
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
22
+
23
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/css/select2.min.css"
24
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/js/select2.min.js"
25
+
26
+ - # @TODO: document? test-drive?
27
+ - if @include_materialize
28
+ = stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
29
+ = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"
30
+
31
+ = stylesheet_link_tag "ishapi/application", media: "all"
32
+ = javascript_include_tag "ishapi/application"
33
+
34
+ = csrf_meta_tags
35
+ %body
36
+ = yield
37
+
38
+
data/config/routes.rb CHANGED
@@ -50,7 +50,7 @@ Ishapi::Engine.routes.draw do
50
50
 
51
51
 
52
52
  # resources :option_price_items
53
- get 'option_price_items/view-by/symbol/:symbol', to: 'option_price_items#view_by_symbol' ## the symbol is detailed eg 'GME_011924P30'
53
+ get 'option_price_items/view-by/symbol/:symbol', to: 'option_price_items#view_by_symbol', :constraints => { :symbol => /[^\/]+/ } ## the symbol is detailed eg 'GME_011924P30'
54
54
  get 'option_price_items/view/:symbol/from/:begin_at/to/:end_at', to: 'option_price_items#view'
55
55
 
56
56
 
data/lib/ishapi.rb CHANGED
@@ -5,5 +5,4 @@ require 'kaminari/mongoid'
5
5
  require 'kaminari/actionview'
6
6
 
7
7
  module Ishapi
8
- # Your code goes here...
9
8
  end
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.214
4
+ version: 0.1.8.215
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-07 00:00:00.000000000 Z
11
+ date: 2023-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -205,7 +205,7 @@ files:
205
205
  - app/assets/config/ishapi_manifest.js
206
206
  - app/assets/javascripts/ishapi/application.js
207
207
  - app/assets/stylesheets/ishapi/application.css
208
- - app/assets/stylesheets/ishapi/articles.css
208
+ - app/assets/stylesheets/ishapi/galleries.scss
209
209
  - app/assets/stylesheets/scaffold.css
210
210
  - app/controllers/ishapi/addresses_controller.rb
211
211
  - app/controllers/ishapi/application_controller.rb
@@ -244,7 +244,8 @@ files:
244
244
  - app/views/ishapi/galleries/_index.jbuilder
245
245
  - app/views/ishapi/galleries/_show.jbuilder
246
246
  - app/views/ishapi/galleries/index.jbuilder
247
- - app/views/ishapi/galleries/show.jbuilder
247
+ - app/views/ishapi/galleries/show.html.haml
248
+ - app/views/ishapi/galleries/show.json.jbuilder
248
249
  - app/views/ishapi/galleries/show_premium_locked.jbuilder
249
250
  - app/views/ishapi/galleries/show_premium_unlocked.jbuilder
250
251
  - app/views/ishapi/mailer/confirmation_instructions.html.erb
@@ -281,6 +282,7 @@ files:
281
282
  - app/views/ishapi/videos/_index.jbuilder
282
283
  - app/views/ishapi/videos/_show.jbuilder
283
284
  - app/views/ishapi/videos/index.jbuilder
285
+ - app/views/layouts/ishapi/application.html.haml
284
286
  - config/routes.rb
285
287
  - lib/ishapi.rb
286
288
  - lib/ishapi/engine.rb
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */