ish_manager 0.1.8.256 → 0.1.8.260

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/ish_manager/application.scss +8 -0
  3. data/app/assets/stylesheets/ish_manager/materialize.css +2 -0
  4. data/app/assets/stylesheets/ish_manager/videos.scss +5 -0
  5. data/app/controllers/ish_manager/application_controller.rb +3 -2
  6. data/app/controllers/ish_manager/cities_controller.rb +1 -1
  7. data/app/controllers/ish_manager/friends_controller.rb +3 -3
  8. data/app/controllers/ish_manager/galleries_controller.rb +66 -68
  9. data/app/controllers/ish_manager/maps_controller.rb +47 -38
  10. data/app/controllers/ish_manager/markers_controller.rb +12 -2
  11. data/app/controllers/ish_manager/newsitems_controller.rb +2 -2
  12. data/app/controllers/ish_manager/stock_watches_controller.rb +1 -1
  13. data/app/controllers/ish_manager/user_profiles_controller.rb +7 -7
  14. data/app/controllers/ish_manager/videos_controller.rb +1 -1
  15. data/app/models/ish_manager/ability.rb +7 -2
  16. data/app/views/ish_manager/application/_form_nonpublic.haml +16 -0
  17. data/app/views/ish_manager/application/_main_header_admin.haml +12 -4
  18. data/app/views/ish_manager/application/_main_header_manager.haml +2 -1
  19. data/app/views/ish_manager/galleries/_form.haml +3 -15
  20. data/app/views/ish_manager/maps/_form.haml +9 -2
  21. data/app/views/ish_manager/maps/map_editor.haml +3 -3
  22. data/app/views/ish_manager/maps/show.haml +6 -4
  23. data/app/views/ish_manager/markers/_form.haml +3 -1
  24. data/app/views/ish_manager/user_profiles/_form.haml +1 -1
  25. data/app/views/ish_manager/user_profiles/index.haml +0 -1
  26. data/app/views/ish_manager/user_profiles/show.haml +3 -2
  27. data/lib/tasks/ish_manager_tasks.rake +1 -45
  28. metadata +3 -5
  29. data/app/controllers/ish_manager/trash/ally_controller.rb +0 -8
  30. data/app/controllers/ish_manager/trash/stock_actions_controller.rb +0 -60
  31. data/app/controllers/ish_manager/trash/stock_options_controller.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18b205d3f068684c7460c5a09833f643ea265b6ee5717633403e36a8275f1aa9
4
- data.tar.gz: 943dde92abbc05f5d216f0be7b77db08f7c0979aa1f85d2977a98caf201ec79e
3
+ metadata.gz: f6ee451db63e9c25624675fce5f5e85c80a60c9705f2b5b3cd5e3d6aaa88bb7a
4
+ data.tar.gz: 78df149f47519467e53b72c845b13897b035f799fe29f183aaf3291ca1a71577
5
5
  SHA512:
6
- metadata.gz: b6cd916c7c05b8666b7b1e58770f0b1c9d52de5fa2cbd3da219e885c7906c51b8cf7eacf918e67edb26c36350e5935a28a32efd92058a17d9f2b12d56c728f7e
7
- data.tar.gz: 94dee4f6bcaa550f372d8cb7766134ba47d47d036e9cf12f83ba2e4405c57fdc5efd5db2f41f50bd53aea7794646537de0b93449e3848dea814453bde4bdb984
6
+ metadata.gz: bf7e81a7587039a8bb5be6960eee9ed7a7c23ec25c45f97c53fec1535afd9691c34788ccd40174ac7b88fbfee883dec169ff9f1f31621d9cda5ea6d773050df1
7
+ data.tar.gz: b768486aae09ef375d4a11f05198821eb4033577fb02770b429ac83238971941b26a6bdef720e77d647ebd54cb430af38d28051f756e8f722056921e4ee9873b
@@ -61,6 +61,14 @@ pre {
61
61
  padding: 1em;
62
62
  }
63
63
 
64
+ .bordered {
65
+ border: 1px solid grey;
66
+ padding: .5em;
67
+ border-radius: 8px;
68
+ margin-bottom: .5em;
69
+ }
70
+
71
+
64
72
  /* C */
