ish_manager 0.1.8.284 → 0.1.8.289

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/application.js +2 -2
  3. data/app/assets/stylesheets/ish_manager/application.scss +10 -2
  4. data/app/controllers/ish_manager/application_controller.rb +1 -1
  5. data/app/controllers/ish_manager/galleries_controller.rb +5 -4
  6. data/app/controllers/ish_manager/image_assets_controller.rb +10 -0
  7. data/app/controllers/ish_manager/maps_controller.rb +81 -1
  8. data/app/controllers/ish_manager/markers_controller.rb +6 -1
  9. data/app/controllers/ish_manager/sites_controller.rb +46 -48
  10. data/app/helpers/ish_manager/images_helper.rb +38 -37
  11. data/app/models/ish_manager/ability.rb +5 -2
  12. data/app/views/ish_manager/application/_debug.haml +2 -1
  13. data/app/views/ish_manager/application/_main_header_admin.haml +6 -2
  14. data/app/views/ish_manager/image_assets/index.haml +6 -0
  15. data/app/views/ish_manager/maps/_form.haml +4 -0
  16. data/app/views/ish_manager/maps/index.haml +8 -1
  17. data/app/views/ish_manager/maps/map_editor.haml +2 -17
  18. data/app/views/ish_manager/maps/show.haml +10 -2
  19. data/app/views/ish_manager/markers/_index_small.haml +28 -0
  20. data/app/views/ish_manager/photos/_meta.haml +2 -2
  21. data/app/views/ish_manager/{option_watches → trash/option_watches-trash}/_form.haml +0 -0
  22. data/app/views/ish_manager/{stock_actions → trash/stock_actions}/_form.haml +0 -0
  23. data/app/views/ish_manager/{stock_actions → trash/stock_actions}/index.haml +0 -0
  24. data/app/views/ish_manager/{stock_options → trash/stock_options}/_form.haml +0 -0
  25. data/app/views/ish_manager/{stock_options → trash/stock_options}/index.haml +0 -0
  26. data/app/views/ish_manager/{stock_watches → trash/stock_watches}/_form.haml +0 -0
  27. data/app/views/ish_manager/{stock_watches → trash/stock_watches}/index.haml +0 -0
  28. data/app/views/ish_manager/videos/show.haml +1 -1
  29. data/app/views/layouts/ish_manager/README.txt +3 -0
  30. data/app/views/layouts/ish_manager/application.haml +1 -0
  31. data/app/views/layouts/ish_manager/application.haml-trash +40 -0
  32. data/app/views/layouts/ish_manager/application2.haml +17 -15
  33. data/config/routes.rb +5 -0
  34. data/config/systemd/system/README.txt +3 -0
  35. data/{lib/systemd/system/watch_stocks.service → config/systemd/system/stockwatcher.service} +0 -0
  36. data/config/systemd/system/watch_stocks.service +13 -0
  37. data/lib/ish_manager/engine.rb +1 -0
  38. data/lib/ish_manager.rb +1 -0
  39. data/lib/tasks/ish_manager_tasks.rake +7 -0
  40. data/lib/tasks/migrate.rake +16 -1
  41. data/lib/tasks/{warbler_tasks.rake → warbler_tasks.rake-trash} +12 -0
  42. metadata +104 -32
  43. data/app/controllers/ish_manager/features_controller.rb +0 -150
  44. data/app/controllers/ish_manager/option_watches_controller.rb +0 -60
  45. data/app/controllers/ish_manager/stock_watches_controller.rb +0 -63
  46. data/app/views/ish_manager/application/_main_header_admin.haml-trash +0 -21
  47. data/app/views/ish_manager/maps/index.haml-trash +0 -17
  48. data/app/views/layouts/ish_manager/application.haml +0 -40
