ish_manager 0.1.8.401 → 0.1.8.403

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: be589998f18fd38b580126da0bfa392b6ad70bc1f599d3c2fa706c45a34590b7
4
- data.tar.gz: 1b17229b7e15682dffd49bb9267dc421f7d5e7411537ba9ddbdc9b86430ee0b8
3
+ metadata.gz: 8a3b2381f54eb7b66d392fbaa4051bd78ee53f1ad8b455f8a55db82a0c9fca62
4
+ data.tar.gz: 65a33aebdf8b15526dee6e37f62824b304f2a0672eef3e55ebd866dd072d5fe8
5
5
  SHA512:
6
- metadata.gz: be2e3ba6f631f0e157d70b3c6d6a4891a4f3e5cde14ca40a72f4636b14449a55859287535792fb600db763e205dd2b3efc222ddb230b9c3febd9af456afa18f0
7
- data.tar.gz: 281506080e7953135bd07161896c6e01467cc62c03ff8500907e0dfe3d8d5a21cbb7b8679b99564d46b37704d6c972ec7bf1d9c3ba93062b3ef36c2d55da4dd4
6
+ metadata.gz: a7284a7a74330a4878a4b2136e17aa3c8ac47079fcbb36fb758c7c8b8252bbcc84eb66c578789971af86bad0fa2b39568285d72024be5185fb7f632c01d5beaa
7
+ data.tar.gz: 047b94313ffef19b69373fdc99d918d9c4f9c4ab76e87d75256e086a8d0e9b12a0c891eb02bc259c32a8edb5bbc6b870733fc485b8cee2765300c58b147c9075
@@ -42,10 +42,20 @@ a[target='_blank'] {
42
42
  }
43
43
  html {
44
44
  height: 100%;
45
+ width: 100%;
46
+ // display: flex;
47
+ background: url('//d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2022/10/05192823/weather-bg.png');
45
48
  }
46
49
  body {
47
50
  background: #dedede;
48
51
  font-size: 20px;
52
+ width: 100%;
53
+ }
54
+
55
+ body.application-fullwidth {
56
+ // height: 100%;
57
+ // display: flex;
58
+ // flex-direction: column;
49
59
  }