65
73
 
66
74
  .center {
@@ -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;
@@ -3,4 +3,9 @@
3
3
  .item {
4
4
  margin-bottom: 3em;
5
5
  }
6
+
7
+ /* clear nth! */
8
+ .row div:nth-child(2n+1) {
9
+ clear:left
10
+ }
6
11
  }
@@ -25,14 +25,15 @@ module IshManager
25
25
  end
26
26
 
27
27
  def set_lists
28
+ # alphabetized! : )
28
29
  @cities_list = City.list
29
30
  @galleries_list = Gallery.all.list
30
31
  @locations_list = ::Gameui::Map.list
31
- @maps_list = ::Gameui::Map.list
32
+ @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
32
33
  @reports_list = Report.all.list
33
34
  @sites_list = Site.all.list
34
35
  @tags_list = Tag.list
35
- @user_profiles_list = IshModels::UserProfile.all.list
36
+ @user_profiles_list = Ish::UserProfile.all.list
36
37
  @venues_list = Venue.all.list
37
38
  @videos_list = Video.all.list
38
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
- ::IshModels::CacheKey.one.update_attributes( :cities => Time.now, :feature_cities => Time.now )
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
@@ -1,15 +1,15 @@
1
1
  class IshManager::FriendsController < IshManager::ApplicationController
2
2
 
3
3
  def index
4
- authorize! :friends_index, IshModels::UserProfile
5
- @new_friend = IshModels::UserProfile.new
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 = ::IshModels::UserProfile.find_by( :email => params[:friend][:email] ) # .includes( :shared_galleries )
12
+ @friend = ::Ish::UserProfile.find_by( :email => params[:friend][:email] ) # .includes( :shared_galleries )
13
13
 
14
14
  authorize! :friends_new, @friend
15
15
 
@@ -2,38 +2,12 @@ class IshManager::GalleriesController < IshManager::ApplicationController
2
2
 
3
3
  before_action :set_lists
4
4
 
