ish_manager 0.1.8.258 → 0.1.8.263
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/ish_manager/application.scss +6 -1
- data/app/assets/stylesheets/ish_manager/maps.scss +13 -6
- data/app/assets/stylesheets/ish_manager/materialize.css +2 -0
- data/app/assets/stylesheets/ish_manager/utils.scss +1 -1
- data/app/controllers/ish_manager/application_controller.rb +2 -2
- data/app/controllers/ish_manager/cities_controller.rb +1 -1
- data/app/controllers/ish_manager/galleries_controller.rb +2 -2
- data/app/controllers/ish_manager/maps_controller.rb +56 -38
- data/app/controllers/ish_manager/markers_controller.rb +12 -2
- data/app/controllers/ish_manager/newsitems_controller.rb +2 -2
- data/app/controllers/ish_manager/reports_controller.rb +39 -33
- data/app/controllers/ish_manager/stock_watches_controller.rb +28 -22
- data/app/controllers/ish_manager/{co_tailors_controller.rb → trash/co_tailors_controller.rb} +0 -0
- data/app/controllers/ish_manager/{covered_calls_controller.rb → trash/covered_calls_controller.rb} +0 -0
- data/app/controllers/ish_manager/{events_controller.rb → trash/events_controller.rb} +0 -0
- data/app/controllers/ish_manager/{friends_controller.rb → trash/friends_controller.rb} +3 -3
- data/app/controllers/ish_manager/{iron_condors_controller.rb → trash/iron_condors_controller.rb} +0 -0
- data/app/controllers/ish_manager/user_profiles_controller.rb +7 -7
- data/app/controllers/ish_manager/videos_controller.rb +52 -50
- data/app/models/ish_manager/ability.rb +2 -2
- data/app/views/ish_manager/application/_form_nonpublic.haml +16 -0
- data/app/views/ish_manager/application/_main_header_admin.haml +28 -31
- data/app/views/ish_manager/application/_main_header_admin.haml-trash +21 -0
- data/app/views/ish_manager/application/home.haml +6 -0
- data/app/views/ish_manager/galleries/_form.haml +3 -15
- data/app/views/ish_manager/maps/_form.haml +10 -3
- data/app/views/ish_manager/maps/_map_meta_row.haml +1 -1
- data/app/views/ish_manager/maps/map_editor.haml +4 -3
- data/app/views/ish_manager/maps/show.haml +5 -3
- data/app/views/ish_manager/markers/_form.haml +2 -0
- data/app/views/ish_manager/reports/_form.haml +2 -1
- data/app/views/ish_manager/reports/show.haml +5 -13
- data/app/views/ish_manager/stock_watches/_form.haml +20 -17
- data/app/views/ish_manager/user_profiles/_form.haml +1 -1
- data/app/views/ish_manager/user_profiles/index.haml +0 -1
- data/app/views/ish_manager/user_profiles/show.haml +3 -2
- data/config/routes.rb +2 -1
- data/lib/tasks/ish_manager_tasks.rake +2 -46
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 418646349055afb3072f68d9fc12527add24597969d62ce4ff4aa41eef0d879b
|
4
|
+
data.tar.gz: cc4e03f30e8c12df9227fb6424b33207f847ff12ef2bdf90df41dea1de2748e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d04670dd256406a4c75dab4a62796dcfde3fb22f38ec65b738ac6f2fe972a33b32b8fcc43f5613861b8e7400a7d3dd92582613eb68a1be59f4acda1494697864
|
7
|
+
data.tar.gz: 104e3b96eef1193d21ba175122c8de72dba98f93e572af83af5654479dfe767860d3f654e669bb2634d0f8e6e9a678fb13381316cd4d568f6b792806b376026c
|
@@ -21,7 +21,7 @@
|
|
21
21
|
*= require ish_manager/videos
|
22
22
|
*/
|
23
23
|
|
24
|
-
|
24
|
+
body {
|
25
25
|
background: #dedede;
|
26
26
|
font-size: 20px;
|
27
27
|
}
|
@@ -111,6 +111,11 @@ hr {
|
|
111
111
|
ul.inline li {
|
112
112
|
display: inline;
|
113
113
|
}
|
114
|
+
.inline-search {
|
115
|
+
width: 20px;
|
116
|
+
bordeR: 1px solid white;
|
117
|
+
display: inline-block;
|
118
|
+
}
|
114
119
|
|
115
120
|
/* L */
|
116
121
|
textarea.large {
|
@@ -8,15 +8,22 @@
|
|
8
8
|
/*
|
9
9
|
* Main - Maps
|
10
10
|
*/
|
11
|
-
.maps--map-meta-row
|
12
|
-
|
11
|
+
.maps--map-meta-row {
|
12
|
+
border-left: 10px solid #e3e3e3;
|
13
|
+
padding-left: 10px;
|
14
|
+
|
15
|
+
.a {
|
16
|
+
line-height: 1em;
|
17
|
+
}
|
13
18
|
}
|
14
19
|
|
15
20
|
.maps-index {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
|
22
|
+
// h1 {
|
23
|
+
// padding-bottom: 10px;
|
24
|
+
// border-bottom: 10px solid #cecece;
|
25
|
+
// }
|
26
|
+
|
20
27
|
.item {
|
21
28
|
display: flex;
|
22
29
|
flex-direction: row;
|
@@ -4420,6 +4420,7 @@ nav .input-field label.active i {
|
|
4420
4420
|
}
|
4421
4421
|
}
|
4422
4422
|
|
4423
|
+
/*
|
4423
4424
|
@font-face {
|
4424
4425
|
font-family: "Roboto";
|
4425
4426
|
src: local(Roboto Thin), url("../fonts/roboto/Roboto-Thin.woff2") format("woff2"), url("../fonts/roboto/Roboto-Thin.woff") format("woff");
|
@@ -4449,6 +4450,7 @@ nav .input-field label.active i {
|
|
4449
4450
|
src: local(Roboto Bold), url("../fonts/roboto/Roboto-Bold.woff2") format("woff2"), url("../fonts/roboto/Roboto-Bold.woff") format("woff");
|
4450
4451
|
font-weight: 700;
|
4451
4452
|
}
|
4453
|
+
*/
|
4452
4454
|
|
4453
4455
|
a {
|
4454
4456
|
text-decoration: none;
|
@@ -29,11 +29,11 @@ module IshManager
|
|
29
29
|
@cities_list = City.list
|
30
30
|
@galleries_list = Gallery.all.list
|
31
31
|
@locations_list = ::Gameui::Map.list
|
32
|
-
@maps_list = ::Gameui::Map.list
|
32
|
+
@maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
|
33
33
|
@reports_list = Report.all.list
|
34
34
|
@sites_list = Site.all.list
|
35
35
|
@tags_list = Tag.list
|
36
|
-
@user_profiles_list =
|
36
|
+
@user_profiles_list = Ish::UserProfile.all.list
|
37
37
|
@venues_list = Venue.all.list
|
38
38
|
@videos_list = Video.all.list
|
39
39
|
end
|
@@ -54,7 +54,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
|
|
54
54
|
@city.profile_photo = photo
|
55
55
|
end
|
56
56
|
if @city.save
|
57
|
-
::
|
57
|
+
::Ish::CacheKey.one.update_attributes( :cities => Time.now, :feature_cities => Time.now )
|
58
58
|
flash[:notice] = 'Success'
|
59
59
|
redirect_to city_path @city.id
|
60
60
|
else
|
@@ -7,7 +7,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
|
|
7
7
|
def create
|
8
8
|
params[:gallery][:shared_profiles] ||= []
|
9
9
|
params[:gallery][:shared_profiles].delete('')
|
10
|
-
params[:gallery][:shared_profiles] =
|
10
|
+
params[:gallery][:shared_profiles] = Ish::UserProfile.find params[:gallery][:shared_profiles]
|
11
11
|
@gallery = Gallery.new params[:gallery].permit!
|
12
12
|
@gallery.user_profile = current_user.profile
|
13
13
|
@gallery.username = current_user.profile.username
|
@@ -103,7 +103,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
|
|
103
103
|
params[:gallery].delete :shared_profiles
|
104
104
|
|
105
105
|
if @gallery.update_attributes( params[:gallery].permit! )
|
106
|
-
new_shared_profiles =
|
106
|
+
new_shared_profiles = Ish::UserProfile.find( params[:gallery][:shared_profile_ids]
|
107
107
|
).select { |p| !old_shared_profile_ids.include?( p.id ) }
|
108
108
|
::IshManager::ApplicationMailer.shared_galleries( new_shared_profiles, @gallery ).deliver
|
109
109
|
flash[:notice] = 'Success.'
|
@@ -2,26 +2,7 @@
|
|
2
2
|
class IshManager::MapsController < IshManager::ApplicationController
|
3
3
|
|
4
4
|
before_action :set_map, only: [:destroy, :edit, :map_editor, :show, :update, ]
|
5
|
-
|
6
|
-
def index
|
7
|
-
authorize! :index, ::Gameui::Map
|
8
|
-
@maps = ::Gameui::Map.where( parent_slug: "" ).order( slug: :asc )
|
9
|
-
@all_maps = Gameui::Map.all.order( slug: :asc )
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
authorize! :show, @map
|
14
|
-
@maps = Gameui::Map.where( parent_slug: @map.slug )
|
15
|
-
end
|
16
|
-
|
17
|
-
def new
|
18
|
-
authorize! :new, ::Gameui::Map
|
19
|
-
@map = ::Gameui::Map.new
|
20
|
-
end
|
21
|
-
|
22
|
-
def edit
|
23
|
-
authorize! :edit, @map
|
24
|
-
end
|
5
|
+
before_action :set_lists
|
25
6
|
|
26
7
|
def create
|
27
8
|
@map = ::Gameui::Map.new(map_params)
|
@@ -46,6 +27,47 @@ class IshManager::MapsController < IshManager::ApplicationController
|
|
46
27
|
end
|
47
28
|
end
|
48
29
|
|
30
|
+
def destroy
|
31
|
+
authorize! :destroy, @map
|
32
|
+
@map.destroy
|
33
|
+
respond_to do |format|
|
34
|
+
format.html { redirect_to maps_path, notice: 'Map was successfully destroyed.' }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def edit
|
39
|
+
authorize! :edit, @map
|
40
|
+
end
|
41
|
+
|
42
|
+
def index
|
43
|
+
authorize! :index, ::Gameui::Map
|
44
|
+
|
45
|
+
if params[:q]
|
46
|
+
@maps = ::Gameui::Map.where({ slug: /#{params[:q]}/i })
|
47
|
+
if @maps.length == 1
|
48
|
+
redirect_to map_path(@maps[0])
|
49
|
+
return
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
@maps ||= ::Gameui::Map.unscoped.where( parent_slug: "" ).order( slug: :asc )
|
54
|
+
@all_maps = Gameui::Map.all.order( slug: :asc )
|
55
|
+
end
|
56
|
+
|
57
|
+
def map_editor
|
58
|
+
authorize! :update, @map
|
59
|
+
end
|
60
|
+
|
61
|
+
def new
|
62
|
+
authorize! :new, ::Gameui::Map
|
63
|
+
@map = ::Gameui::Map.new
|
64
|
+
end
|
65
|
+
|
66
|
+
def show
|
67
|
+
authorize! :show, @map
|
68
|
+
@maps = Gameui::Map.where( parent_slug: @map.slug )
|
69
|
+
end
|
70
|
+
|
49
71
|
def update
|
50
72
|
authorize! :update, @map
|
51
73
|
|
@@ -70,27 +92,23 @@ class IshManager::MapsController < IshManager::ApplicationController
|
|
70
92
|
end
|
71
93
|
end
|
72
94
|
|
73
|
-
def destroy
|
74
|
-
authorize! :destroy, @map
|
75
|
-
@map.destroy
|
76
|
-
respond_to do |format|
|
77
|
-
format.html { redirect_to maps_path, notice: 'Map was successfully destroyed.' }
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
def map_editor
|
82
|
-
authorize! :update, @map
|
83
|
-
end
|
84
|
-
|
85
95
|
private
|
86
96
|
|
87
|
-
|
88
|
-
|
89
|
-
@map ||= Gameui::Map.find_by(slug: params[:id])
|
90
|
-
end
|
97
|
+
def map_params
|
98
|
+
out = params.require(:gameui_map).permit!
|
91
99
|
|
92
|
-
|
93
|
-
|
100
|
+
out[:shared_profiles].delete('')
|
101
|
+
if out[:shared_profiles].present?
|
102
|
+
out[:shared_profiles] = Ish::UserProfile.find( out[:shared_profiles] )
|
94
103
|
end
|
95
104
|
|
105
|
+
out
|
106
|
+
end
|
107
|
+
|
108
|
+
def set_map
|
109
|
+
@map = ::Gameui::Map.unscoped.where(id: params[:id]).first
|
110
|
+
@map ||= Gameui::Map.unscoped.find_by(slug: params[:id])
|
111
|
+
@markers = @map.markers.unscoped
|
112
|
+
end
|
113
|
+
|
96
114
|
end
|
@@ -3,6 +3,7 @@ class IshManager::MarkersController < IshManager::ApplicationController
|
|
3
3
|
|
4
4
|
before_action :set_map, except: [ :destroy, :edit, :update ]
|
5
5
|
before_action :set_marker, only: [ :edit, :update ]
|
6
|
+
before_action :set_lists
|
6
7
|
|
7
8
|
def new
|
8
9
|
authorize! :new_marker, ::Gameui::Map
|
@@ -10,6 +11,8 @@ class IshManager::MarkersController < IshManager::ApplicationController
|
|
10
11
|
end
|
11
12
|
|
12
13
|
def edit
|
14
|
+
@marker = ::Gameui::Marker.unscoped.find params[:id]
|
15
|
+
@map = @marker.map
|
13
16
|
authorize! :edit_marker, @map
|
14
17
|
end
|
15
18
|
|
@@ -78,12 +81,19 @@ class IshManager::MarkersController < IshManager::ApplicationController
|
|
78
81
|
end
|
79
82
|
|
80
83
|
def set_marker
|
81
|
-
@marker = ::Gameui::Marker.find params[:id]
|
84
|
+
@marker = ::Gameui::Marker.unscoped.find params[:id]
|
82
85
|
@map = @marker.map
|
83
86
|
end
|
84
87
|
|
85
88
|
def marker_params
|
86
|
-
params.require(:gameui_marker).permit!
|
89
|
+
out = params.require(:gameui_marker).permit!
|
90
|
+
|
91
|
+
out[:shared_profiles].delete('') if out[:shared_profiles]
|
92
|
+
if out[:shared_profiles].present?
|
93
|
+
out[:shared_profiles] = Ish::UserProfile.find( out[:shared_profiles] )
|
94
|
+
end
|
95
|
+
|
96
|
+
out
|
87
97
|
end
|
88
98
|
|
89
99
|
end
|
@@ -11,7 +11,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
|
|
11
11
|
@resource ||= Site.find params[:newsitem][:site_id] if !params[:newsitem][:site_id].blank?
|
12
12
|
@resource ||= Tag.find params[:tag_id] if params[:tag_id]
|
13
13
|
@resource ||= Tag.find params[:newsitem][:tag_id] if !params[:newsitem][:tag_id].blank?
|
14
|
-
@resource ||=
|
14
|
+
@resource ||= Ish::UserProfile.find params[:newsitem][:user_profile_id] if !params[:newsitem][:user_profile_id].blank?
|
15
15
|
@resource ||= ::Gameui::Map.find params[:newsitem][:map_id] if !params[:newsitem][:map_id].blank?
|
16
16
|
@resource.newsitems << @newsitem
|
17
17
|
@resource.touch
|
@@ -26,7 +26,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
|
|
26
26
|
url = case @resource.class.name
|
27
27
|
when "City"
|
28
28
|
edit_city_path( @resource.id )
|
29
|
-
when "
|
29
|
+
when "Ish::UserProfile"
|
30
30
|
user_profiles_path
|
31
31
|
when "Site"
|
32
32
|
edit_site_path( @resource.id )
|
@@ -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
|
-
|
47
|
-
|
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
|
59
|
-
@report = Report.
|
60
|
-
authorize! :
|
61
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
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
|
95
|
+
def show
|
69
96
|
@report = Report.unscoped.find params[:id]
|
70
|
-
authorize! :
|
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 = IshModels::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 =
|
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 =
|
38
|
+
@stock_watch = Warbler::StockWatch.find params[:id]
|
27
39
|
authorize! :update, @stock_watch
|
28
|
-
flag = @stock_watch.update_attributes
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
data/app/controllers/ish_manager/{co_tailors_controller.rb → trash/co_tailors_controller.rb}
RENAMED
File without changes
|
data/app/controllers/ish_manager/{covered_calls_controller.rb → trash/covered_calls_controller.rb}
RENAMED
File without changes
|
File without changes
|
@@ -1,15 +1,15 @@
|
|
1
1
|
class IshManager::FriendsController < IshManager::ApplicationController
|
2
2
|
|
3
3
|
def index
|
4
|
-
authorize! :friends_index,
|
5
|
-
@new_friend =
|
4
|
+
authorize! :friends_index, Ish::UserProfile
|
5
|
+
@new_friend = Ish::UserProfile.new
|
6
6
|
|
7
7
|
@friends = current_user.profile.friends
|
8
8
|
friend_ids = @friends.map &:id
|
9
9
|
end
|
10
10
|
|
11
11
|
def create
|
12
|
-
@friend = ::
|
12
|
+
@friend = ::Ish::UserProfile.find_by( :email => params[:friend][:email] ) # .includes( :shared_galleries )
|
13
13
|
|
14
14
|
authorize! :friends_new, @friend
|
15
15
|
|
data/app/controllers/ish_manager/{iron_condors_controller.rb → trash/iron_condors_controller.rb}
RENAMED
File without changes
|
@@ -4,22 +4,22 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
|
|
4
4
|
before_action :set_lists
|
5
5
|
|
6
6
|
def index
|
7
|
-
@user_profiles =
|
8
|
-
authorize! :index,
|
7
|
+
@user_profiles = Ish::UserProfile.all.includes( :user )
|
8
|
+
authorize! :index, Ish::UserProfile
|
9
9
|
end
|
10
10
|
|
11
11
|
def show
|
12
|
-
@user_profile =
|
12
|
+
@user_profile = Ish::UserProfile.find params[:id]
|
13
13
|
authorize! :show, @user_profile
|
14
14
|
end
|
15
15
|
|
16
16
|
def edit
|
17
|
-
@profile =
|
17
|
+
@profile = Ish::UserProfile.find params[:id]
|
18
18
|
authorize! :edit, @profile
|
19
19
|
end
|
20
20
|
|
21
21
|
def update
|
22
|
-
@profile =
|
22
|
+
@profile = Ish::UserProfile.find params[:id]
|
23
23
|
authorize! :update, @profile
|
24
24
|
|
25
25
|
if params[:photo]
|
@@ -42,14 +42,14 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def new
|
45
|
-
@profile =
|
45
|
+
@profile = Ish::UserProfile.new
|
46
46
|
authorize! :new, @profile
|
47
47
|
end
|
48
48
|
|
49
49
|
def create
|
50
50
|
@user = User.find_or_create_by( :email => params[:profile][:email] )
|
51
51
|
@user.password ||= (0...12).map { rand(100) }.join
|
52
|
-
@user.profile =
|
52
|
+
@user.profile = Ish::UserProfile.new params[:profile].permit!
|
53
53
|
authorize! :create, @user.profile
|
54
54
|
|
55
55
|
if params[:photo]
|
@@ -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 = IshModels::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
|
@@ -28,7 +28,7 @@ class IshManager::Ability
|
|
28
28
|
can [ :manage ], ::CoTailors
|
29
29
|
|
30
30
|
can [ :new ], ::Feature
|
31
|
-
can [ :friends_index, :friends_new ], ::
|
31
|
+
can [ :friends_index, :friends_new ], ::Ish::UserProfile
|
32
32
|
|
33
33
|
can [ :index, :new, :create, :create_photo ], ::Gallery
|
34
34
|
can [ :edit, :update ], ::Gallery do |g|
|
@@ -47,7 +47,7 @@ class IshManager::Ability
|
|
47
47
|
can [ :new, :show, :edit, :update, :create_newsitem, :new_feature, :create_feature, :newsitems_index ], ::Site do |site|
|
48
48
|
!site.is_private && !site.is_trash
|
49
49
|
end
|
50
|
-
can [ :manage ],
|
50
|
+
can [ :manage ], ::Warbler::StockWatch
|
51
51
|
|
52
52
|
can [ :index, :new, :create ], ::Tag
|
53
53
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
.application--form-nonpublic
|
3
|
+
.panel
|
4
|
+
.panel-body
|
5
|
+
.row
|
6
|
+
.col.s3
|
7
|
+
= f.check_box :is_public
|
8
|
+
= f.label :is_public
|
9
|
+
.col.s4
|
10
|
+
= f.label 'Shared with'
|
11
|
+
= f.select :shared_profiles, options_for_select(@user_profiles_list, selected: model.shared_profile_ids), {}, { :multiple => true }
|
12
|
+
.col.s4
|
13
|
+
Shared with:<br />
|
14
|
+
- model.shared_profiles.each do |p|
|
15
|
+
> #{p.email} <br />
|
16
|
+
.col.s4
|
@@ -1,41 +1,38 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
|
3
|
+
.application--main-header-admin.manager--main-header
|
3
4
|
.container
|
4
5
|
%i.fa.fa-compress.collapse-expand#collapseHeader
|
5
6
|
.content
|
6
7
|
%ul
|
7
|
-
%li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
%li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }
|
9
|
+
= link_to 'Maps', maps_path
|
10
|
+
.inline-search
|
11
|
+
= form_tag maps_path, method: :get do
|
12
|
+
= text_field_tag :q
|
13
|
+
= link_to '[+]', new_map_path
|
13
14
|
|
15
|
+
%li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }
|
16
|
+
= link_to 'Galleries', galleries_path
|
17
|
+
.inline-search
|
18
|
+
= form_tag galleries_path, method: :get do
|
19
|
+
= text_field_tag :q
|
20
|
+
= link_to '[+]', new_gallery_path
|
21
|
+
%li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }
|
22
|
+
= link_to 'Reports', reports_path
|
23
|
+
.inline-search
|
24
|
+
= form_tag reports_path, method: :get do
|
25
|
+
= text_field_tag :q
|
26
|
+
= link_to '[+]', new_report_path
|
27
|
+
%li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }
|
28
|
+
= link_to 'Videos', videos_path
|
29
|
+
.inline-search
|
30
|
+
= form_tag videos_path, method: :get do
|
31
|
+
= text_field_tag :q
|
32
|
+
= link_to '[+]', new_video_path
|
14
33
|
%ul
|
15
34
|
%li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
|
16
|
-
%li{ :class => params[:controller] == 'ish_manager/
|
17
|
-
%li{ :class => params[:controller] == 'ish_manager/
|
18
|
-
%li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
|
19
|
-
%li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
|
20
|
-
%li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }= link_to 'Tags', tags_path
|
21
|
-
|
22
|
-
- proc do # nothing
|
23
|
-
%ul.nav.nav-pills
|
24
|
-
-# %li{ :class => params[:controller] == 'ish_manager/ally' ? 'active' : '' }= link_to 'Ally', ally_root_path
|
25
|
-
-# %li{ :class => params[:controller] == 'ish_manager/stock_actions' ? 'active' : '' }= link_to 'Stock Actions', stock_actions_path
|
26
|
-
-# %li{ :class => params[:controller] == 'ish_manager/stock_options' ? 'active' : '' }= link_to 'Stock Options', stock_options_path
|
27
|
-
%li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches', stock_watches_path
|
28
|
-
-# %li{ :class => params[:controller] == 'ish_manager/iron_condors' ? 'active' : '' }= link_to 'Iron Condors', iron_condors_path
|
29
|
-
-# %li{ :class => params[:controller] == 'ish_manager/covered_calls' ? 'active' : '' }= link_to 'Covered Calls', covered_calls_path
|
30
|
-
%ul.nav.nav-pills
|
31
|
-
%li{ :class => params[:controller] == 'ish_manager/invoices' ? 'active' : '' }= link_to 'Invoices', invoices_path
|
32
|
-
%li{ :class => params[:controller] == 'ish_manager/payments' ? 'active' : '' }= link_to 'Payments', payments_path
|
33
|
-
%li{ :class => params[:controller] == 'ish_manager/orders' ? 'active' : '' }= link_to 'Orders', orders_path
|
34
|
-
-# %li{ :class => params[:controller] == 'ish_manager/co_tailors' ? 'active' : '' }= link_to 'Co Tailors', co_tailors_path
|
35
|
-
%ul.nav.nav-pills
|
36
|
-
%li{ :class => params[:controller] == 'ish_manager/leads' ? 'active' : '' }= link_to 'Leads', leads_path
|
37
|
-
%li{ :class => params[:controller] == 'ish_manager/campaigns' ? 'active' : '' }= link_to 'Campaigns', campaigns_path
|
38
|
-
|
39
|
-
|
35
|
+
%li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches', stock_watches_path
|
36
|
+
%li{ :class => params[:controller] == 'ish_manager/user_profiles' ? 'active' : '' }= link_to 'Profiles', user_profiles_path
|
40
37
|
%hr
|
41
38
|
|
@@ -0,0 +1,21 @@
|
|
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,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'
|
@@ -29,18 +29,9 @@
|
|
29
29
|
= f.label :tags
|
30
30
|
= f.select :tag_ids, @tags_list, {}, { multiple: true }
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
.col.s4
|
36
|
-
= f.label 'Shared with'
|
37
|
-
= f.select :shared_profiles, options_for_select( [[nil,nil,:disabled=>true]]+current_user.profile.friends.map { |f| [ f.email, f.id ] }, :selected => gallery.shared_profiles.map(&:id) ), {}, { :multiple => true }
|
38
|
-
.col.s4
|
39
|
-
Shared with:<br />
|
40
|
-
- gallery.shared_profiles.each do |p|
|
41
|
-
> #{p.email} <br />
|
42
|
-
.col.s4
|
43
|
-
"/
|
32
|
+
= render 'ish_manager/application/form_nonpublic', f: f, model: gallery
|
33
|
+
|
34
|
+
|
44
35
|
.row
|
45
36
|
= f.label :subhead
|
46
37
|
= f.text_area :subhead
|
@@ -48,9 +39,6 @@
|
|
48
39
|
= f.text_area :descr, class: :tinymce
|
49
40
|
|
50
41
|
.row
|
51
|
-
.col.s3
|
52
|
-
= f.check_box :is_public
|
53
|
-
= f.label :is_public
|
54
42
|
.col.s3
|
55
43
|
= f.check_box :is_trash
|
56
44
|
= f.label :is_trash
|
@@ -30,14 +30,21 @@
|
|
30
30
|
.col.s2
|
31
31
|
.field
|
32
32
|
= f.label :ordering_type
|
33
|
-
= f.select :ordering_type, options_for_select(::Gameui::Map::ORDERING_TYPES)
|
33
|
+
= f.select :ordering_type, options_for_select(::Gameui::Map::ORDERING_TYPES, selected: @map.ordering_type)
|
34
|
+
.field
|
35
|
+
= f.label :rated
|
36
|
+
= f.select :rated, options_for_select(Location::RATED_OPTIONS, selected: @map.rated)
|
37
|
+
.field
|
38
|
+
= f.label :premium_tier
|
39
|
+
= f.number_field :premium_tier
|
34
40
|
.col.s4
|
35
|
-
|
36
41
|
.field
|
37
42
|
= f.label :image
|
38
43
|
= file_field_tag :image
|
39
44
|
= image_tag @map.image.image.url(:thumb) rescue nil
|
40
45
|
|
46
|
+
= render 'ish_manager/application/form_nonpublic', f: f, model: @map
|
47
|
+
|
41
48
|
.field
|
42
49
|
= f.label :description
|
43
50
|
= f.text_area :description, class: 'tinymce'
|
@@ -56,6 +63,6 @@
|
|
56
63
|
= f.text_area :config, class: 'large'
|
57
64
|
%pre.small
|
58
65
|
description.collapsible: bool
|
59
|
-
map_panel_type: "MapPanel" | "MapPanelNoZoom" | "ThreePanelV1"
|
66
|
+
map_panel_type: "Equirectangular" | "MapPanel" | "MapPanelNoZoom" | "ThreePanelV1" | "ThreePanelV4"
|
60
67
|
.actions
|
61
68
|
= f.submit 'Save'
|
@@ -1,19 +1,20 @@
|
|
1
1
|
|
2
2
|
.maps-map-editor
|
3
|
+
= render 'map_meta_row', map: @map
|
3
4
|
%h1 Map Editor
|
4
5
|
|
5
6
|
.map-editor
|
6
7
|
= image_tag @map.image.image.url(:original)
|
7
|
-
- @
|
8
|
+
- @markers.each do |m|
|
8
9
|
.marker{ data: { 'slug': m.slug, 'center-offset-x': m.centerOffsetX, 'center-offset-y': m.centerOffsetY }, style: "top: #{m.y-m.centerOffsetY}px; left: #{m.x-m.centerOffsetX}px;" }
|
9
10
|
= image_tag m.image.image.url(:original)
|
10
11
|
= image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{m.centerOffsetY-10}px; left: #{m.centerOffsetX-10}px;" )
|
11
12
|
|
12
13
|
.markers-list
|
13
14
|
%h1
|
14
|
-
Markers (#{@
|
15
|
+
Markers (#{@markers.length})
|
15
16
|
= link_to '[+]', new_marker_path({ map_id: @map.id })
|
16
|
-
- @
|
17
|
+
- @markers.each do |m|
|
17
18
|
= form_for m, { html: { class: "item #{m.slug}" }, url: marker_path(m.id) } do |f|
|
18
19
|
= m.slug
|
19
20
|
= link_to '[~]', edit_marker_path(m.id)
|
@@ -13,14 +13,14 @@
|
|
13
13
|
[<>]
|
14
14
|
.the-map
|
15
15
|
= image_tag @map.image.image.url(:original) rescue nil
|
16
|
-
- @
|
16
|
+
- @markers.each do |marker|
|
17
17
|
-# @TODO: this should be a partial
|
18
18
|
.marker{ style: "position: absolute; left: #{marker.x - marker.centerOffsetX}px; top: #{marker.y - marker.centerOffsetY}px;" }
|
19
19
|
= image_tag marker.image.image.url(:original)
|
20
20
|
|
21
|
-
%p.addToggle Markers (#{@
|
21
|
+
%p.addToggle Markers (#{@markers.count}) [<>]
|
22
22
|
.markers-list
|
23
|
-
- @
|
23
|
+
- @markers.each do |marker|
|
24
24
|
.flex-row.bordered
|
25
25
|
= image_tag marker.image.image.url(:original)
|
26
26
|
.flat-row
|
@@ -42,3 +42,5 @@
|
|
42
42
|
.item
|
43
43
|
= link_to m.slug, edit_map_path(m.id)
|
44
44
|
|
45
|
+
%hr
|
46
|
+
= render 'form'
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
+
|
@@ -24,7 +24,7 @@
|
|
24
24
|
%br
|
25
25
|
|
26
26
|
.input-field
|
27
|
-
= f.select :role_name, options_for_select( [[nil, nil]] +
|
27
|
+
= f.select :role_name, options_for_select( [[nil, nil]] + Ish::UserProfile::ROLES.map { |r| [ r, r ] }, :selected => profile.role_name )
|
28
28
|
%label role name
|
29
29
|
|
30
30
|
.input-field
|
@@ -8,7 +8,8 @@
|
|
8
8
|
%ul
|
9
9
|
- @user_profile.premium_purchases.each do |purchase|
|
10
10
|
%li
|
11
|
-
|
12
|
-
|
11
|
+
= purchase.item_type.constantize.find(purchase.item_id).inspect
|
12
|
+
-## this doesn't work b/c an unlocked map has no city.
|
13
|
+
-# = render 'ish_manager/reports/show_mini', report: purchase.item_type.constantize.find(purchase.item_id)
|
13
14
|
|
14
15
|
|
data/config/routes.rb
CHANGED
@@ -10,7 +10,7 @@ namespace :ish_manager do
|
|
10
10
|
task :generate_user_profiles => :environment do
|
11
11
|
User.all.map do |u|
|
12
12
|
unless u.profile
|
13
|
-
p = ::
|
13
|
+
p = ::Ish::UserProfile.new :email => u.email, :user => u, :role_name => :guy
|
14
14
|
u.profile = p
|
15
15
|
u.save && p.save && print('.')
|
16
16
|
end
|
@@ -18,42 +18,10 @@ namespace :ish_manager do
|
|
18
18
|
puts 'OK'
|
19
19
|
end
|
20
20
|
|
21
|
-
=begin
|
22
|
-
desc 'watch the stocks, and trigger actions'
|
23
|
-
task :watch_stocks => :environment do
|
24
|
-
while true
|
25
|
-
stocks = Ish::StockWatch.where( :notification_type => :EMAIL )
|
26
|
-
puts! stocks.map(&:ticker), "Watching these stocks on #{Time.now}"
|
27
|
-
stocks.each do |stock|
|
28
|
-
begin
|
29
|
-
Timeout::timeout( 10 ) do
|
30
|
-
r = HTTParty.get "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=#{stock.ticker}&interval=1min&apikey=X1C5GGH5MZSXMF3O"
|
31
|
-
end
|
32
|
-
rescue Exception => e
|
33
|
-
puts! e, 'e in :watch_stocks'
|
34
|
-
end
|
35
|
-
r = JSON.parse( r.body )['Time Series (1min)']
|
36
|
-
r = r[r.keys.first]['4. close'].to_f
|
37
|
-
if stock.direction == :ABOVE && r >= stock.price ||
|
38
|
-
stock.direction == :BELOW && r <= stock.price
|
39
|
-
IshManager::ApplicationMailer.stock_alert( stock ).deliver
|
40
|
-
|
41
|
-
## actions
|
42
|
-
# stock.stock_actions.where( :is_active => true ).each do |action|
|
43
|
-
# # @TODO: actions
|
44
|
-
# end
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
sleep 60
|
49
|
-
end
|
50
|
-
end
|
51
|
-
=end
|
52
|
-
|
53
21
|
desc 'watch the stocks, and trigger actions - not alphavantage, tda now. 2021-08-08'
|
54
22
|
task watch_stocks: :environment do
|
55
23
|
while true
|
56
|
-
stocks =
|
24
|
+
stocks = Warbler::StockWatch.where( :notification_type => :EMAIL )
|
57
25
|
stocks.each do |stock|
|
58
26
|
begin
|
59
27
|
Timeout::timeout( 10 ) do
|
@@ -82,16 +50,4 @@ namespace :ish_manager do
|
|
82
50
|
end
|
83
51
|
end
|
84
52
|
|
85
|
-
=begin
|
86
|
-
desc 'yahoo-watch the stocks'
|
87
|
-
task :stockwatcher => :environment do
|
88
|
-
watcher = YahooStockwatcher.new
|
89
|
-
while true
|
90
|
-
watcher.watch_once
|
91
|
-
print '.'
|
92
|
-
sleep 60 # seconds
|
93
|
-
end
|
94
|
-
end
|
95
|
-
=end
|
96
|
-
|
97
53
|
end
|
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.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-
|
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
|
@@ -226,9 +226,11 @@ files:
|
|
226
226
|
- app/views/ish_manager/application/_analytics.html
|
227
227
|
- app/views/ish_manager/application/_debug.haml
|
228
228
|
- app/views/ish_manager/application/_form_errors.haml
|
229
|
+
- app/views/ish_manager/application/_form_nonpublic.haml
|
229
230
|
- app/views/ish_manager/application/_main_footer.haml
|
230
231
|
- app/views/ish_manager/application/_main_header.haml
|
231
232
|
- app/views/ish_manager/application/_main_header_admin.haml
|
233
|
+
- app/views/ish_manager/application/_main_header_admin.haml-trash
|
232
234
|
- app/views/ish_manager/application/_main_header_guy.haml
|
233
235
|
- app/views/ish_manager/application/_main_header_manager.haml
|
234
236
|
- app/views/ish_manager/application/_meta.haml
|