ish_manager 0.1.8.399 → 0.1.8.400
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ish_manager/iro_watches_controller.rb +37 -40
- data/app/mailers/ish_manager/application_mailer.rb +6 -3
- data/app/views/ish_manager/application_mailer/stock_alert.haml +4 -0
- data/app/views/ish_manager/iro_watches/_form.haml +26 -0
- data/app/views/ish_manager/iro_watches/index.haml +13 -0
- data/config/routes.rb +2 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e852f56630ecb6853fb58a102f50824fb8237f359d99033b35fb5735a1edf62
|
4
|
+
data.tar.gz: fffe66f056d0fde15b5553e1390902dffd49c3b4d093e56cd7886bccb5b95c43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce863f62c564c5245844ac2d3e7564a0766696ec4cf5ad3fbed01ae1423f7ceff4ca4f258fa91b976cbcb3c04662effa81b30aefab16703477dce61a9efa8b8
|
7
|
+
data.tar.gz: 800017a26feb619e985c6487d3c7fb3b563cb2154596bad08b9c88c0e7f92509e3b2fd10e30b344c0192f5fe8da2508e3488947ac947c15de264fdf68390774e
|
@@ -1,50 +1,47 @@
|
|
1
1
|
|
2
2
|
class ::IshManager::IroWatchesController < IshManager::ApplicationController
|
3
3
|
|
4
|
-
before_action :set_lists
|
5
|
-
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
# before_action :set_lists
|
5
|
+
|
6
|
+
def create
|
7
|
+
@option_watch = Iro::OptionWatch.new params[:iro_watch].permit!
|
8
|
+
authorize! :create, @option_watch
|
9
|
+
flag = @option_watch.save
|
10
|
+
if flag
|
11
|
+
flash[:notice] = 'Created option watch.'
|
12
|
+
else
|
13
|
+
flash[:alert] = "Cannot create option watch: #{@option_watch.errors.full_messages.join(', ')}."
|
14
|
+
end
|
15
|
+
redirect_to action: 'index'
|
10
16
|
end
|
11
17
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
# end
|
24
|
-
# redirect_to :action => 'index'
|
25
|
-
# end
|
26
|
-
|
27
|
-
# def update
|
28
|
-
# @invoice = Ish::Invoice.find params[:id]
|
29
|
-
# authorize! :update, @invoice
|
30
|
-
# if @invoice.update_attributes params[:invoice].permit!
|
31
|
-
# flash[:notice] = 'Success'
|
32
|
-
# redirect_to :action => 'index'
|
33
|
-
# else
|
34
|
-
# flash[:alert] = "Cannot update invoice: #{@invoice.errors.messages}"
|
35
|
-
# end
|
36
|
-
# redirect_to :action => 'index'
|
37
|
-
# end
|
18
|
+
def destroy
|
19
|
+
@w = Iro::OptionWatch.find params[:id]
|
20
|
+
authorize! :destroy, @w
|
21
|
+
flag = @w.destroy
|
22
|
+
if flag
|
23
|
+
flash[:notice] = 'Success.'
|
24
|
+
else
|
25
|
+
flash[:alert] = @w.errors.full_messages.join(", ")
|
26
|
+
end
|
27
|
+
redirect_to action: 'index'
|
28
|
+
end
|
38
29
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
30
|
+
def index
|
31
|
+
authorize! :index, Iro::OptionWatch
|
32
|
+
@watches = Iro::OptionWatch.order_by( ticker: :asc, direction: :asc, price: :desc)
|
33
|
+
end
|
43
34
|
|
44
|
-
def
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
def update
|
36
|
+
@option_watch = Iro::OptionWatch.find params[:id]
|
37
|
+
authorize! :update, @option_watch
|
38
|
+
flag = @option_watch.update_attributes params[:iro_watch].permit!
|
39
|
+
if flag
|
40
|
+
flash[:notice] = 'Updated option watch.'
|
41
|
+
else
|
42
|
+
flash[:alert] = "Cannot update option watch: #{@option_watch.errors.full_messages.join(', ')}."
|
43
|
+
end
|
44
|
+
redirect_to action: 'index'
|
48
45
|
end
|
49
46
|
|
50
47
|
end
|
@@ -20,9 +20,12 @@ module IshManager
|
|
20
20
|
mail( :to => option.profile.email, :subject => "IshManager Option Alert :: #{option.ticker}" ).deliver
|
21
21
|
end
|
22
22
|
|
23
|
-
def stock_alert
|
24
|
-
@
|
25
|
-
mail(
|
23
|
+
def stock_alert watch_id
|
24
|
+
@watch = Iro::OptionWatch.find watch_id
|
25
|
+
mail({
|
26
|
+
to: @watch.profile.email,
|
27
|
+
subject: "Iro Watch Alert :: #{@watch.ticker} is #{@watch.direction} #{@watch.mark}."
|
28
|
+
})
|
26
29
|
end
|
27
30
|
|
28
31
|
def test_email
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
- url = watch.new_record? ? iro_watches_path : iro_watch_path(watch)
|
3
|
+
.iro-watches--form
|
4
|
+
= form_for watch, url: url, as: :iro_watch do |f|
|
5
|
+
.flex-row
|
6
|
+
.form-group
|
7
|
+
= f.select :state, options_for_select( Iro::OptionWatch.states_list, selected: watch.state )
|
8
|
+
.form-group
|
9
|
+
= f.select :kind, options_for_select( Iro::OptionWatch.kinds_list, selected: watch.kind )
|
10
|
+
.form-group
|
11
|
+
-# = f.label :action
|
12
|
+
= f.select :action, options_for_select( Iro::OptionWatch.actions_list, :selected => watch.action )
|
13
|
+
.form-group
|
14
|
+
-# = f.label :profile
|
15
|
+
= f.select :profile, options_for_select( Ish::UserProfile.list, selected: watch.profile_id ), {}, class: 'select2'
|
16
|
+
.form-group
|
17
|
+
%label.control-label When
|
18
|
+
= f.text_field :ticker, :placeholder => 'ticker'
|
19
|
+
.form-group
|
20
|
+
%label.control-label is
|
21
|
+
= f.select :direction, options_for_select( Iro::OptionWatch.directions_list, selected: watch.direction )
|
22
|
+
.form-group
|
23
|
+
%label.control-label $
|
24
|
+
= f.number_field :mark, :step => 0.01, :placeholder => "0.01"
|
25
|
+
.form-group
|
26
|
+
= f.submit ">", :class => %w(btn blue)
|
data/config/routes.rb
CHANGED
@@ -26,7 +26,8 @@ IshManager::Engine.routes.draw do
|
|
26
26
|
# resources :orders
|
27
27
|
|
28
28
|
|
29
|
-
get 'iro_watches', to: 'iro_watches#index'
|
29
|
+
# get 'iro_watches', to: 'iro_watches#index'
|
30
|
+
resources :iro_watches
|
30
31
|
get 'iro_purse', to: 'iro_purses#my', as: :my_purse
|
31
32
|
|
32
33
|
resources :iro_strategies
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.400
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -394,6 +394,7 @@ files:
|
|
394
394
|
- app/views/ish_manager/application/_search.haml
|
395
395
|
- app/views/ish_manager/application/home.haml
|
396
396
|
- app/views/ish_manager/application_mailer/shared_galleries.html.erb
|
397
|
+
- app/views/ish_manager/application_mailer/stock_alert.haml
|
397
398
|
- app/views/ish_manager/application_mailer/test_email.html.erb
|
398
399
|
- app/views/ish_manager/application_mailer/welcome.html.erb
|
399
400
|
- app/views/ish_manager/categories/_subtree.haml
|
@@ -481,6 +482,8 @@ files:
|
|
481
482
|
- app/views/ish_manager/iro_strategies/_form.haml
|
482
483
|
- app/views/ish_manager/iro_strategies/edit.haml
|
483
484
|
- app/views/ish_manager/iro_strategies/new.haml
|
485
|
+
- app/views/ish_manager/iro_watches/_form.haml
|
486
|
+
- app/views/ish_manager/iro_watches/index.haml
|
484
487
|
- app/views/ish_manager/kaminari/_first_page.html.erb
|
485
488
|
- app/views/ish_manager/kaminari/_gap.html.erb
|
486
489
|
- app/views/ish_manager/kaminari/_last_page.html.erb
|