5
- def index
6
- authorize! :index, Gallery
7
- @galleries = Gallery.unscoped.where( :is_done.in => [false, nil], :is_trash.in => [false, nil],
8
- :user_profile => current_user.profile ).order_by( :created_at => :desc )
9
- if params[:q]
10
- @galleries = @galleries.where({ :name => /#{params[:q]}/i })
11
- @galleries.selector.delete('is_done')
12
- end
13
- @galleries = @galleries.page( params[:galleries_page] ).per( 10 )
14
-
15
- render params[:render_type]
16
- end
17
-
18
- def shared_with_me
19
- authorize! :index, Gallery
20
- @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
21
- ).order_by( :created_at => :desc
22
- ).page( params[:shared_galleries_page] ).per( 10 )
23
- render params[:render_type]
24
- end
25
-
26
- def new
27
- @gallery = Gallery.new
28
- authorize! :new, @gallery
29
- @cities_list = City.list
30
- @tags_list = Tag.list
31
- end
5
+ # alphabetized! : )
32
6
 
33
7
  def create
34
8
  params[:gallery][:shared_profiles] ||= []
35
9
  params[:gallery][:shared_profiles].delete('')
36
- params[:gallery][:shared_profiles] = IshModels::UserProfile.find params[:gallery][:shared_profiles]
10
+ params[:gallery][:shared_profiles] = Ish::UserProfile.find params[:gallery][:shared_profiles]
37
11
  @gallery = Gallery.new params[:gallery].permit!
38
12
  @gallery.user_profile = current_user.profile
39
13
  @gallery.username = current_user.profile.username
@@ -45,18 +19,78 @@ class IshManager::GalleriesController < IshManager::ApplicationController
45
19
  redirect_to edit_gallery_path(@gallery)
46
20
  else
47
21
  puts! @gallery.errors.messages
48
- flash[:alert] = 'No Luck. ' + @gallery.errors.inspect
49
- @cities_list = City.list
50
- @tags_list = Tag.list
22
+ flash[:alert] = "Cannot create the gallery: #{@gallery.errors.full_messages}"
51
23
  render :action => 'new'
52
24
  end
53
25
  end
54
26
 
27
+ def destroy
28
+ @gallery = Gallery.unscoped.find params[:id]
29
+ authorize! :destroy, @gallery
30
+ @gallery.is_trash = true
31
+ @gallery.save
32
+ flash[:notice] = 'Logically deleted gallery.'
33
+ redirect_to galleries_path
34
+ end
35
+
55
36
  def edit
56
37
  @gallery = Gallery.unscoped.find params[:id]
57
38
  authorize! :edit, @gallery
58
39
  end
59
40
 
41
+ def index
42
+ authorize! :index, Gallery
43
+ @galleries = Gallery.unscoped.where( :is_done.in => [false, nil], :is_trash.in => [false, nil],
44
+ :user_profile => current_user.profile ).order_by( :created_at => :desc )
45
+ if params[:q]
46
+ @galleries = @galleries.where({ :name => /#{params[:q]}/i })
47
+ @galleries.selector.delete('is_done')
48
+ end
49
+ @galleries = @galleries.page( params[:galleries_page] ).per( 10 )
50
+
51
+ render params[:render_type]
52
+ end
53
+
54
+ def j_show
55
+ @gallery = Gallery.unscoped.find( params[:id] )
56
+ authorize! :show, @gallery
57
+ respond_to do |format|
58
+ format.json do
59
+ jjj = {}
60
+ jjj[:photos] = @gallery.photos.map do |ph|
61
+ { :thumbnail_url => ph.photo.url( :thumb ),
62
+ :delete_type => 'DELETE',
63
+ :delete_url => photo_path(ph) }
64
+ end
65
+ render :json => jjj
66
+ end
67
+ end
68
+ end
69
+
70
+ def new
71
+ @gallery = Gallery.new
72
+ authorize! :new, @gallery
73
+ end
74
+
75
+ def shared_with_me
76
+ authorize! :index, Gallery
77
+ @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
78
+ ).order_by( :created_at => :desc
79
+ ).page( params[:shared_galleries_page] ).per( 10 )
80
+ render params[:render_type]
81
+ end
82
+
83
+ def show
84
+ begin
85
+ @gallery = Gallery.unscoped.find_by :slug => params[:id]
86
+ rescue
87
+ @gallery = Gallery.unscoped.find params[:id]
88
+ end
89
+ authorize! :show, @gallery
90
+ @photos = @gallery.photos.unscoped.where({ :is_trash => false })
91
+ @deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true })
92
+ end
93
+
60
94
  def update
61
95
  @gallery = Gallery.unscoped.find params[:id]
62
96
  old_shared_profile_ids = @gallery.shared_profiles.map(&:id)
@@ -69,7 +103,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
69
103
  params[:gallery].delete :shared_profiles
70
104
 
71
105
  if @gallery.update_attributes( params[:gallery].permit! )
72
- new_shared_profiles = IshModels::UserProfile.find( params[:gallery][:shared_profile_ids]
106
+ new_shared_profiles = Ish::UserProfile.find( params[:gallery][:shared_profile_ids]
73
107
  ).select { |p| !old_shared_profile_ids.include?( p.id ) }
74
108
  ::IshManager::ApplicationMailer.shared_galleries( new_shared_profiles, @gallery ).deliver
75
109
  flash[:notice] = 'Success.'
@@ -81,41 +115,5 @@ class IshManager::GalleriesController < IshManager::ApplicationController
81
115
  end
82
116
  end
83
117
 
84
- def show
85
- begin
86
- @gallery = Gallery.unscoped.find_by :slug => params[:id]
87
- rescue
88
- @gallery = Gallery.unscoped.find params[:id]
89
- end
90
- authorize! :show, @gallery
91
- @photos = @gallery.photos.unscoped.where({ :is_trash => false })
92
- @deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true })
93
- end
94
-
95
- def destroy
96
- @gallery = Gallery.unscoped.find params[:id]
97
- authorize! :destroy, @gallery
98
- @gallery.is_trash = true
99
- @gallery.save
100
- flash[:notice] = 'Logically deleted gallery.'
101
- redirect_to galleries_path
102
- end
103
-
104
- def j_show
105
- @gallery = Gallery.unscoped.find( params[:id] )
106
- authorize! :show, @gallery
107
- respond_to do |format|
108
- format.json do
109
- jjj = {}
110
- jjj[:photos] = @gallery.photos.map do |ph|
111
- { :thumbnail_url => ph.photo.url( :thumb ),
112
- :delete_type => 'DELETE',
113
- :delete_url => photo_path(ph) }
114
- end
115
- render :json => jjj
116
- end
117
- end
118
- end
119
-
120
118
  end
