ish_manager 0.1.8.261 → 0.1.8.263

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: 006cc153f6fc7808e3cefb1afd2ecb8c333157a8466ff1602dfe7aeeda3bb1f9
4
- data.tar.gz: 61ad4d1e6fb8bf67a89aafd4efa9b404b7dc200751ff645451f809ec5ba7b83e
3
+ metadata.gz: 418646349055afb3072f68d9fc12527add24597969d62ce4ff4aa41eef0d879b
4
+ data.tar.gz: cc4e03f30e8c12df9227fb6424b33207f847ff12ef2bdf90df41dea1de2748e0
5
5
  SHA512:
6
- metadata.gz: 561450268ea240743abbbddca49574be06245a5779153da9c88836925d3ff8c65140e4b2a8a10eaf4b3192b0aca834085f30fb36ea0a1387d9d91ddc2342534f
7
- data.tar.gz: 4710b5f7bf35185586f158d884e82fd57cf37d5086bf54f67b4d1ed9ad87c77aa639115d0f517129c0a0069133ee6ae8e0d4857d4f1c727ed09ed9c78f39b327
6
+ metadata.gz: d04670dd256406a4c75dab4a62796dcfde3fb22f38ec65b738ac6f2fe972a33b32b8fcc43f5613861b8e7400a7d3dd92582613eb68a1be59f4acda1494697864
7
+ data.tar.gz: 104e3b96eef1193d21ba175122c8de72dba98f93e572af83af5654479dfe767860d3f654e669bb2634d0f8e6e9a678fb13381316cd4d568f6b792806b376026c
@@ -3,6 +3,8 @@ class IshManager::ReportsController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_lists
5
5
 
6
+ # alphabetized : )
7
+
6
8
  def create
7
9
  @report = Report.new params[:report].permit!
8
10
  @report.user_profile = current_user.profile # @TODO: this should not be hard-coded
@@ -40,12 +42,24 @@ class IshManager::ReportsController < IshManager::ApplicationController
40
42
  end
41
43
  end
42
44
 
45
+ def destroy
46
+ @report = Report.unscoped.find params[:id]
47
+ authorize! :destroy, @report
48
+ @report.is_trash = true
49
+ @report.save
50
+ redirect_to request.referrer
51
+ end
52
+
53
+ def edit
54
+ @report = Report.unscoped.find params[:id]
55
+ authorize! :edit, @report
56
+ end
57
+
43
58
  def index
44
59
  authorize! :index, Report
45
60
  @reports = Report.unscoped.order_by( :created_at => :desc
46
- ).where( :is_trash => false, :user_profile => current_user.profile
47
- ).page( params[:reports_page]
48
- ).per( Report::PER_PAGE )
61
+ ).where( :is_trash => false, :user_profile => current_user.profile
62
+ ).page( params[:reports_page] ).per( Report::PER_PAGE )
49
63
  if false === params[:site]
50
64
  @reports = @reports.where( :site_id => nil )
51
65
  end
@@ -53,24 +67,34 @@ class IshManager::ReportsController < IshManager::ApplicationController
53
67
  @site = Site.find params[:site_id]
54
68
  @reports = @reports.where( :site_id => params[:site_id] )
55
69
  end
