ish_manager 0.1.8.257 → 0.1.8.261

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/ish_manager/application.scss +14 -1
  3. data/app/assets/stylesheets/ish_manager/maps.scss +13 -6
  4. data/app/assets/stylesheets/ish_manager/materialize.css +2 -0
  5. data/app/assets/stylesheets/ish_manager/utils.scss +1 -1
  6. data/app/controllers/ish_manager/application_controller.rb +2 -2
  7. data/app/controllers/ish_manager/cities_controller.rb +1 -1
  8. data/app/controllers/ish_manager/friends_controller.rb +3 -3
  9. data/app/controllers/ish_manager/galleries_controller.rb +2 -2
  10. data/app/controllers/ish_manager/maps_controller.rb +56 -38
  11. data/app/controllers/ish_manager/markers_controller.rb +12 -2
  12. data/app/controllers/ish_manager/newsitems_controller.rb +2 -2
  13. data/app/controllers/ish_manager/stock_watches_controller.rb +1 -1
  14. data/app/controllers/ish_manager/user_profiles_controller.rb +7 -7
  15. data/app/controllers/ish_manager/videos_controller.rb +1 -1
  16. data/app/models/ish_manager/ability.rb +7 -2
  17. data/app/views/ish_manager/application/_form_nonpublic.haml +16 -0
  18. data/app/views/ish_manager/application/_main_header_admin.haml +18 -33
  19. data/app/views/ish_manager/application/_main_header_admin.haml-trash +22 -0
  20. data/app/views/ish_manager/application/_main_header_manager.haml +2 -1
  21. data/app/views/ish_manager/galleries/_form.haml +3 -15
  22. data/app/views/ish_manager/maps/_form.haml +10 -3
  23. data/app/views/ish_manager/maps/_map_meta_row.haml +1 -1
  24. data/app/views/ish_manager/maps/map_editor.haml +4 -3
  25. data/app/views/ish_manager/maps/show.haml +8 -4
  26. data/app/views/ish_manager/markers/_form.haml +3 -1
  27. data/app/views/ish_manager/user_profiles/_form.haml +1 -1
  28. data/app/views/ish_manager/user_profiles/index.haml +0 -1
  29. data/app/views/ish_manager/user_profiles/show.haml +3 -2
  30. data/lib/tasks/ish_manager_tasks.rake +1 -45
  31. metadata +4 -5
  32. data/app/controllers/ish_manager/trash/ally_controller.rb +0 -8
  33. data/app/controllers/ish_manager/trash/stock_actions_controller.rb +0 -60
  34. 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: 6b660106cd844ab90b5803fd365df05e8d61fd3af1814ef776f593361daee27f
4
- data.tar.gz: 158d6293c36c5386b67bd080968530588d987e57c9fdf681693cf56b6a44bbd2
3
+ metadata.gz: 006cc153f6fc7808e3cefb1afd2ecb8c333157a8466ff1602dfe7aeeda3bb1f9
4
+ data.tar.gz: 61ad4d1e6fb8bf67a89aafd4efa9b404b7dc200751ff645451f809ec5ba7b83e
5
5
  SHA512:
6
- metadata.gz: e230441cad9274a3ed7487b7fb2d8f7f2195dca79e910bfa85899d2b4f98faace4e82f7d44939e4a4bc744dcb0a50e7390db77b349f3cb72e168cf05e17c7c69
7
- data.tar.gz: 4a8f0c327ab53d6fae4d4b14bfedb7db501f7cec920d74aa11cfa7fdffe09860674526930f4e13c33c63744d2452b849d459687600018415a65b65874dd4939b
6
+ metadata.gz: 561450268ea240743abbbddca49574be06245a5779153da9c88836925d3ff8c65140e4b2a8a10eaf4b3192b0aca834085f30fb36ea0a1387d9d91ddc2342534f
7
+ data.tar.gz: 4710b5f7bf35185586f158d884e82fd57cf37d5086bf54f67b4d1ed9ad87c77aa639115d0f517129c0a0069133ee6ae8e0d4857d4f1c727ed09ed9c78f39b327
@@ -21,7 +21,7 @@
21
21
  *= require ish_manager/videos
22
22
  */
23
23
 