121
119
 
@@ -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,38 @@ 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
+ @maps = ::Gameui::Map.unscoped.where( parent_slug: "" ).order( slug: :asc )
45
+ @all_maps = Gameui::Map.all.order( slug: :asc )
46
+ end
47
+
48
+ def map_editor
49
+ authorize! :update, @map
50
+ end
51
+
52
+ def new
53
+ authorize! :new, ::Gameui::Map
54
+ @map = ::Gameui::Map.new
55
+ end
56
+
57
+ def show
58
+ authorize! :show, @map
59
+ @maps = Gameui::Map.where( parent_slug: @map.slug )
60
+ end
61
+
49
62
  def update
50
63
  authorize! :update, @map
51
64
 
@@ -70,27 +83,23 @@ class IshManager::MapsController < IshManager::ApplicationController
70
83
  end
71
84
  end
72
85
 
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
86
  private
86
87
 
87
- def set_map
88
- @map = ::Gameui::Map.where(id: params[:id]).first
89
- @map ||= Gameui::Map.find_by(slug: params[:id])
90
- end
88
+ def map_params
89
+ out = params.require(:gameui_map).permit!
91
90
 
92
- def map_params
93
- params.require(:gameui_map).permit!
91
+ out[:shared_profiles].delete('')
92
+ if out[:shared_profiles].present?
93
+ out[:shared_profiles] = Ish::UserProfile.find( out[:shared_profiles] )
94
94
  end
95
95
 
96
+ out
97
+ end
98
+
99
+ def set_map
100
+ @map = ::Gameui::Map.unscoped.where(id: params[:id]).first
101
+ @map ||= Gameui::Map.unscoped.find_by(slug: params[:id])
102
+ @markers = @map.markers.unscoped
103
+ end
104
+
96
105
  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 ||= IshModels::UserProfile.find params[:newsitem][:user_profile_id] if !params[:newsitem][:user_profile_id].blank?
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 "IshModels::UserProfile"
29
+ when "Ish::UserProfile"
30
30
  user_profiles_path
31
31
  when "Site"
32
32
  edit_site_path( @resource.id )
@@ -3,7 +3,7 @@ class IshManager::StockWatchesController < IshManager::ApplicationController
3
3
 
4
4
  def index
5
5
  authorize! :index, Ish::StockWatch
6
- @profiles = IshModels::UserProfile.all
6
+ @profiles = Ish::UserProfile.all
7
7
  @stock_watches = Ish::StockWatch.order_by( ticker: :asc, direction: :asc, price: :desc
8
8
  ).includes( :profile )
9
9
  @stock_watch = Ish::StockWatch.new
@@ -4,22 +4,22 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def index
7
- @user_profiles = IshModels::UserProfile.all.includes( :user )
8
- authorize! :index, IshModels::UserProfile
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 = IshModels::UserProfile.find params[:id]
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 = IshModels::UserProfile.find params[:id]
17
+ @profile = Ish::UserProfile.find params[:id]
18
18
  authorize! :edit, @profile
19
19
  end
20
20
 
21
21
  def update
22
- @profile = IshModels::UserProfile.find params[:id]
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 = IshModels::UserProfile.new
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 = IshModels::UserProfile.new params[:profile].permit!
52
+ @user.profile = Ish::UserProfile.new params[:profile].permit!
53
53
  authorize! :create, @user.profile
54
54
 
55
55
  if params[:photo]
@@ -87,7 +87,7 @@ class IshManager::VideosController < IshManager::ApplicationController
87
87
 