70
+ if params[:q]
71
+ @reports = @reports.or({ slug: /#{params[:q]}/i }, { name: /#{params[:q]}}/i }) # @TODO: why can't I have space in search term?
72
+ if @reports.length == 1
73
+ redirect_to report_path(@reports[0])
74
+ return
75
+ end
76
+ end
56
77
  end
57
78
 
58
- def show
59
- @report = Report.unscoped.find params[:id]
60
- authorize! :show, @report
61
- end
79
+ def new
80
+ @report = Report.new
81
+ authorize! :new, @report
82
+ @tags_list = Tag.all.where( :is_public => true ).list
83
+ @sites_list = Site.all.list
84
+ @cities_list = City.list
85
+ @venues_list = Venue.all.list
62
86
 
63
- def edit
64
- @report = Report.unscoped.find params[:id]
65
- authorize! :edit, @report
87
+ respond_to do |format|
88
+ format.html do
89
+ render
90
+ end
91
+ format.json { render :json => @report }
92
+ end
66
93
  end
67
94
 
68
- def destroy
95
+ def show
69
96
  @report = Report.unscoped.find params[:id]
70
- authorize! :destroy, @report
71
- @report.is_trash = true
72
- @report.save
73
- redirect_to request.referrer
97
+ authorize! :show, @report
74
98
  end
75
99
 
76
100
  def update
@@ -95,23 +119,5 @@ class IshManager::ReportsController < IshManager::ApplicationController
95
119
  end
96
120
  end
97
121
 
98
- def new
99
- @report = Report.new
100
- authorize! :new, @report
101
- @tags_list = Tag.all.where( :is_public => true ).list
102
- @sites_list = Site.all.list
103
- @cities_list = City.list
104
- @venues_list = Venue.all.list
105
-
106
- respond_to do |format|
107
- format.html do
108
- render
109
- end
110
- format.json { render :json => @report }
111
- end
112
- end
113
-
114
-
115
-
116
122
  end
117
123
 
@@ -1,17 +1,8 @@
1
1
 
2
2
  class IshManager::StockWatchesController < IshManager::ApplicationController
3
3
 
4
- def index
5
- authorize! :index, Ish::StockWatch
6
- @profiles = Ish::UserProfile.all
7
- @stock_watches = Ish::StockWatch.order_by( ticker: :asc, direction: :asc, price: :desc
8
- ).includes( :profile )
9
- @stock_watch = Ish::StockWatch.new
10
- render 'index', :layout => 'ish_manager/application_no_materialize'
11
- end
12
-
13
4
  def create
14
- @stock_watch = Ish::StockWatch.new params[:ish_stock_watch].permit!
5
+ @stock_watch = Warbler::StockWatch.new permitted_params
15
6
  authorize! :create, @stock_watch
16
7
  flag = @stock_watch.save
17
8
  if flag
@@ -22,10 +13,31 @@ class IshManager::StockWatchesController < IshManager::ApplicationController
22
13
  redirect_to :action => 'index'
23
14
  end
24
15
 
16
+ def destroy
17
+ @w = Warbler::StockWatch.find params[:id]
18
+ authorize! :destroy, @w
19
+ flag = @w.destroy
20
+ if flag
21
+ flash[:notice] = 'Success.'
22
+ else
23
+ flash[:alert] = @w.errors.messages
24
+ end
25
+ redirect_to action: 'index'
26
+ end
27
+
28
+ def index
29
+ authorize! :index, Warbler::StockWatch
30
+ @profiles = Ish::UserProfile.all
31
+ @stock_watches = Warbler::StockWatch.order_by( ticker: :asc, direction: :asc, price: :desc
32
+ ).includes( :profile )
33
+ @stock_watch = Warbler::StockWatch.new
34
+ # render 'index', :layout => 'ish_manager/application_no_materialize'
35
+ end
36
+
25
37
  def update
26
- @stock_watch = Ish::StockWatch.find params[:id]
38
+ @stock_watch = Warbler::StockWatch.find params[:id]
27
39
  authorize! :update, @stock_watch
28
- flag = @stock_watch.update_attributes params[:ish_stock_watch].permit!
40
+ flag = @stock_watch.update_attributes permitted_params
29
41
  if flag
30
42
  flash[:notice] = 'Updated stock watch.'
31
43
  else
@@ -34,16 +46,10 @@ class IshManager::StockWatchesController < IshManager::ApplicationController
34
46
  redirect_to :action => 'index'
35
47
  end
36
48
 
37
- def destroy
38
- @w = Ish::StockWatch.find params[:id]
39
- authorize! :destroy, @w
40
- flag = @w.destroy
41
- if flag
42
- flash[:notice] = 'Success.'
43
- else
44
- flash[:alert] = @w.errors.messages
45
- end
46
- redirect_to action: 'index'
49
+ private
50
+
51
+ def permitted_params
52
+ params[:warbler_stock_watch].permit!
47
53
  end
48
54
 
49
55
  end
@@ -3,6 +3,58 @@ class IshManager::VideosController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_lists
5
5
 
6
+ # alphabetized : )
7
+
8
+ def create
9
+ @video = Video.new params[:video].permit(%i| name descr is_public is_trash is_feature x y lang youtube_id
10
+ tags city site user_profile premium_tier premium_purchases thumb video |)
11
+ @video.user_profile = current_user.profile
12
+ if !params[:video][:site_id].blank?
13
+ @video.site = Site.find params[:video][:site_id]
14
+ @video.site.touch
15
+ else
16
+ if @site
17
+ @video.site = @site
18
+ @site.touch
19
+ end
20
+ end
21
+ authorize! :create, @video
22
+
23
+ if @video.save
24
+ flash[:notice] = 'Success'
25
+ redirect_to videos_path
26
+ else
27
+ flash[:alert] = 'No luck'
28
+ @tags_list = Tag.list
29
+ @cities_list = City.list
30
+ render :action => 'new'
31
+ end
32
+ end
33
+
34
+ def destroy
35
+ @video = Video.unscoped.find params[:id]
36
+ authorize! :destroy, @video
37
+ flag = @video.update_attributes( :is_trash => true )
38
+ @video.city.touch if @video.city
39
+ @video.site.touch if @video.site
40
+ @video.tags.map &:touch
41
+ if flag
42
+ flash[:notice] = "deleted video"
43
+ else
44
+ flash[:alert] = "Cannot delete video: #{@video.errors.messages}"
45
+ end
46
+ redirect_to :action => 'index'
47
+ end
48
+
49
+ def edit
50
+ @video = Video.unscoped.find params[:id]
51
+ @user_profiles_list = Ish::UserProfile.list
52
+ authorize! :edit, @video
53
+
54
+ @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
55
+ @cities_list = City.list
56
+ end
57
+
6
58
  def index
7
59
  authorize! :index, Video.new
8
60
  @videos = Video.unscoped.where( is_trash: false, :user_profile => current_user.profile ).order_by( :created_at => :desc )
@@ -59,41 +111,6 @@ class IshManager::VideosController < IshManager::ApplicationController
59
111
  @cities_list = City.list
60
112
  end
61
113
 
62
- def create
63
- @video = Video.new params[:video].permit(%i| name descr is_public is_trash is_feature x y lang youtube_id
64
- tags city site user_profile premium_tier premium_purchases thumb video |)
65
- @video.user_profile = current_user.profile
66
- if !params[:video][:site_id].blank?
67
- @video.site = Site.find params[:video][:site_id]
68
- @video.site.touch
69
- else
70
- if @site
71
- @video.site = @site
72
- @site.touch
73
- end
74
- end
75
- authorize! :create, @video
76
-
77
- if @video.save
78
- flash[:notice] = 'Success'
79
- redirect_to videos_path
80
- else
81
- flash[:alert] = 'No luck'
82
- @tags_list = Tag.list
83
- @cities_list = City.list
84
- render :action => 'new'
85
- end
86
- end
87
-
88
- def edit
89
- @video = Video.unscoped.find params[:id]
90
- @user_profiles_list = Ish::UserProfile.list
91
- authorize! :edit, @video
92
-
93
- @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
94
- @cities_list = City.list
95
- end
96
-
97
114
  def update
98
115
  @video = Video.unscoped.find params[:id]
99
116
  authorize! :update, @video
@@ -109,19 +126,4 @@ class IshManager::VideosController < IshManager::ApplicationController
109
126
  end
110
127
  end
111
128
 
112
- def destroy
113
- @video = Video.unscoped.find params[:id]
114
- authorize! :destroy, @video
115
- flag = @video.update_attributes( :is_trash => true )
116
- @video.city.touch if @video.city
117
- @video.site.touch if @video.site
118
- @video.tags.map &:touch
119
- if flag
120
- flash[:notice] = "deleted video"
121
- else
122
- flash[:alert] = "Cannot delete video: #{@video.errors.messages}"
123
- end
124
- redirect_to :action => 'index'
125
- end
126
-
127
129
  end
@@ -11,16 +11,28 @@
11
11
  = form_tag maps_path, method: :get do
12
12
  = text_field_tag :q
13
13
  = link_to '[+]', new_map_path
14
- %li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
14
+
15
15
  %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }
16
16
  = link_to 'Galleries', galleries_path
17
+ .inline-search
18
+ = form_tag galleries_path, method: :get do
19
+ = text_field_tag :q
17
20
  = link_to '[+]', new_gallery_path
18
21
  %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }
19
22
  = link_to 'Reports', reports_path
23
+ .inline-search
24
+ = form_tag reports_path, method: :get do
25
+ = text_field_tag :q
20
26
  = link_to '[+]', new_report_path
21
27
  %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }
22
28
  = link_to 'Videos', videos_path
29
+ .inline-search
30
+ = form_tag videos_path, method: :get do
31
+ = text_field_tag :q
23
32
  = link_to '[+]', new_video_path
33
+ %ul
34
+ %li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
35
+ %li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches', stock_watches_path
24
36
  %li{ :class => params[:controller] == 'ish_manager/user_profiles' ? 'active' : '' }= link_to 'Profiles', user_profiles_path
25
37
  %hr
26
38
 
@@ -8,7 +8,6 @@
8
8
  -# %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
9
9
  - proc do # nothing
10
10
  %ul.nav.nav-pills
11
- %li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches', stock_watches_path
12
11
  -# %li{ :class => params[:controller] == 'ish_manager/stock_actions' ? 'active' : '' }= link_to 'Stock Actions', stock_actions_path
13
12
  -# %li{ :class => params[:controller] == 'ish_manager/stock_options' ? 'active' : '' }= link_to 'Stock Options', stock_options_path
14
13
  -# %li{ :class => params[:controller] == 'ish_manager/iron_condors' ? 'active' : '' }= link_to 'Iron Condors', iron_condors_path