24
- body {
24
+ body {
25
25
  background: #dedede;
26
26
  font-size: 20px;
27
27
  }
@@ -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 {
@@ -103,6 +111,11 @@ hr {
103
111
  ul.inline li {
104
112
  display: inline;
105
113
  }
114
+ .inline-search {
115
+ width: 20px;
116
+ bordeR: 1px solid white;
117
+ display: inline-block;
118
+ }
106
119
 
107
120
  /* L */
108
121
  textarea.large {
@@ -8,15 +8,22 @@
8
8
  /*
9
9
  * Main - Maps
10
10
  */
11
- .maps--map-meta-row .a {
12
- line-height: 1em;
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
- h1 {
17
- padding-bottom: 10px;
18
- border-bottom: 10px solid #cecece;
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;
@@ -13,7 +13,7 @@ ul:not(.browser-default).bullets, {
13
13
  justify-content: flex-start;
14
14
  align-content: flex-start;
15
15
 
16
- height: 3em;
16
+ height: 2.4em;
17
17
  line-height: 3em;
18
18
 
19
19
  width: 100%;
@@ -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 = IshModels::UserProfile.all.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
- ::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
 
@@ -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] = IshModels::UserProfile.find 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 = IshModels::UserProfile.find( params[:gallery][:shared_profile_ids]
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
- def set_map
88
- @map = ::Gameui::Map.where(id: params[:id]).first
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
- def map_params
93
- params.require(:gameui_map).permit!
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 ||= 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;
@@ -1,41 +1,26 @@
1
1
 
2
- .manager--main-header
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' : '' }= link_to 'GameUi::Maps', maps_path
8
- %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
9
- %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
10
- %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
11
- %li{ :class => params[:controller] == 'ish_manager/user_profiles' ? 'active' : '' }= link_to 'Profiles', user_profiles_path
12
- %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
13
-
14
- %ul
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
15
14
  %li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
16
- %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
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
-
15
+ %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }
16
+ = link_to 'Galleries', galleries_path
17
+ = link_to '[+]', new_gallery_path
18
+ %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }
19
+ = link_to 'Reports', reports_path
20
+ = link_to '[+]', new_report_path
21
+ %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }
22
+ = link_to 'Videos', videos_path
23
+ = link_to '[+]', new_video_path
24
+ %li{ :class => params[:controller] == 'ish_manager/user_profiles' ? 'active' : '' }= link_to 'Profiles', user_profiles_path
40
25
  %hr
41
26
 
@@ -0,0 +1,22 @@
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_watches' ? 'active' : '' }= link_to 'Stock Watches', stock_watches_path
12
+ -# %li{ :class => params[:controller] == 'ish_manager/stock_actions' ? 'active' : '' }= link_to 'Stock Actions', stock_actions_path
13
+ -# %li{ :class => params[:controller] == 'ish_manager/stock_options' ? 'active' : '' }= link_to 'Stock Options', stock_options_path
14
+ -# %li{ :class => params[:controller] == 'ish_manager/iron_condors' ? 'active' : '' }= link_to 'Iron Condors', iron_condors_path
15
+ -# %li{ :class => params[:controller] == 'ish_manager/covered_calls' ? 'active' : '' }= link_to 'Covered Calls', covered_calls_path
16
+ %ul.nav.nav-pills
17
+ %li{ :class => params[:controller] == 'ish_manager/invoices' ? 'active' : '' }= link_to 'Invoices', invoices_path
18
+ %li{ :class => params[:controller] == 'ish_manager/payments' ? 'active' : '' }= link_to 'Payments', payments_path
19
+ %li{ :class => params[:controller] == 'ish_manager/orders' ? 'active' : '' }= link_to 'Orders', orders_path
20
+ %ul.nav.nav-pills
21
+ %li{ :class => params[:controller] == 'ish_manager/leads' ? 'active' : '' }= link_to 'Leads', leads_path
22
+ %li{ :class => params[:controller] == 'ish_manager/campaigns' ? 'active' : '' }= link_to 'Campaigns', campaigns_path
@@ -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'
@@ -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'
@@ -8,4 +8,4 @@
8
8
  .a= button_to '+newsitem', new_map_newsitem_path(map), method: :get
9
9
  .a= link_to '[api]', api_map_path(map)
10
10
  .a= button_to 'x', map_path(map), method: :delete, data: { confirm: 'Are you sure?' }
11
- .a= map.slug
11
+ .a slug:#{map.slug}
@@ -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
- - @map.markers.each do |m|
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 (#{@map.markers.length})
15
+ Markers (#{@markers.length})
15
16
  = link_to '[+]', new_marker_path({ map_id: @map.id })
16
- - @map.markers.each do |m|
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,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
 
@@ -40,3 +42,5 @@
40
42
  .item
41
43
  = link_to m.slug, edit_map_path(m.id)
42
44
 
45
+ %hr
46
+ = render 'form'
@@ -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.257
4
+ version: 0.1.8.261
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-02 00:00:00.000000000 Z
11
+ date: 2021-11-15 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,9 +226,11 @@ 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
233
+ - app/views/ish_manager/application/_main_header_admin.haml-trash
235
234
  - app/views/ish_manager/application/_main_header_guy.haml
236
235
  - app/views/ish_manager/application/_main_header_manager.haml
237
236
  - app/views/ish_manager/application/_meta.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
-