50
60
  hr {
51
61
  background: red;
@@ -95,11 +105,6 @@ ul:not(.browser-default).bullets, {
95
105
  width: 100vwh;
96
106
  overflow-x: auto;
97
107
  }
98
- body.application-fullwidth {
99
- height: 100%;
100
- display: flex;
101
- flex-direction: column;
102
- }
103
108
  .application-home {
104
109
  .bordered-card {
105
110
  max-width: 400px;
@@ -70,6 +70,8 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
70
70
 
71
71
  if params[:notsent]
72
72
  @ctxs = @ctxs.where( sent_at: nil )
73
+ else
74
+ @ctxs = @ctxs.where( :sent_at.ne => nil )
73
75
  end
74
76
 
75
77
  if params[:lead_id]
@@ -0,0 +1,45 @@
1
+
2
+ class ::IshManager::IroPositionsController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ def create
7
+ @position = Iro::Position.new({
8
+ iro_purse: @purse = Iro::Purse.find_or_create_by({ user_id: current_user.id }),
9
+ type: 'Iro::CoveredCall',
10
+ })
11
+ authorize! :update, @position
12
+
13
+ if @position.update params[:position].permit!
14
+ flash[:notice] = 'Successfully updated position.'
15
+ redirect_to controller: 'iro_purses', action: :show
16
+ else
17
+ flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}."
18
+ render action: 'edit'
19
+ end
20
+ end
21
+
22
+ def edit
23
+ @position = Iro::Position.find params[:id]
24
+ authorize! :edit, @position
25
+ end
26
+
27
+ def new
28
+ @position = Iro::Position.new
29
+ authorize! :new, @position
30
+ end
31
+
32
+ def update
33
+ @position = Iro::Position.find params[:id]
34
+ authorize! :update, @position
35
+
36
+ if @position.update params[:position].permit!
37
+ flash[:notice] = 'Successfully updated position.'
38
+ redirect_to controller: 'iro_purses', action: :show
39
+ else
40
+ flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}."
41
+ render action: 'edit'
42
+ end
43
+ end
44
+
45
+ end
@@ -3,10 +3,11 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_lists
5
5
 
6
- def my
6
+ def show
7
7
  @purse = Iro::Purse.find_or_create_by({ user_id: current_user.id })
8
8
  authorize! :my, @purse
9
9
  @positions = @purse.positions.order({ expires_on: :asc, strike: :asc })
10
+ @positions.map &:refresh
10
11
  @strategies = Iro::CoveredCallStrategy.where({
11
12
  iro_purse_id: Iro::Purse.find_by( user_id: current_user.id ).id,
12
13
  })
@@ -2,7 +2,7 @@
2
2
  #Config{ data: { jwt_token: @jwt_token } }
3
3
 
4
4
  .manager--main-footer
5
- .container
5
+ .max-width
6
6
 
7
7
  %i.fa.fa-compress.collapse-expand#mainFooter
8
8
  Account & Session
@@ -58,7 +58,7 @@
58
58
  = link_to "Templates (#{Ish::EmailTemplate.all.count})", email_templates_path
59
59
  = link_to '[+]', new_email_template_path
60
60
  %li
61
- = link_to 'Contexts', notsent_email_contexts_path
61
+ = link_to "Contexts (#{Ctx.notsent.length})", notsent_email_contexts_path
62
62
  = link_to '[+]', new_email_context_path
63
63
  -# %li
64
64
  -# = link_to 'Campaigns', email_campaigns_path
@@ -3,16 +3,22 @@
3
3
 
4
4
  .header.collapse-expand-trash#emailContextsIndex
5
5
  %h2.title
6
+ - if params[:notsent]
7
+ <u>notsent</u>
8
+ = link_to '[sent]', sent_email_contexts_path
9
+ - else
10
+ = link_to '[notsent]', notsent_email_contexts_path
11
+ <u>sent</u>
6
12
  Email Contexts (#{@ctxs.length})
7
13
  - if @lead
8
14
  For lead `#{@lead.name}`
9
15
  = link_to '[+]', new_email_context_path
10
- = link_to '[unsent]', notsent_email_contexts_path
16
+
11
17
 
12
18
  .W0
13
19
  = render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
14
20
 
15
- %table.bordered.data-table
21
+ %table.bordered
16
22
  %thead
17
23
  %tr
18
24
  %th.actions
@@ -20,6 +26,8 @@
20
26
  %th.to To
21
27
  %th.subject Subject
22
28
  %th.template Template
29
+ %th.send_at Send at
30
+ %th.sent_at Sent at
23
31
  %tbody
24
32
  - @ctxs.each do |ctx|
25
33
  %tr
@@ -36,6 +44,8 @@
36
44
  = link_to email_context_path(ctx) do
37
45
  = ctx.subject ? ctx.subject : "t| #{ctx.tmpl.subject}"
38
46
  %td= ctx.email_template.slug
47
+ %td= pp_date ctx.send_at
48
+ %td= pp_date ctx.sent_at
39
49
 
40
50
 
41
51
  = render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
@@ -20,7 +20,7 @@
20
20
  %li <b>Send at:</b> #{@ctx.send_at&.strftime('%Y-%m-%d %l:%M%P')}
21
21
  %li <b>Sent at:</b> #{@ctx.sent_at&.strftime('%Y-%m-%d %l:%M%P')}
22
22
  %li
23
- = button_to 'Send', email_context_send_path(@ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
23
+ = button_to 'Send', send_email_context_path(@ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
24
24
  = link_to '[~]', edit_email_context_path(@ctx)
25
25
 
26
26
  .max-width
@@ -0,0 +1,34 @@
1
+
2
+ - url = position.new_record? ? iro_positions_path : iro_position_path( position )
3
+
4
+ .iro-positions--form
5
+ = form_for position, as: :position, url: url do |f|
6
+ .flex-row
7
+ .field Position ##{position.id}
8
+ .field
9
+ = f.label :strategy
10
+ = f.select :iro_strategy_id, options_for_select( Iro::CoveredCallStrategy.list, selected: position.iro_strategy_id ), {}, class: 'select2'
11
+ .field
12
+ = f.label :ticker
13
+ = f.text_field :ticker
14
+
15
+ .field
16
+ = f.label :strike
17
+ = f.number_field :strike, step: 0.01
18
+
19
+ .field
20
+ = f.label :expires_on
21
+ = f.text_field :expires_on
22
+ .field
23
+ = f.label :status
24
+ = f.select :status, options_for_select( Iro::Position.statuses_list, selected: position.status ), {}, class: 'select2'
25
+
26
+ .field
27
+ = f.label :opened_price
28
+ = f.text_field :opened_price
29
+ .field
30
+ = f.label :opened_on
31
+ = f.text_field :opened_on
32
+
33
+ .actions
34
+ = f.submit 'Submit'
@@ -0,0 +1,3 @@
1
+
2
+ .iro-positions-edit.padded
3
+ = render 'form', position: @position
@@ -0,0 +1,3 @@
1
+
2
+ .iro-positions-new.padded
3
+ = render 'form', position: @position
@@ -1,9 +1,10 @@
1
1
 
2
2
  .iro-purses-my.padded
3
3
  .header
4
- %h2.title My purse value: $#{@purse.current_value}
4
+ %h2.title Purse value: $#{@purse.current_value}
5
5
 
6
6
  .strategies
7
+ .title Strategies
7
8
  - @strategies.each do |strat|
8
9
  .strategy
9
10
  = link_to '[~]', edit_iro_strategy_path( strat )
@@ -11,13 +12,15 @@
11
12
 
12
13
 
13
14
  .positions
14
- %h3 Positions (#{@positions.length})
15
+ %h3
16
+ Positions (#{@positions.length})
17
+ = link_to '[+]', new_iro_position_path
15
18
 
16
19
  %table.bordered
17
20
  %thead
18
21
  %tr
19
22
  %td id
20
- %td Strat
23
+ %td Strategy
21
24
  %td Ticker
22
25
  %td Kind/Type
23
26
  %td Strike
@@ -40,8 +43,10 @@
40
43
  %tbody
41
44
  - @positions.each do |p|
42
45
  %tr
43
- %td= p.id
44
- %td= p.iro_strategy_id
46
+ %td
47
+ = p.id
48
+ = link_to '[~]', edit_iro_position_path(p)
49
+ %td= p.strategy
45
50
  %td= p.ticker
46
51
  %td= p.type == "Iro::CoveredCall" ? "CALL" : "other"
47
52
  %td= p.strike
data/config/routes.rb CHANGED
@@ -25,10 +25,11 @@ IshManager::Engine.routes.draw do
25
25
  # end
26
26
  # resources :orders
27
27
 
28
+ resources :iro_positions
28
29
 
29
30
  # get 'iro_watches', to: 'iro_watches#index'
30
31
  resources :iro_watches
31
- get 'iro_purse', to: 'iro_purses#my', as: :my_purse
32
+ get 'iro_purse', to: 'iro_purses#show', as: :my_purse
32
33
 
33
34
  resources :iro_strategies
34
35
 
@@ -73,9 +74,10 @@ IshManager::Engine.routes.draw do
73
74
  get 'email_contexts/for_lead/:lead_id', to: 'email_contexts#index', as: :email_contexts_for_lead
74
75
  get 'email_contexts/iframe_src/:id', to: 'email_contexts#iframe_src', as: :email_context_iframe
75
76
  get 'email_contexts/new_with_template/:template_slug', to: 'email_contexts#new'
76
- post 'email_contexts/send/:id', to: 'email_contexts#do_send', as: :email_context_send
77
- get 'email_contexts', to: 'email_contexts#index', as: :email_contexts, defaults: { notsent: false }
77
+ post 'email_contexts/send/:id', to: 'email_contexts#do_send', as: :send_email_context
78
+ get 'email_contexts', to: 'email_contexts#index', as: :email_contexts, defaults: { notsent: true }
78
79
  get 'email_contexts/notsent', to: 'email_contexts#index', as: :notsent_email_contexts, defaults: { notsent: true }
80
+ get 'email_contexts/sent', to: 'email_contexts#index', as: :sent_email_contexts, defaults: { notsent: false }
79
81
  resources :email_contexts
80
82
 
81
83
  get 'email_templates/iframe_src/:id', to: 'email_templates#iframe_src', as: :email_template_iframe
@@ -51,16 +51,14 @@ namespace :office do
51
51
  task email_worker: :environment do
52
52
  while true do
53
53
 
54
- ctxs = ::Ish::EmailContext.scheduled.unsent
55
- puts! ctxs.count, 'ctxs'
54
+ ctxs = ::Ish::EmailContext.scheduled.notsent
56
55
  ctxs.map do |ctx|
57
56
  IshManager::OfficeMailer.send_context_email( ctx[:id].to_s ).deliver_later
58
- print '.'
57
+ print '^'
59
58
  end
60
59
 
61
- # sleep 1.minute
62
- sleep 10.seconds
63
- print '^'
60
+ sleep 60 # seconds
61
+ print '.'
64
62
  end
65
63
  end
66
64
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.401
4
+ version: 0.1.8.403
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -320,6 +320,7 @@ files:
320
320
  - app/controllers/ish_manager/galleries_controller.rb
321
321
  - app/controllers/ish_manager/image_assets_controller.rb
322
322
  - app/controllers/ish_manager/invoices_controller.rb
323
+ - app/controllers/ish_manager/iro_positions_controller.rb
323
324
  - app/controllers/ish_manager/iro_purses_controller.rb
324
325
  - app/controllers/ish_manager/iro_strategies_controller.rb
325
326
  - app/controllers/ish_manager/iro_watches_controller.rb
@@ -478,7 +479,10 @@ files:
478
479
  - app/views/ish_manager/iro_mailer/condor_followup_alerb.html.erb
479
480
  - app/views/ish_manager/iro_mailer/option_alert.html.erb
480
481
  - app/views/ish_manager/iro_mailer/stock_alert.html.erb
481
- - app/views/ish_manager/iro_purses/my.haml
482
+ - app/views/ish_manager/iro_positions/_form.haml
483
+ - app/views/ish_manager/iro_positions/edit.haml
484
+ - app/views/ish_manager/iro_positions/new.haml
485
+ - app/views/ish_manager/iro_purses/show.haml
482
486
  - app/views/ish_manager/iro_strategies/_form.haml
483
487
  - app/views/ish_manager/iro_strategies/edit.haml
484
488
  - app/views/ish_manager/iro_strategies/new.haml