@@ -1,3 +1,9 @@
1
1
 
2
2
  Welcome home! Your role is #{current_user.profile.role_name}.
3
3
 
4
+ .bordered{ style: 'width: 400px;' }
5
+ = form_tag "https://www.cgtrader.com/free-3d-models", method: :get do
6
+ %p Search CGTrader:
7
+ = hidden_field_tag "polygons", "lt_5k"
8
+ = text_field_tag "keywords"
9
+ = submit_tag 'search'
@@ -16,7 +16,8 @@
16
16
  .field
17
17
  = f.label :"Name"
18
18
  = f.text_field :name, :class=> 'form-control', :placeholder => "name of report", :type => "text"
19
- -# = f.text_field :slug, :class=> 'form-control', :placeholder => "name seo", :type => "text"
19
+ = f.label "Slug"
20
+ = f.text_field :slug, :class=> 'form-control', :placeholder => "name seo", :type => "text"
20
21
 
21
22
  .col.s4
22
23
  .field
@@ -2,19 +2,12 @@
2
2
  .manager-reports-show
3
3
  .row
4
4
  .large-12.columns
5
- %h1
5
+ %h1.flex-row
6
6
  = @report.name
7
7
  = link_to '[~]', edit_report_path( @report )
8
+ = button_to '[x]', report_path( @report ), :method => :delete, :data => { :confirm => 'Are you sure?' }
8
9
 
9
- .meta
10
- -# By #{link_to @report.user_profile.username, user_path( @report.user )}
11
- On #{@report.created_at.to_s.slice(0, 10)}
12
- - if @report.site
13
- In #{link_to "http://#{@report.site.domain}/#{@report.site.lang}", site_path( @report.site )}
14
- -# - if @report.tag
15
- -# Tagged #{link_to @report.tag.name, manager_tag_path( @report.tag )}
16
- - if @report.city
17
- In #{link_to @report.city.name, city_path( @report.city )}
10
+ = render 'meta', item: @report
18
11
 
19
12
  - if @report.subhead.length > 3
20
13
  .subhead= @report.subhead
@@ -23,6 +16,5 @@
23
16
  - if @report.photo
24
17
  .float-left= image_tag @report.photo.photo.url( :small )
25
18
  = raw @report.descr
26
- .c
27
-
28
- .c
19
+ %hr
20
+ = render 'form', :url => report_path(@report.id), :report => @report
@@ -3,23 +3,26 @@
3
3
  .float-left= button_to '[X]', stock_watch_path(stock_watch.id), method: :delete, data: { confirm: 'Are you sure?' }
4
4
 
5
5
 
6
- - url = stock_watches_path if !stock_watch.persisted?
6
+ - url = stock_watches_path if !stock_watch.persisted?
7
7
  - url = stock_watch_path( stock_watch ) if stock_watch.persisted?
8
8
 
9
9
  = form_for stock_watch, :url => url, :html => { :class => 'form-inline well' } do |f|
