ishapi 0.1.8.214 → 0.1.8.216
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/app/assets/stylesheets/ishapi/application.css +1 -1
- data/app/assets/stylesheets/ishapi/galleries.scss +46 -0
- data/app/controllers/ishapi/application_controller.rb +5 -1
- data/app/controllers/ishapi/email_messages_controller.rb +25 -27
- data/app/controllers/ishapi/galleries_controller.rb +30 -8
- data/app/controllers/ishapi/option_price_items_controller.rb +1 -0
- data/app/models/ishapi/ability.rb +8 -6
- data/app/views/ishapi/galleries/_show.jbuilder +3 -3
- data/app/views/ishapi/galleries/show.html.haml +20 -0
- data/app/views/ishapi/galleries/{show.jbuilder → show.json.jbuilder} +1 -1
- data/app/views/ishapi/option_price_items/view.jbuilder +2 -1
- data/app/views/ishapi/photos/_index.jbuilder +9 -1
- data/app/views/layouts/ishapi/application.html.haml +38 -0
- data/config/routes.rb +4 -2
- data/lib/ishapi.rb +0 -1
- metadata +6 -4
- data/app/assets/stylesheets/ishapi/articles.css +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b4e60c93d07bd13c28c340d6b51321777dcac330990a03c82bb99d688a739a5
|
4
|
+
data.tar.gz: 8373154c3f3585cfb9f67ed53d0333f17ae6f2334ebe7942eb3de677ca8e9776
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec07c25202e7d248111642c1761d0e1a7f89fcb376edf8ffec62f0816748773a6e2e82ccc0d60df5c367da3bc422abcb4a6c257073f4a861eb72026388e9128b
|
7
|
+
data.tar.gz: baa34823abceb222b632f5295322aacedc61d0a72cd46f03aa4eec64fdcd19f8a0215444ccdfd503ead825d4d90e9a8fe35232b7633ac6cf6a993a76a85bad15
|
@@ -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
|
+
}
|
@@ -1,37 +1,35 @@
|
|
1
1
|
|
2
2
|
require_dependency "ishapi/application_controller"
|
3
3
|
|
4
|
-
|
5
|
-
class EmailMessagesController < ApplicationController
|
4
|
+
class ::Ishapi::EmailMessagesController < ::Ishapi::ApplicationController
|
6
5
|
|
7
|
-
|
6
|
+
before_action :check_jwt, only: [ :show ]
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
## From lambda, ses
|
18
|
-
def receive
|
19
|
-
if params[:secret] != AWS_SES_LAMBDA_SECRET
|
20
|
-
render status: 400, json: { status: 400 }
|
21
|
-
return
|
22
|
-
end
|
8
|
+
def show
|
9
|
+
msg = Office::EmailMessage.find( params[:id] )
|
10
|
+
authorize! :show, msg
|
11
|
+
render json: {
|
12
|
+
item: msg,
|
13
|
+
}
|
14
|
+
end
|
23
15
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
}
|
28
|
-
|
29
|
-
::Ishapi::EmailMessageIntakeJob.perform_later( msg.id.to_s )
|
30
|
-
render status: :ok, json: { status: :ok }
|
31
|
-
else
|
32
|
-
render status: 400, json: { status: 400 }
|
33
|
-
end
|
16
|
+
## From lambda, ses
|
17
|
+
def receive
|
18
|
+
if params[:secret] != AWS_SES_LAMBDA_SECRET
|
19
|
+
render status: 400, json: { status: 400 }
|
20
|
+
return
|
34
21
|
end
|
35
22
|
|
23
|
+
msg = Office::EmailMessageStub.new({
|
24
|
+
object_path: params[:object_path],
|
25
|
+
object_key: params[:object_key],
|
26
|
+
})
|
27
|
+
if msg.save
|
28
|
+
::Ishapi::EmailMessageIntakeJob.perform_later( msg.id.to_s )
|
29
|
+
render status: :ok, json: { status: :ok }
|
30
|
+
else
|
31
|
+
render status: 400, json: { status: 400 }
|
32
|
+
end
|
36
33
|
end
|
34
|
+
|
37
35
|
end
|
@@ -17,16 +17,38 @@ module Ishapi
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def show
|
20
|
-
@gallery = ::Gallery.unscoped.
|
20
|
+
@gallery = ::Gallery.unscoped.where( slug: params[:slug] ).first
|
21
|
+
@gallery ||= ::Gallery.unscoped.where( id: params[:slug] ).first
|
21
22
|
authorize! :show, @gallery
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
|
@@ -7,7 +7,7 @@ class Ishapi::Ability
|
|
7
7
|
#
|
8
8
|
# signed in user_profile
|
9
9
|
#
|
10
|
-
if
|
10
|
+
if user_profile.present?
|
11
11
|
|
12
12
|
can [ :my_index ], Gallery
|
13
13
|
can [ :show ], Gallery do |gallery|
|
@@ -29,13 +29,15 @@ class Ishapi::Ability
|
|
29
29
|
|
30
30
|
can [ :buy_stars ], ::Ish::UserProfile
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
##
|
33
|
+
## superuser
|
34
|
+
##
|
35
35
|
if %w| victor@wasya.co victor@piousbox.com piousbox@gmail.com |.include?( user_profile.email )
|
36
|
+
puts! user_profile, 'ze profile'
|
37
|
+
|
36
38
|
can [ :email_conversations_delete ], ::Ishapi
|
37
39
|
|
38
|
-
can [ :
|
40
|
+
can [ :show ], ::Office::EmailMessage
|
39
41
|
end
|
40
42
|
|
41
43
|
end
|
@@ -76,7 +78,7 @@ class Ishapi::Ability
|
|
76
78
|
#
|
77
79
|
# O
|
78
80
|
#
|
79
|
-
|
81
|
+
can [ :view_chain ], ::Iro::OptionPriceItem
|
80
82
|
|
81
83
|
#
|
82
84
|
# 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
|
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 => [
|
21
|
+
json.partial! 'ishapi/photos/index', :photos => [ photos[0] ]
|
22
22
|
else
|
23
|
-
json.partial! 'ishapi/photos/index', :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
|
|
@@ -6,6 +6,14 @@
|
|
6
6
|
|
7
7
|
json.photos do
|
8
8
|
json.array! photos do |photo|
|
9
|
-
|
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
@@ -4,6 +4,7 @@ Ishapi::Engine.routes.draw do
|
|
4
4
|
root :to => 'application#home'
|
5
5
|
post 'home', :to => 'application#home'
|
6
6
|
|
7
|
+
|
7
8
|
resources :addresses
|
8
9
|
|
9
10
|
get 'galleries', :to => 'galleries#index'
|
@@ -50,11 +51,12 @@ Ishapi::Engine.routes.draw do
|
|
50
51
|
|
51
52
|
|
52
53
|
# 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'
|
54
|
+
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
55
|
get 'option_price_items/view/:symbol/from/:begin_at/to/:end_at', to: 'option_price_items#view'
|
55
56
|
|
56
57
|
|
57
|
-
get 'test',
|
58
|
+
get 'test', to: 'application#test'
|
59
|
+
get 'exception', to: 'application#exception'
|
58
60
|
|
59
61
|
post 'users/fb_sign_in', to: 'users#fb_sign_in'
|
60
62
|
get 'users/me', to: 'users#account'
|
data/lib/ishapi.rb
CHANGED
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.
|
4
|
+
version: 0.1.8.216
|
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-
|
11
|
+
date: 2023-03-15 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/
|
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.
|
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
|