@@ -1,150 +0,0 @@
1
-
2
- class IshManager::FeaturesController < IshManager::ApplicationController
3
-
4
- before_action :set_lists
5
-
6
- def new
7
- if params[:city_id]
8
- @city = City.find params[:city_id]
9
- authorize! :new_feature, @city
10
- elsif params[:site_id]
11
- @site = Site.find params[:site_id]
12
- authorize! :new_feature, @site
13
- elsif params[:tag_id]
14
- @tag = Tag.find params[:tag_id]
15
- authorize! :new_feature, @tag
16
- end
17
-
18
- @feature = Feature.new
19
- end
20
-
21
- def create
22
- @feature = Feature.new params[:feature].permit!
23
-
24
- if params[:city_id]
25
- @city = City.find params[:city_id]
26
- authorize! :create_feature, @city
27
- @city.features << @feature
28
- @city.touch
29
- redirect_path = cities_path
30
- end
31
- if params[:site_id]
32
- @site = Site.find params[:site_id]
33
- authorize! :create_feature, @site
34
- @site.features << @feature
35
- @site.touch
36
- redirect_path = sites_path
37
- end
38
- if params[:tag_id]
39
- @tag = Tag.find params[:tag_id]
40
- authorize! :create_feature, @tag
41
- @tag.features << @feature
42
- @tag.touch
43
- redirect_path = tags_path
44
- end
45
-
46
- if (@city && @city.save) || (@site && @site.save) || (@tag && @tag.save)
47
- flash[:notice] = 'Success.'
48
- redirect_to redirect_path
49
- else
50
- flash[:alert] = "No luck: #{pp_errors @feature.errors.messages}"
51
- render :action => :new
52
- end
53
- end
54
-
55
- def edit
56
- if params[:city_id]
57
- @city = City.find params[:city_id]
58
- @feature = @city.features.find params[:id]
59
- authorize! :edit_feature, @city
60
- end
61
-
62
- if params[:site_id]
63
- @site = Site.find params[:site_id]
64
- @feature = @site.features.find params[:id]
65
- authorize! :edit_feature, @site
66
- end
67
-
68
- if params[:tag_id]
69
- @tag = Tag.find params[:tag_id]
70
- @feature = @tag.features.find params[:id]
71
- authorize! :edit_feature, @tag
72
- end
73
-
74
- if params[:venue_id]
75
- @venue = Tag.find params[:venue_id]
76
- @feature = @venue.features.find params[:id]
77
- authorize! :edit_feature, @venue
78
- end
79
-
80
- end
81
-
82
- def update
83
- unless params[:city_id].blank?
84
- @city = City.find params[:city_id]
85
- authorize! :update_feature, @city
86
- @feature = @city.features.find params[:id]
87
- redirect_path = city_path( @city )
88
- end
89
- unless params[:site_id].blank?
90
- @site = Site.find params[:site_id]
91
- authorize! :update_feature, @site
92
- @feature = @site.features.find params[:id]
93
- redirect_path = site_path( @site )
94
- end
95
- unless params[:tag_id].blank?
96
- @tag = Tag.find params[:tag_id]
97
- authorize! :update_feature, @tag
98
- @feature = @tag.features.find params[:id]
99
- redirect_path = tag_path( @tag )
100
- end
101
-
102
- authorize! :update, @feature
103
-
104
- if @feature.update_attributes params[:feature].permit!
105
- @city.touch if @city
106
- @site.touch if @site
107
- @tag.touch if @tag
108
-
109
- flash[:notice] = 'updated feature'
110
- redirect_to redirect_path
111
- else
112
- flash[:alert] = 'No Luck. ' + @feature.errors.messages
113
- render :action => :edit
114
- end
115
- end
116
-
117
- def index
118
- if params[:tag_id]
119
- @resource = Tag.find params[:tag_id]
120
- end
121
- if params[:site_id]
122
- @resource = Site.find params[:site_id]
123
- end
124
- authorize! :features_index, @resource
125
- @features = @resource.features
126
- end
127
-
128
- def destroy
129
- if params[:tag_id]
130
- @resource = Tag.find params[:tag_id]
131
- elsif params[:city_id]
132
- @resource = City.find params[:city_id]
133
- elsif params[:site_id]
134
- @resource = Site.find params[:site_id]
135
- end
136
- authorize! :destroy_feature, @resource
137
- @feature = @resource.features.find params[:id]
138
- authorize! :destroy, @feature
139
-
140
- if @feature.destroy
141
- @resource.touch
142
- flash[:notice] = 'Success.'
143
- else
144
- flash[:alert] = "No luck. " + @feature.errors.messages
145
- end
146
- redirect_to request.referrer
147
- end
148
-
149
- end
150
-
@@ -1,60 +0,0 @@
1
-
2
- class IshManager::OptionWatchesController < IshManager::ApplicationController
3
-
4
- layout 'ish_manager/application2'
5
-
6
- ## alphabetized : )
7
-
8
- def create
9
- @option_watch = Warbler::OptionWatch.new permitted_params
10
- authorize! :create, @option_watch
11
- flag = @option_watch.save
12
- if flag
13
- flash[:notice] = 'Created option watch.'
14
- else
15
- flash[:alert] = "Cannot create option watch: #{@option_watch.errors.messages}"
16
- end
17
- redirect_to controller: 'stock_watches', action: 'index'
18
- end
19
-
20
- def destroy
21
- @w = Warbler::StockWatch.find params[:id]
22
- authorize! :destroy, @w
23
- flag = @w.destroy
24
- if flag
25
- flash[:notice] = 'Success.'
26
- else
27
- flash[:alert] = @w.errors.messages
28
- end
29
- redirect_to controller: 'stock_watches', action: 'index'
30
- end
31
-
32
- def index
33
- authorize! :open_permission, IshManager::Ability
34
- flash[:notice] = 'Redirected option->stock watch index'
35
- # redirect_to controller: IshManager::StockWatchesController, action: 'index'
36
- redirect_to controller: 'stock_watches', action: 'index'
37
- end
38
-
39
- def update
40
- @option_watch = Warbler::OptionWatch.find params[:id]
41
- authorize! :update, @option_watch
42
- flag = @option_watch.update_attributes permitted_params
43
- if flag
44
- flash[:notice] = 'Updated option watch.'
45
- else
46
- flash[:alert] = "Cannot update option watch: #{@option_watch.errors.messages}"
47
- end
48
- redirect_to controller: 'stock_watches', action: 'index'
49
- end
50
-
51
- private
52
-
53
- def permitted_params
54
- params[:warbler_option_watch].permit!
55
- end
56
-
57
- end
58
-
59
-
60
-
@@ -1,63 +0,0 @@
1
-
2
- class IshManager::StockWatchesController < IshManager::ApplicationController
3
-
4
- layout 'ish_manager/application2'
5
-
6
- ## alphabetized : )
7
-
8
- def create
9
- @stock_watch = Warbler::StockWatch.new permitted_params
10
- authorize! :create, @stock_watch
11
- flag = @stock_watch.save
12
- if flag
13
- flash[:notice] = 'Created stock watch.'
14
- else
15
- flash[:alert] = "Cannot create stock watch: #{@stock_watch.errors.messages}"
16
- end
17
- redirect_to :action => 'index'
18
- end
19
-
20
- def destroy
21
- @w = Warbler::StockWatch.find params[:id]
22
- authorize! :destroy, @w
23
- flag = @w.destroy
24
- if flag
25
- flash[:notice] = 'Success.'
26
- else
27
- flash[:alert] = @w.errors.messages
28
- end
29
- redirect_to action: 'index'
30
- end
31
-
32
- def index
33
- authorize! :index, Warbler::StockWatch
34
- @profiles = Ish::UserProfile.all
35
- @stock_watches = Warbler::StockWatch.order_by( ticker: :asc, direction: :asc, price: :desc
36
- ).includes( :profile )
37
- @stock_watch = Warbler::StockWatch.new
38
- @option_watches = Warbler::OptionWatch.order_by( ticker: :asc, direction: :asc, price: :desc ).includes( :profile )
39
- @option_watch = Warbler::OptionWatch.new
40
- end
41
-
42
- def update
43
- @stock_watch = Warbler::StockWatch.find params[:id]
44
- authorize! :update, @stock_watch
45
- flag = @stock_watch.update_attributes permitted_params
46
- if flag
47
- flash[:notice] = 'Updated stock watch.'
48
- else
49
- flash[:alert] = "Cannot update stock watch: #{@stock_watch.errors.messages}"
50
- end
51
- redirect_to :action => 'index'
52
- end
53
-
54
- private
55
-
56
- def permitted_params
57
- params[:warbler_stock_watch].permit!
58
- end
59
-
60
- end
61
-
62
-
63
-
@@ -1,21 +0,0 @@
1
-
2
-
3
- -# %li{ :class => params[:controller] == 'ish_manager/sites' ? 'active' : '' }= link_to 'Sites', sites_path
4
- -# %li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }= link_to 'Tags', tags_path
5
- -# %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
6
- -# %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
7
- -# %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
8
- -# %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
9
- - proc do # nothing
10
- %ul.nav.nav-pills
11
- -# %li{ :class => params[:controller] == 'ish_manager/stock_actions' ? 'active' : '' }= link_to 'Stock Actions', stock_actions_path
12
- -# %li{ :class => params[:controller] == 'ish_manager/stock_options' ? 'active' : '' }= link_to 'Stock Options', stock_options_path
13
- -# %li{ :class => params[:controller] == 'ish_manager/iron_condors' ? 'active' : '' }= link_to 'Iron Condors', iron_condors_path
14
- -# %li{ :class => params[:controller] == 'ish_manager/covered_calls' ? 'active' : '' }= link_to 'Covered Calls', covered_calls_path
15
- %ul.nav.nav-pills
16
- %li{ :class => params[:controller] == 'ish_manager/invoices' ? 'active' : '' }= link_to 'Invoices', invoices_path
17
- %li{ :class => params[:controller] == 'ish_manager/payments' ? 'active' : '' }= link_to 'Payments', payments_path
18
- %li{ :class => params[:controller] == 'ish_manager/orders' ? 'active' : '' }= link_to 'Orders', orders_path
19
- %ul.nav.nav-pills
20
- %li{ :class => params[:controller] == 'ish_manager/leads' ? 'active' : '' }= link_to 'Leads', leads_path
21
- %li{ :class => params[:controller] == 'ish_manager/campaigns' ? 'active' : '' }= link_to 'Campaigns', campaigns_path
@@ -1,17 +0,0 @@
1
-
2
- .maps-index
3
- %h1 Maps #{link_to '[+]', new_map_path}
4
- - @maps.each do |map|
5
- .item
6
- .col
7
- = render 'map_meta_row', map: map
8
- .col
9
- .row
10
- .a Markers (#{map.markers.length})
11
- .a #{button_to '+', new_map_marker_path(map), method: :get}
12
- %ul.markers
13
- - map.markers.each do |marker|
14
- %li
15
- = marker.slug
16
- = link_to '[~]', edit_marker_path(marker)
17
-
@@ -1,40 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title Ish Manager
5
- %link{ :rel => 'icon', :href => "/favicon_#{ENV['RAILS_ENV']}.gif" }
6
- %meta{ :name => :viewport, :content => 'width=device-width, initial-scale=1.0' }
7
- %meta{ :charset => 'UTF-8' }
8
- %meta{ :description => 'some description' }
9
- %script{ :src => "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" }
10
- %script{ :src => "//cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/jquery.tinymce.min.js" }
11
- %script{ :src => "//cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/tinymce.min.js" }
12
- %script{ :src => "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" }
13
- = stylesheet_link_tag "//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
14
- = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
15
- = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
16
-
17
- = stylesheet_link_tag "ish_manager/materialize", media: "all"
18
- = stylesheet_link_tag "ish_manager/application", media: "all"
19
-
20
- = javascript_include_tag "ish_manager/application"
21
- = javascript_include_tag "ish_manager/materialize"
22
-
23
- = csrf_meta_tags
24
- %body{ class: [ params[:controller].gsub("ish_manager/",""), "#{params[:controller].gsub("ish_manager/","")}-#{params[:action]}", params[:action]] }
25
- .bg-white
26
- - role = current_user ? current_user.profile.role_name : ''
27
- = render :partial => "ish_manager/application/main_header_#{role}"
28
- .container
29
- .row
30
- .col.s12
31
- - if notice
32
- %p.notice= notice
33
- - if alert
34
- %p.alert= alert
35
- .container
36
- = yield
37
- = render 'ish_manager/application/main_footer'
38
- = render 'analytics' unless Rails.env.development?
39
- = render 'debug' if Rails.env.development?
40
-