10
- .form-group
11
- = f.select :action, options_for_select( Ish::StockWatch::ACTIONS.map{|a|[a,a]}, :selected => stock_watch.action )
12
- .form-group
13
- = f.select :profile, options_for_select( [[nil,nil]]+@profiles.map{|p|[p.email,p.id]}, :selected => stock_watch.profile ? stock_watch.profile.id : nil )
14
- .form-group
15
- %label.control-label When
16
- = f.text_field :ticker, :class => 'form-control', :placeholder => 'ticker'
17
- .form-group
18
- %label.control-label Price
19
- = f.select :direction, options_for_select( Ish::StockWatch::DIRECTIONS.map{|d|[d,d]}, :selected => stock_watch.direction )
20
- .form-group
21
- %label.control-label $
22
- = f.number_field :price, :step => 0.01, :placeholder => "0.01"
23
- .form-group
24
- = f.submit ">", :class => %w(btn blue)
25
- .c
10
+ .flex-row
11
+ .form-group
12
+ = f.label :action
13
+ = f.select :action, options_for_select( Warbler::StockWatch::ACTIONS.map{|a|[a,a]}, :selected => stock_watch.action )
14
+ .form-group
15
+ = f.label :profile
16
+ = f.select :profile, options_for_select( [[nil,nil]]+@profiles.map{|p|[p.email,p.id]}, :selected => stock_watch.profile ? stock_watch.profile.id : nil )
17
+ .form-group
18
+ %label.control-label When
19
+ = f.text_field :ticker, :class => 'form-control', :placeholder => 'ticker'
20
+ .form-group
21
+ %label.control-label Price
22
+ = f.select :direction, options_for_select( Warbler::StockWatch::DIRECTIONS.map{|d|[d,d]}, :selected => stock_watch.direction )
23
+ .form-group
24
+ %label.control-label $
25
+ = f.number_field :price, :step => 0.01, :placeholder => "0.01"
26
+ .form-group
27
+ = f.submit ">", :class => %w(btn blue)
28
+
data/config/routes.rb CHANGED
@@ -48,7 +48,8 @@ IshManager::Engine.routes.draw do
48
48
  resources 'markers'
49
49
  resources 'newsitems'
50
50
  end
51
- resources 'markers' # redundant
51
+ get 'maps/:id', to: 'maps#edit'
52
+ resources 'markers'
52
53
  end
53
54
 
54
55
  resources :newsitems
@@ -21,7 +21,7 @@ namespace :ish_manager do
21
21
  desc 'watch the stocks, and trigger actions - not alphavantage, tda now. 2021-08-08'
22
22
  task watch_stocks: :environment do
23
23
  while true
24
- stocks = Ish::StockWatch.where( :notification_type => :EMAIL )
24
+ stocks = Warbler::StockWatch.where( :notification_type => :EMAIL )
25
25
  stocks.each do |stock|
26
26
  begin
27
27
  Timeout::timeout( 10 ) do
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.261
4
+ version: 0.1.8.263
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -194,14 +194,9 @@ files:
194
194
  - app/controllers/ish_manager/application_controller.rb
195
195
  - app/controllers/ish_manager/campaigns_controller.rb
196
196
  - app/controllers/ish_manager/cities_controller.rb
197
- - app/controllers/ish_manager/co_tailors_controller.rb
198
- - app/controllers/ish_manager/covered_calls_controller.rb
199
- - app/controllers/ish_manager/events_controller.rb
200
197
  - app/controllers/ish_manager/features_controller.rb
201
- - app/controllers/ish_manager/friends_controller.rb
202
198
  - app/controllers/ish_manager/galleries_controller.rb
203
199
  - app/controllers/ish_manager/invoices_controller.rb
204
- - app/controllers/ish_manager/iron_condors_controller.rb
205
200
  - app/controllers/ish_manager/leads_controller.rb
206
201
  - app/controllers/ish_manager/maps_controller.rb
207
202
  - app/controllers/ish_manager/markers_controller.rb
@@ -213,6 +208,11 @@ files:
213
208
  - app/controllers/ish_manager/sites_controller.rb
214
209
  - app/controllers/ish_manager/stock_watches_controller.rb
215
210
  - app/controllers/ish_manager/tags_controller.rb
211
+ - app/controllers/ish_manager/trash/co_tailors_controller.rb
212
+ - app/controllers/ish_manager/trash/covered_calls_controller.rb
213
+ - app/controllers/ish_manager/trash/events_controller.rb
214
+ - app/controllers/ish_manager/trash/friends_controller.rb
215
+ - app/controllers/ish_manager/trash/iron_condors_controller.rb
216
216
  - app/controllers/ish_manager/user_profiles_controller.rb
217
217
  - app/controllers/ish_manager/users_controller.rb
218
218
  - app/controllers/ish_manager/venues_controller.rb