88
88
  def edit
89
89
  @video = Video.unscoped.find params[:id]
90
- @user_profiles_list = IshModels::UserProfile.list
90
+ @user_profiles_list = Ish::UserProfile.list
91
91
  authorize! :edit, @video
92
92
 
93
93
  @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
@@ -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 ], ::IshModels::UserProfile
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 ], Ish::StockWatch
50
+ can [ :manage ], ::Warbler::StockWatch
51
51
 
52
52
  can [ :index, :new, :create ], ::Tag
53
53
 
@@ -66,6 +66,11 @@ class IshManager::Ability
66
66
  if user.profile && :manager == user.profile.role_name
67
67
  can [ :create_newsitem, :show, :new_feature, :create_feature,
68
68
  :index, :new, :create, :edit, :update ], City
69
+
70
+ can [ :edit, :index, :show, :update,
71
+ :new_marker, :edit_marker, :create_marker, :update_marker,
72
+ ], Gameui::Map
73
+
69
74
  end
70
75
 
71
76
 
@@ -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
+ &gt; #{p.email} <br />
16
+ .col.s4 &nbsp;
@@ -4,7 +4,9 @@
4
4
  %i.fa.fa-compress.collapse-expand#collapseHeader
5
5
  .content
6
6
  %ul
7
- %li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }= link_to 'GameUi::Maps', maps_path
7
+ %li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }
8
+ = link_to 'GameUi::Maps', maps_path
9
+ = link_to '[+]', new_map_path
8
10
  %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
9
11
  %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
10
12
  %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
@@ -14,9 +16,15 @@
14
16
  %ul
15
17
  %li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
16
18
  %li{ :class => params[:controller] == 'ish_manager/sites' ? 'active' : '' }= link_to 'Sites', sites_path
17
- %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
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
19
+ %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }
20
+ = link_to 'Galleries', galleries_path
21
+ = link_to '[+]', new_gallery_path
22
+ %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }
23
+ = link_to 'Reports', reports_path
24
+ = link_to '[+]', new_report_path
25
+ %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }
26
+ = link_to 'Videos', videos_path
27
+ = link_to '[+]', new_video_path
20
28
  %li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }= link_to 'Tags', tags_path
21
29
 
22
30
  - proc do # nothing
@@ -10,8 +10,9 @@
10
10
  %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
11
11
  %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
12
12
  %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
13
- %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
13
+ %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
14
14
  %ul.nav.nav-pills
15
+ %li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }= link_to 'GameUi::Maps', maps_path
15
16
  %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
16
17
  %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
17
18
  %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
@@ -29,18 +29,9 @@
29
29
  = f.label :tags
30
30
  = f.select :tag_ids, @tags_list, {}, { multiple: true }
31
31
 
32
- .row
33
- .panel
34
- .panel-body
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
- &gt; #{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'
@@ -4,16 +4,16 @@
4
4
 
5
5
  .map-editor
6
6
  = image_tag @map.image.image.url(:original)
7
- - @map.markers.each do |m|
7
+ - @markers.each do |m|
8
8
  .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
9
  = image_tag m.image.image.url(:original)
10
10
  = image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{m.centerOffsetY-10}px; left: #{m.centerOffsetX-10}px;" )
11
11
 
12
12
  .markers-list
13
13
  %h1
14
- Markers (#{@map.markers.length})
14
+ Markers (#{@markers.length})
15
15
  = link_to '[+]', new_marker_path({ map_id: @map.id })
16
- - @map.markers.each do |m|
16
+ - @markers.each do |m|
17
17
  = form_for m, { html: { class: "item #{m.slug}" }, url: marker_path(m.id) } do |f|
18
18
  = m.slug
19
19
  = link_to '[~]', edit_marker_path(m.id)
@@ -13,21 +13,23 @@
13
13
  [<>]
14
14
  .the-map
15
15
  = image_tag @map.image.image.url(:original) rescue nil
16
- - @map.markers.each do |marker|
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 (#{@map.markers.count}) [<>]
21
+ %p.addToggle Markers (#{@markers.count}) [<>]
22
22
  .markers-list
23
- - @map.markers.each do |marker|
24
- .item
23
+ - @markers.each do |marker|
24
+ .flex-row.bordered
25
+ = image_tag marker.image.image.url(:original)
25
26
  .flat-row
26
27
  .a= marker.slug
27
28
  .a= button_to '~', edit_marker_path(marker), method: :get
28
29
  .a= button_to 'x', marker_path(marker), method: :delete, data: { confirm: 'Are you sure?' }
29
30
  .a= link_to '[api]', api_marker_path(marker)
30
31
  .a= link_to '[this map]', edit_map_path(marker.slug)
32
+ .hide
31
33
  %ul.bullets
32
34
  %li <b>item_type:</b> #{marker.item_type}
33
35
 
@@ -35,7 +35,7 @@
35
35
  = f.label :image
36
36
  = file_field_tag :image
37
37
  .image-thumb
38
- = image_tag(@marker.image.image.url(:thumb)) rescue nil
38
+ = image_tag(@marker.image.image.url(:original)) rescue nil
39
39
  = image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{@marker.centerOffsetY-10}px; left: #{@marker.centerOffsetX-10}px;" )
40
40
  .col.s3
41
41
  .field
@@ -57,6 +57,8 @@
57
57
  = file_field_tag :title_image
58
58
  = image_tag @marker.title_image.image.url(:thumb) rescue nil
59
59
 
60
+ = render 'ish_manager/application/form_nonpublic', f: f, model: @marker
61
+
60
62
  .field
61
63
  = f.label :url, "URL (if any)"
62
64
  = f.text_field :url
@@ -24,7 +24,7 @@
24
24
  %br
25
25
 
26
26
  .input-field
27
- = f.select :role_name, options_for_select( [[nil, nil]] + IshModels::UserProfile::ROLES.map { |r| [ r, r ] }, :selected => profile.role_name )
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
@@ -23,7 +23,6 @@
23
23
  %li
24
24
  <b>Profile Photo:</b>
25
25
  = image_tag profile.profile_photo.photo.url(:thumb) rescue nil
26
- %li <b>Address:</b> #{profile.addresses[0].inspect}
27
26
 
28
27
  .col.s8
29
28
  %h5 Shared galleries
@@ -8,7 +8,8 @@
8
8
  %ul
9
9
  - @user_profile.premium_purchases.each do |purchase|
10
10
  %li
11
- -# = purchase.item_type.constantize.find(purchase.item_id).inspect
12
- = render 'ish_manager/reports/show_mini', report: purchase.item_type.constantize.find(purchase.item_id)
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
 
@@ -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 = ::IshModels::UserProfile.new :email => u.email, :user => u, :role_name => :guy
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,38 +18,6 @@ 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
@@ -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.256
4
+ version: 0.1.8.260
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-01 00:00:00.000000000 Z
11
+ date: 2021-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -213,9 +213,6 @@ files:
213
213
  - app/controllers/ish_manager/sites_controller.rb
214
214
  - app/controllers/ish_manager/stock_watches_controller.rb
215
215
  - app/controllers/ish_manager/tags_controller.rb
216
- - app/controllers/ish_manager/trash/ally_controller.rb
217
- - app/controllers/ish_manager/trash/stock_actions_controller.rb
218
- - app/controllers/ish_manager/trash/stock_options_controller.rb
219
216
  - app/controllers/ish_manager/user_profiles_controller.rb
220
217
  - app/controllers/ish_manager/users_controller.rb
221
218
  - app/controllers/ish_manager/venues_controller.rb
@@ -229,6 +226,7 @@ files:
229
226
  - app/views/ish_manager/application/_analytics.html
230
227
  - app/views/ish_manager/application/_debug.haml
231
228
  - app/views/ish_manager/application/_form_errors.haml
229
+ - app/views/ish_manager/application/_form_nonpublic.haml
232
230
  - app/views/ish_manager/application/_main_footer.haml
233
231
  - app/views/ish_manager/application/_main_header.haml
234
232
  - app/views/ish_manager/application/_main_header_admin.haml
@@ -1,8 +0,0 @@
1
-
2
- class IshManager::AllyController < IshManager::ApplicationController
3
-
4
- def home
5
- authorize! :ally_home, IshManager::Ability
6
- end
7
-
8
- end
@@ -1,60 +0,0 @@
1
-
2
- class IshManager::StockActionsController < IshManager::ApplicationController
3
-
4
- PERMITTED_PARAMS = [ :stock_watch, :is_active ]
5
-
6
- def index
7
- authorize! :index, Ish::StockAction
8
- @profiles = IshModels::UserProfile.all
9
- @stock_watches_list = Ish::StockWatch.all.map { |w| [w.to_s, w.id] }
10
- @stock_options_list = Ish::StockOption.all.map { |o| [ o.to_s, o.id] }
11
- @stock_actions = Ish::StockAction.all.includes( :profile )
12
- @stock_action = Ish::StockAction.new
13
- render 'index', :layout => 'ish_manager/application_no_materialize'
14
- end
15
-
16
- def create
17
- @stock_action = Ish::StockAction.new params.require(:ish_stock_action).permit( PERMITTED_PARAMS )
18
- @stock_action.profile = current_user.profile
19
- authorize! :create, @stock_action
20
-
21
- flag = true
22
- if params[:ish_stock_action][:stock_options]
23
- stock_options = Ish::StockOption.where( :id.in => params[:ish_stock_action][:stock_options] )
24
- flag = stock_options.update_all( :stock_action_id => @stock_action.id )
25
- end
26
- if flag
27
- flag = @stock_action.save
28
- end
29
- if flag
30
- flash[:notice] = 'Created stock action.'
31
- else
32
- flash[:alert] = "Cannot create stock action: #{@stock_action.errors.messages}"
33
- end
34
- redirect_to :action => 'index'
35
- end
36
-
37
- def update
38
- @stock_action = Ish::StockAction.find params[:id]
39
- authorize! :update, @stock_action
40
-
41
- flag = true
42
- if params[:ish_stock_action][:stock_options]
43
- stock_options = Ish::StockOption.where( :id.in => params[:ish_stock_action][:stock_options] )
44
- flag = stock_options.update_all( :stock_action_id => @stock_action.id )
45
- end
46
- if flag
47
- flag = @stock_action.update_attributes params.require(:ish_stock_action).permit( PERMITTED_PARAMS )
48
- end
49
- if flag
50
- flash[:notice] = 'Updated stock action.'
51
- else
52
- flash[:alert] = "Cannot update stock action: #{@stock_action.errors.messages}"
53
- end
54
- redirect_to :action => 'index'
55
- end
56
-
57
- end
58
-
59
-
60
-
@@ -1,41 +0,0 @@
1
-
2
- class IshManager::StockOptionsController < IshManager::ApplicationController
3
-
4
- def index
5
- authorize! :index, Ish::StockOption
6
- @profiles = IshModels::UserProfile.all
7
- @stock_options = Ish::StockOption.all.includes( :profile )
8
- @stock_option = Ish::StockOption.new
9
- render 'index', :layout => 'ish_manager/application_no_materialize'
10
- end
11
-
12
- def create
13
- @stock_option = Ish::StockOption.new params[:ish_stock_option].permit!
14
- @stock_option.profile = current_user.profile
15
- authorize! :create, @stock_option
16
- flag = @stock_option.save
17
-
18
- if flag
19
- flash[:notice] = 'Created stock option.'
20
- else
21
- flash[:alert] = "Cannot create stock option: #{@stock_option.errors.messages}"
22
- end
23
- redirect_to :action => 'index'
24
- end
25
-
26
- def update
27
- @stock_option = Ish::StockOption.find params[:id]
28
- authorize! :update, @stock_option
29
- flag = @stock_option.update_attributes params[:ish_stock_option].permit!
30
- if flag
31
- flash[:notice] = 'Updated stock option.'
32
- else
33
- flash[:alert] = "Cannot update stock option: #{@stock_option.errors.messages}"
34
- end
35
- redirect_to :action => 'index'
36
- end
37
-
38
- end
39
-
40
-
41
-