ish_manager 0.1.8.321 → 0.1.8.323

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/ish_manager/application.scss +1 -0
  3. data/app/assets/stylesheets/ish_manager/email_templates.scss +2 -1
  4. data/app/assets/stylesheets/ish_manager/maps.scss +10 -0
  5. data/app/controllers/ish_manager/application_controller.rb +1 -8
  6. data/app/controllers/ish_manager/email_campaigns_controller.rb +2 -2
  7. data/app/controllers/ish_manager/email_contexts_controller.rb +26 -5
  8. data/app/controllers/ish_manager/galleries_controller.rb +3 -5
  9. data/app/controllers/ish_manager/leads_controller.rb +2 -2
  10. data/app/controllers/ish_manager/maps_controller.rb +13 -12
  11. data/app/controllers/ish_manager/markers_controller.rb +1 -1
  12. data/app/controllers/ish_manager/newsitems_controller.rb +9 -47
  13. data/app/controllers/ish_manager/photos_controller.rb +0 -2
  14. data/app/controllers/ish_manager/reports_controller.rb +2 -2
  15. data/app/controllers/ish_manager/user_profiles_controller.rb +7 -7
  16. data/app/controllers/ish_manager/videos_controller.rb +2 -29
  17. data/app/helpers/ish_manager/application_helper.rb +0 -15
  18. data/app/models/ish_manager/ability.rb +1 -1
  19. data/app/views/ish_manager/application/_main_header_admin.haml +4 -3
  20. data/app/views/ish_manager/application/_meta.haml +2 -2
  21. data/app/views/ish_manager/application/_paginate.haml +4 -0
  22. data/app/views/ish_manager/email_contexts/index.haml +20 -14
  23. data/app/views/ish_manager/{unsubscribes → email_unsubscribes}/new.haml +0 -0
  24. data/app/views/ish_manager/galleries/_form.haml +0 -4
  25. data/app/views/ish_manager/maps/_form.haml +9 -6
  26. data/app/views/ish_manager/markers/_form.haml +3 -0
  27. data/app/views/ish_manager/markers/_index.haml +7 -3
  28. data/app/views/ish_manager/newsitems/_form.haml +0 -6
  29. data/app/views/ish_manager/newsitems/_item.haml +0 -7
  30. data/app/views/ish_manager/newsitems/edit.haml +1 -10
  31. data/app/views/ish_manager/newsitems/index.haml +1 -7
  32. data/app/views/ish_manager/newsitems/new.haml +0 -4
  33. data/app/views/ish_manager/reports/_form.haml +0 -4
  34. data/app/views/ish_manager/reports/_index.haml +2 -5
  35. data/app/views/ish_manager/user_profiles/_form.haml +0 -4
  36. data/app/views/ish_manager/user_profiles/edit.haml +2 -3
  37. data/app/views/ish_manager/user_profiles/index.haml +1 -1
  38. data/app/views/ish_manager/videos/_form.haml +0 -6
  39. data/app/views/ish_manager/videos/_list.haml +1 -1
  40. data/app/views/ish_manager/videos/show.haml +1 -1
  41. data/config/routes.rb +2 -0
  42. data/lib/ish_manager.rb +1 -0
  43. metadata +18 -58
  44. data/app/controllers/ish_manager/trash/cities_controller.rb +0 -107
  45. data/app/controllers/ish_manager/trash/orders_controller.rb +0 -12
  46. data/app/controllers/ish_manager/trash/sites_controller.rb +0 -95
  47. data/app/controllers/ish_manager/trash/tags_controller.rb +0 -91
  48. data/app/controllers/ish_manager/trash/users_controller.rb +0 -15
  49. data/app/controllers/ish_manager/trash/venues_controller.rb +0 -72
  50. data/app/views/ish_manager/features/_form.haml +0 -70
  51. data/app/views/ish_manager/features/_index.haml +0 -43
  52. data/app/views/ish_manager/features/_item.haml +0 -16
  53. data/app/views/ish_manager/features/edit.haml +0 -7
  54. data/app/views/ish_manager/features/index.haml +0 -5
  55. data/app/views/ish_manager/features/new.haml +0 -11
  56. data/app/views/ish_manager/features/show.haml +0 -0
  57. data/app/views/ish_manager/markers/_index_small.haml-trash +0 -28
  58. data/app/views/ish_manager/tags/_features.haml +0 -12
  59. data/app/views/ish_manager/tags/_form.haml +0 -44
  60. data/app/views/ish_manager/tags/_index.haml +0 -16
  61. data/app/views/ish_manager/tags/_item.haml +0 -16
  62. data/app/views/ish_manager/tags/_list.haml +0 -8
  63. data/app/views/ish_manager/tags/_list_simple.haml +0 -5
  64. data/app/views/ish_manager/tags/_meta.haml +0 -9
  65. data/app/views/ish_manager/tags/edit.haml +0 -4
  66. data/app/views/ish_manager/tags/index.haml +0 -22
  67. data/app/views/ish_manager/tags/new.haml +0 -3
  68. data/app/views/ish_manager/tags/show.haml +0 -23
  69. data/app/views/ish_manager/trash/cities/_form.haml +0 -38
  70. data/app/views/ish_manager/trash/cities/_header.haml +0 -39
  71. data/app/views/ish_manager/trash/cities/edit.haml +0 -4
  72. data/app/views/ish_manager/trash/cities/edit_feature.haml +0 -4
  73. data/app/views/ish_manager/trash/cities/index.haml +0 -27
  74. data/app/views/ish_manager/trash/cities/new.haml +0 -5
  75. data/app/views/ish_manager/trash/cities/new_feature.haml +0 -5
  76. data/app/views/ish_manager/trash/cities/new_newsitem.haml +0 -23
  77. data/app/views/ish_manager/trash/cities/show.haml +0 -63
  78. data/app/views/ish_manager/trash/events/_form.haml +0 -45
  79. data/app/views/ish_manager/trash/events/_index.haml +0 -18
  80. data/app/views/ish_manager/trash/events/edit.haml +0 -2
  81. data/app/views/ish_manager/trash/events/index.haml +0 -2
  82. data/app/views/ish_manager/trash/events/new.haml +0 -2
  83. data/app/views/ish_manager/trash/meeting_mailer/README.txt +0 -5
  84. data/app/views/ish_manager/trash/sites/_form.haml +0 -63
  85. data/app/views/ish_manager/trash/sites/_header.haml +0 -21
  86. data/app/views/ish_manager/trash/sites/edit.haml +0 -3
  87. data/app/views/ish_manager/trash/sites/galleries.haml +0 -19
  88. data/app/views/ish_manager/trash/sites/index.haml +0 -26
  89. data/app/views/ish_manager/trash/sites/new.haml +0 -4
  90. data/app/views/ish_manager/trash/sites/show.haml +0 -18
  91. data/app/views/ish_manager/trash/venues/_form.haml +0 -43
  92. data/app/views/ish_manager/trash/venues/_index.haml +0 -13
  93. data/app/views/ish_manager/trash/venues/_search.haml +0 -7
  94. data/app/views/ish_manager/trash/venues/edit.haml +0 -5
  95. data/app/views/ish_manager/trash/venues/index.haml +0 -9
  96. data/app/views/ish_manager/trash/venues/new.haml +0 -5
  97. data/app/views/ish_manager/trash/venues/show.haml +0 -2
  98. data/app/views/layouts/ish_manager/application.haml-trash +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b554f3447bbf60499ac307a8efeb764f61f5db98d420ef4d927c5d6eed58ff7
4
- data.tar.gz: 1b494df22a16f71380129f99a69a95acde34d52d217afb884f93486b7cc98dbb
3
+ metadata.gz: 242184b51f9bcdd45bddc22ffb717d21276564471986e87405758c3d918db3e2
4
+ data.tar.gz: 7f94f8f0d60f68c264a636a3198c12c26e1797026e907775f4c3d7ed4a13818a
5
5
  SHA512:
6
- metadata.gz: 821d34cfce66540bc6ccd23cfd653a8838e1bbabc6701e8caf2f93ff91d6cd5294ceeacd8a04d18af0e1dfb61a3a3b29ebbded4c211c2c8abe98b7883b21dde0
7
- data.tar.gz: cfda033dae665b39fe6bc71614ad1ab1620217590ee313529f09e021496f8525a873d947a940846ef6af0606b6a19eaf75196dd34123dbe37f64036bc01d3613
6
+ metadata.gz: 3cfb4ecb6c2532892b29fa9c175f6a6c82e86b158d65868ab2e143beeac9f5519dad950a353d2ea6ba46226761d9c7a95e4bfa86f308dc981587629fc408e013
7
+ data.tar.gz: ad87c8bc229c961b65d1fb0aa90a84c24f032bf7c205d57d59c83d0a7b56b33815e33c276a19160154a885c81383135b30966cf88389e3383c32ef28c8ab15fc
@@ -192,6 +192,7 @@ ul.inline li {
192
192
  /* L */
193
193
  textarea.large {
194
194
  height: 400px;
195
+ width: 100%;
195
196
  }
196
197
 
197
198
  .large-photos img {
@@ -17,7 +17,8 @@
17
17
  }
18
18
 
19
19
  .email-templates-index ul li,
20
- .email-contexts-index {
20
+ .email-contexts-index .header,
21
+ .email-contexts-index ul.main li {
21
22
 
22
23
  a {
23
24
  margin-right: 0.5em;
@@ -2,6 +2,16 @@
2
2
  * Alphabetized : )
3
3
  **/
4
4
 
5
+ .is_active {
6
+ }
7
+ .not_is_active {
8
+ color: #ccc;
9
+ }
10
+
11
+ .not_is_3d {
12
+ text-decoration: line-through;
13
+ }
14
+
5
15
  .maps--map-meta-row {
6
16
  .flat-row {
7
17
  display: flex;
@@ -1,3 +1,4 @@
1
+
1
2
  module IshManager
2
3
  class ApplicationController < ActionController::Base
3
4
  protect_from_forgery :with => :exception, :prepend => true
@@ -62,14 +63,6 @@ module IshManager
62
63
  else
63
64
  flash[:alert] = "No Luck. #{@photo.errors.messages} #{@resource.errors.messages}"
64
65
  end
65
- # redirect_to resource_path( @resource )
66
- end
67
-
68
- def resource_path resource
69
- case resource.class.name
70
- when 'Event'
71
- event_path( resource.id )
72
- end
73
66
  end
74
67
 
75
68
  end
@@ -3,7 +3,7 @@ class ::IshManager::EmailCampaignsController < IshManager::ApplicationController
3
3
 
4
4
  def index
5
5
  authorize! :index, Ish::Campaign
6
- @campaigns = Ish::Campaign.where( :profile => current_user.profile, :is_trash => false )
6
+ @campaigns = Ish::Campaign.where( :profile => @current_profile, :is_trash => false )
7
7
  if params[:is_done]
8
8
  @campaigns = @campaigns.where( :is_done => true )
9
9
  else
@@ -18,7 +18,7 @@ class ::IshManager::EmailCampaignsController < IshManager::ApplicationController
18
18
 
19
19
  def create
20
20
  @campaign = Ish::Campaign.new params[:campaign].permit!
21
- @campaign.profile = current_user.profile
21
+ @campaign.profile = @current_profile
22
22
  authorize! :create, @campaign
23
23
  if @campaign.save
24
24
  flash[:notice] = "created campaign"
@@ -1,6 +1,8 @@
1
1
 
2
2
  class ::IshManager::EmailContextsController < ::IshManager::ApplicationController
3
3
 
4
+ # alphabetized : )
5
+
4
6
  before_action :set_lists
5
7
 
6
8
  def create
@@ -17,6 +19,18 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
17
19
  end
18
20
  end
19
21
 
22
+ def destroy
23
+ @email_ctx = EmailContext.find params[:id]
24
+ authorize! :destroy, @email_ctx
25
+ flag = @email_ctx.destroy
26
+ if flag
27
+ flash[:notice] = 'Destroyed the email context'
28
+ else
29
+ flash[:alert] = 'Could not destroy email context'
30
+ end
31
+ redirect_to action: :index
32
+ end
33
+
20
34
  def do_send
21
35
  authorize! :send, ::Ish::EmailContext
22
36
  IshManager::OfficeMailer.send_context_email(params[:id]).deliver_later
@@ -25,20 +39,24 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
25
39
  end
26
40
 
27
41
  def edit
28
- authorize! :edit, ::Ish::EmailContext
29
42
  @email_ctx = ::Ish::EmailContext.find params[:id]
43
+ authorize! :edit, @email_ctx
30
44
  end
31
45
 
32
46
  def iframe_src
33
- authorize! :iframe_src, Ish::EmailContext
34
47
  @email_ctx = EmailContext.find params[:id]
48
+ authorize! :iframe_src, @email_ctx
35
49
  @email_template = @email_ctx.email_template
36
50
  render 'ish_manager/email_templates/iframe_src', layout: false
37
51
  end
38
52
 
39
53
  def index
40
54
  authorize! :index, ::Ish::EmailContext
41
- @email_ctxs = ::Ish::EmailContext.all.page( params[:contexts_page] )
55
+ @email_ctxs = ::Ish::EmailContext.all
56
+ if params[:notsent]
57
+ @email_ctxs = @email_ctxs.where( sent_at: nil )
58
+ end
59
+ @email_ctxs = @email_ctxs.page( params[Ish::EmailContext::PAGE_PARAM_NAME] )
42
60
  end
43
61
 
44
62
  def new
@@ -47,13 +65,13 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
47
65
  end
48
66
 
49
67
  def show
50
- authorize! :show, ::Ish::EmailContext
51
68
  @email_ctx = ::Ish::EmailContext.find( params[:id] )
69
+ authorize! :show, @email_ctx
52
70
  end
53
71
 
54
72
  def update
55
- authorize! :update, ::Ish::EmailContext
56
73
  @email_ctx = ::Ish::EmailContext.find params[:id]
74
+ authorize! :update, @email_ctx
57
75
  if @email_ctx.update_attributes params[:ish_email_context].permit!
58
76
  flash[:notice] = 'Saved.'
59
77
  redirect_to action: 'show', id: @email_ctx.id
@@ -65,6 +83,9 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
65
83
  end
66
84
  end
67
85
 
86
+ #
87
+ # private
88
+ #
68
89
  private
69
90
 
70
91
  def set_lists
@@ -10,7 +10,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
10
10
  params[:gallery][:shared_profiles].delete('')
11
11
  params[:gallery][:shared_profiles] = Ish::UserProfile.find params[:gallery][:shared_profiles]
12
12
  @gallery = Gallery.new params[:gallery].permit!
13
- @gallery.user_profile = current_user.profile
13
+ @gallery.user_profile = @current_profile
14
14
  authorize! :create, @gallery
15
15
 
16
16
  if @gallery.save
@@ -42,7 +42,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
42
42
  @galleries = Gallery.unscoped.where( ## This must be so for role `guy`. _vp_ 2022-10-03
43
43
  :is_done.in => [false, nil],
44
44
  :is_trash.in => [false, nil],
45
- :user_profile => current_user.profile
45
+ :user_profile => @current_profile,
46
46
  ).order_by( :created_at => :desc )
47
47
 
48
48
  if params[:q]
@@ -78,7 +78,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
78
78
  def shared_with_me
79
79
  authorize! :index, Gallery
80
80
  @page_title = 'Galleries Shared With Me'
81
- @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
81
+ @galleries = @current_profile.shared_galleries.unscoped.where( :is_trash => false
82
82
  ).order_by( :created_at => :desc
83
83
  ).page( params[:shared_galleries_page] ).per( 10 )
84
84
  render params[:render_type]
@@ -94,8 +94,6 @@ class IshManager::GalleriesController < IshManager::ApplicationController
94
94
  old_shared_profile_ids = @gallery.shared_profiles.map(&:id)
95
95
  authorize! :update, @gallery
96
96
 
97
- params[:gallery][:tag_ids].delete('') if params[:gallery][:tag_ids]
98
-
99
97
  params[:gallery][:shared_profiles].delete('')
100
98
  params[:gallery][:shared_profile_ids] = params[:gallery][:shared_profiles]
101
99
  params[:gallery].delete :shared_profiles
@@ -5,7 +5,7 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
5
5
 
6
6
  def create
7
7
  @lead = Ish::Lead.new params[:lead].permit!
8
- @lead.profile = current_user.profile
8
+ @lead.profile = @current_profile
9
9
  authorize! :create, @lead
10
10
  if @lead.save
11
11
  flash[:notice] = "created lead"
@@ -22,7 +22,7 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
22
22
 
23
23
  def index
24
24
  authorize! :index, Ish::Lead
25
- @leads = Ish::Lead.all # where( :profile => current_user.profile, :is_trash => false )
25
+ @leads = Ish::Lead.all # where( :profile => @current_profile, :is_trash => false )
26
26
  if params[:is_done]
27
27
  @leads = @leads.where( :is_done => true )
28
28
  else
@@ -93,11 +93,7 @@ class IshManager::MapsController < IshManager::ApplicationController
93
93
  else
94
94
  p = Profile.new({ email: profile[:email], _id: profile[:_id] })
95
95
  u = User.where( email: profile[:email] ).first
96
- if u
97
- u.profile = p
98
- else
99
- u = User.new( email: profile[:email], password: rand.to_s, profile: p )
100
- end
96
+ u ||= User.new( email: profile[:email], password: rand.to_s )
101
97
  flag = u.save && p.save
102
98
  if flag
103
99
  errors.push({ message: "Profile created for #{profile[:email]}." })
@@ -182,16 +178,21 @@ class IshManager::MapsController < IshManager::ApplicationController
182
178
  end
183
179
  end
184
180
 
181
+ if map_params[:parent_slug].present?
182
+ @map.parent = ::Gameui::Map.find_by({ slug: map_params[:parent_slug] })
183
+ else
184
+ @map.parent = nil
185
+ end
186
+
185
187
  respond_to do |format|
186
- if map_params[:parent_slug].present?
187
- @map.parent = ::Gameui::Map.find_by({ slug: map_params[:parent_slug] })
188
- else
189
- @map.parent = nil
190
- end
191
188
  if @map.update(map_params)
192
- format.html { redirect_to map_path(@map), notice: 'Map was successfully updated.' }
189
+ format.html do # format is required
190
+ redirect_to edit_map_path(@map), notice: 'Map was successfully updated.'
191
+ end
193
192
  else
194
- format.html { render :edit }
193
+ format.html do
194
+ render :edit
195
+ end
195
196
  end
196
197
  end
197
198
  end
@@ -21,7 +21,7 @@ class IshManager::MarkersController < IshManager::ApplicationController
21
21
  @marker.map = @map
22
22
  authorize! :create_marker, @map
23
23
  @map_id = @map.id
24
- @marker.creator_profile_id = current_user.profile.id
24
+ @marker.creator_profile_id = @current_profile.id
25
25
 
26
26
  if params[:image]
27
27
  @marker.image = ::Ish::ImageAsset.new :image => params[:image]
@@ -5,12 +5,6 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
5
5
 
6
6
  def create
7
7
  @newsitem = Newsitem.new params[:newsitem].permit!
8
- @resource ||= City.find params[:city_id] if params[:city_id]
9
- @resource ||= City.find params[:newsitem][:city_id] if !params[:newsitem][:city_id].blank? # blank? required
10
- @resource ||= Site.find params[:site_id] if params[:site_id]
11
- @resource ||= Site.find params[:newsitem][:site_id] if !params[:newsitem][:site_id].blank?
12
- @resource ||= Tag.find params[:tag_id] if params[:tag_id]
13
- @resource ||= Tag.find params[:newsitem][:tag_id] if !params[:newsitem][:tag_id].blank?
14
8
  @resource ||= Ish::UserProfile.find params[:newsitem][:user_profile_id] if !params[:newsitem][:user_profile_id].blank?
15
9
  @resource ||= ::Gameui::Map.find params[:newsitem][:map_id] if !params[:newsitem][:map_id].blank?
16
10
  @resource.newsitems << @newsitem
@@ -20,22 +14,15 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
20
14
 
21
15
  if params[:photo]
22
16
  photo = Photo.create( :photo => params[:photo],
23
- :user_profile => current_user.profile,
17
+ :user_profile => @current_profile,
24
18
  descr: params[:descr],
25
19
  subhead: params[:subhead] )
26
20
  @newsitem.photo = photo
27
21
  end
28
22
 
29
23
  url = case @resource.class.name
30
- when "City"
31
- edit_city_path( @resource.id )
32
24
  when "Ish::UserProfile"
33
25
  user_profiles_path
34
- when "Site"
35
- edit_site_path( @resource.id )
36
- when "Tag"
37
- @resource.site.touch
38
- tag_path( @resource.id )
39
26
  else
40
27
  root_path
41
28
  end
@@ -48,8 +35,6 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
48
35
  else
49
36
  error = 'No Luck. ' + @newsitem.errors.messages.to_s + " :: " + photo.errors.messages.to_s
50
37
  flash[:alert] = error
51
- @sites = Site.list
52
- @cities = City.list
53
38
  render :action => :new
54
39
  end
55
40
  end
@@ -59,9 +44,6 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
59
44
  authorize! :destroy, @newsitem
60
45
 
61
46
  if @newsitem.destroy
62
- Tag.find(@newsitem.tag_id).touch if @newsitem.tag_id
63
- Map.find(@newsitem.map_id).touch if @newsitem.map_id
64
-
65
47
  flash[:notice] = "Destroyed the newsitem."
66
48
  else
67
49
  flash[:alert] = "Cannot destroy the newsitem: #{@newsitem.errors.full_messages}."
@@ -75,35 +57,18 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
75
57
  authorize! :edit, @newsitem
76
58
 
77
59
  ## @TODO: what on earth is this?
78
- out = Gallery.unscoped.where( :is_trash => false, :user_profile => current_user.profile ).order_by( :created_at => :desc )
60
+ out = Gallery.unscoped.where( :is_trash => false, :user_profile => @current_profile ).order_by( :created_at => :desc )
79
61
  @galleries_list = [['', nil]] + out.map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
80
62
 
81
63
  end
82
64
 
83
65
  def index
84
- @resource = Site.find( params[:site_id] ) if params[:site_id]
85
- @resource = City.find( params[:site_id] ) if params[:city_id]
86
-
87
66
  authorize! :newsitems_index, @resource
88
67
  @newsitems = @resource.newsitems
89
68
  end
90
69
 
91
70
  def new
92
-
93
71
  @newsitem = Newsitem.new
94
-
95
- if params[:city_id]
96
- @city = City.find params[:city_id]
97
- @newsitem.city = @city
98
- end
99
- if params[:site_id]
100
- @site = Site.find params[:site_id]
101
- @newsitem.site = @site
102
- end
103
- if params[:tag_id]
104
- @tag = Tag.unscoped.find params[:tag_id]
105
- @newsitem.tag = @tag
106
- end
107
72
  authorize! :new, @newsitem
108
73
  end
109
74
 
@@ -111,17 +76,9 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
111
76
  @newsitem = Newsitem.find params[:id]
112
77
  authorize! :update, @newsitem
113
78
 
114
- ## @TODO: re-add site management here, probably.
115
-
116
- if params[:city_id]
117
- @city = City.find params[:city_id]
118
- @newsitem = @city.newsitems.find params[:id]
119
- url = edit_city_path( @city )
120
- end
121
-
122
79
  if params[:photo]
123
80
  photo = Photo.new :photo => params[:photo]
124
- photo.user_profile = current_user.profile
81
+ photo.user_profile = @current_profile
125
82
  @newsitem.photo = photo
126
83
  end
127
84
 
@@ -132,7 +89,12 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
132
89
  flash[:alert] = "No Luck: #{@newsitem.errors.messages}"
133
90
  end
134
91
 
135
- redirect_to edit_newsitem_path(@newsitem)
92
+ if (@newsitem.map)
93
+ redirect_to map_path(@newsitem.map)
94
+ else
95
+ redirect_to edit_newsitem_path(@newsitem)
96
+ end
97
+
136
98
  end
137
99
 
138
100
  end
@@ -42,8 +42,6 @@ class IshManager::PhotosController < IshManager::ApplicationController
42
42
  @photo.gallery = gallery
43
43
 
44
44
  # cache
45
- @photo.gallery.site.touch if @photo.gallery.site
46
- @photo.gallery.city.touch if @photo.gallery.city
47
45
  @photo.gallery.touch
48
46
 
49
47
  if @photo.save
@@ -7,7 +7,7 @@ class IshManager::ReportsController < IshManager::ApplicationController
7
7
 
8
8
  def create
9
9
  @report = Report.new params[:report].permit!
10
- @report.user_profile = current_user.profile # @TODO: this should not be hard-coded
10
+ @report.user_profile = @current_profile # @TODO: this should not be hard-coded
11
11
  authorize! :create, @report
12
12
 
13
13
  flag = @report.save
@@ -56,7 +56,7 @@ class IshManager::ReportsController < IshManager::ApplicationController
56
56
  def index
57
57
  authorize! :index, Report
58
58
  @reports = Report.unscoped.order_by( :created_at => :desc
59
- ).where( :is_trash => false, :user_profile => current_user.profile
59
+ ).where( :is_trash => false, :user_profile => @current_profile
60
60
  ).page( params[:reports_page] ).per( Report::PER_PAGE )
61
61
  if params[:q]
62
62
  @reports = @reports.or({ slug: /#{params[:q]}/i }, { name: /#{params[:q]}}/i }) # @TODO: why can't I have space in search term?
@@ -4,7 +4,7 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def index
7
- @user_profiles = Ish::UserProfile.all.includes( :user )
7
+ @user_profiles = Ish::UserProfile.all
8
8
  authorize! :index, Ish::UserProfile
9
9
  end
10
10
 
@@ -49,21 +49,21 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
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 = Ish::UserProfile.new params[:profile].permit!
53
- authorize! :create, @user.profile
52
+ @user_profile = Ish::UserProfile.new params[:profile].permit!
53
+ authorize! :create, @user_profile
54
54
 
55
55
  if params[:photo]
56
56
  photo = Photo.new :photo => params[:photo]
57
- @profile.profile_photo = photo
57
+ @user_profile.profile_photo = photo
58
58
  end
59
59
 
60
60
  if !@user.save
61
- raise "cannot save profile.user: #{@profile.user.errors.full_messages} profile errors: #{@profile.errors.full_messages}"
61
+ raise "cannot save profile.user: #{@user.errors.full_messages} profile errors: #{@user_profile.errors.full_messages}"
62
62
  end
63
- if @user.profile.save
63
+ if @user_profile.save
64
64
  flash[:notice] = "Created profile"
65
65
  else
66
- flash[:alert] = "Cannot create profile: #{@profile.errors.messages}"
66
+ flash[:alert] = "Cannot create profile: #{@user_profile.errors.messages}"
67
67
  end
68
68
  redirect_to :action => :index
69
69
  end
@@ -8,16 +8,7 @@ class IshManager::VideosController < IshManager::ApplicationController
8
8
  def create
9
9
  @video = Video.new params[:video].permit(%i| name descr is_public is_trash is_feature x y lang youtube_id
10
10
  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
11
+ @video.user_profile = @current_profile
21
12
  authorize! :create, @video
22
13
 
23
14
  if @video.save
@@ -25,7 +16,6 @@ class IshManager::VideosController < IshManager::ApplicationController
25
16
  redirect_to videos_path
26
17
  else
27
18
  flash[:alert] = 'No luck'
28
- @tags_list = Tag.list
29
19
  render :action => 'new'
30
20
  end
31
21
  end
@@ -34,8 +24,6 @@ class IshManager::VideosController < IshManager::ApplicationController
34
24
  @video = Video.unscoped.find params[:id]
35
25
  authorize! :destroy, @video
36
26
  flag = @video.delete
37
- @video.site.touch if @video.site
38
- @video.tags.map &:touch
39
27
  if flag
40
28
  flash[:notice] = "deleted video"
41
29
  else
@@ -48,23 +36,11 @@ class IshManager::VideosController < IshManager::ApplicationController
48
36
  @video = Video.unscoped.find params[:id]
49
37
  @user_profiles_list = Ish::UserProfile.list
50
38
  authorize! :edit, @video
51
-
52
- @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
53
39
  end
54
40
 
55
41
  def index
56
42
  authorize! :index, Video.new
57
- @videos = Video.unscoped.where( is_trash: false, :user_profile => current_user.profile ).order_by( :created_at => :desc )
58
-
59
- if params[:tag_id]
60
- tag = Tag.find params[:tag_id]
61
- @videos = @videos.where( :tag => tag )
62
- end
63
-
64
- if params[:site_id]
65
- @site = Site.find params[:site_id]
66
- @videos = @site.videos
67
- end
43
+ @videos = Video.unscoped.where( is_trash: false, :user_profile => @current_profile ).order_by( :created_at => :desc )
68
44
 
69
45
  if params[:q]
70
46
  @videos = @videos.where({ :name => /#{params[:q]}/i })
@@ -98,8 +74,6 @@ class IshManager::VideosController < IshManager::ApplicationController
98
74
  def new
99
75
  @video = Video.new
100
76
  authorize! :new, @video
101
-
102
- @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
103
77
  end
104
78
 
105
79
  def update
@@ -108,7 +82,6 @@ class IshManager::VideosController < IshManager::ApplicationController
108
82
 
109
83
  @video.update params[:video].permit!
110
84
  if @video.save
111
- @video.site.touch if @video.site
112
85
  flash[:notice] = 'Success.'
113
86
  redirect_to videos_path
114
87
  else
@@ -39,24 +39,9 @@ module IshManager
39
39
  "$ #{'%.2f' % a}"
40
40
  end
41
41
 
42
- def resource_path resource
43
- case resource.class.name
44
- when 'City'
45
- city_path( resource.id )
46
- when 'Event'
47
- event_path( resource.id )
48
- when 'Venue'
49
- venue_path( resource.id )
50
- end
51
- end
52
-
53
42
  #
54
43
  # api paths
55
44
  #
56
- def api_city_path city
57
- "/api/cities/view/#{city.cityname}.json"
58
- end
59
-
60
45
  def api_map_path map
61
46
  "/api/maps/view/#{map.slug}"
62
47
  end
@@ -44,7 +44,7 @@ class IshManager::Ability
44
44
 
45
45
  # can [ :manage ], ::Warbler::StockWatch
46
46
 
47
- can [ :index, :new, :create ], ::Tag
47
+ # can [ :index, :new, :create ], ::Tag
48
48
 
49
49
  can [ :index, :new, :create ], ::Video
50
50
  can [ :edit, :update, :destroy ], ::Video do |v|
@@ -36,13 +36,14 @@
36
36
  = text_field_tag :q
37
37
  = link_to '[+]', new_map_path
38
38
 
39
- %li
40
- = link_to 'Tags', tags_path
39
+ -# %li
40
+ -# = link_to 'Tags', tags_path
41
+
41
42
  %ul
42
43
  %li= link_to '+Newsitem', new_newsitem_path
43
44
  -# %li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches (old m3)', stock_watches_path
44
45
  -# %li= link_to 'Stock Watches', '/iron_warbler/stock_watches'
45
- %li= link_to 'Users', users_path
46
+ -# %li= link_to 'Users', users_path
46
47
  %li= link_to 'Ish::UserProfiles', user_profiles_path
47
48
  %li
48
49
  = link_to "Ish::ImageAsset's", image_assets_path
@@ -6,8 +6,8 @@
6
6
  <b>By:</b>
7
7
  = link_to item.user_profile.name, edit_user_profile_path( item.user_profile )
8
8
 
9
- - if item.tags.length > 0
10
- <b>Tags:</b> #{ item.tags.map(&:name).join(', ') }
9
+ -# - if item.tags.length > 0
10
+ -# <b>Tags:</b> #{ item.tags.map(&:name).join(', ') }
11
11
 
12
12
  - if defined?(item.premium_tier) && item.premium_tier > 0
13
13
  <b>Tier:$#{item.premium_tier}</b>
@@ -0,0 +1,4 @@
1
+
2
+ -# Used only in email_contexts#index right now. _vp_ 2022-10-06
3
+
4
+ = paginate resource, param_name: resource.klass::PAGE_PARAM_NAME, views_prefix: 'ish_manager'
@@ -1,19 +1,25 @@
1
1
 
2
2
  .email-contexts-index
3
3
 
4
- %h2
5
- Paginated Email Contexts (aka emails)
6
- = link_to '+', new_email_context_path
4
+ .collapse-expand#emailContextsIndex
5
+ %h2.header
6
+ Paginated Email Contexts (aka emails)
7
+ = link_to '+', new_email_context_path
8
+ = link_to 'to-send', notsent_email_contexts_path
7
9
 
8
- %ul
9
- - @email_ctxs.each do |ctx|
10
- %li
11
- - if ctx.sent_at
12
- \----
13
- - else
14
- = link_to '~', edit_email_context_path(ctx)
15
- = link_to email_context_path(ctx) do
16
- view
17
- -# = link_to 'iframe', email_context_iframe_path(ctx), target: :_blank do
10
+ .W0
11
+ = render 'paginate', resource: @email_ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
18
12
 
19
- To #{ctx.to_email}: #{ctx.subject}
13
+ %ul.main
14
+ - @email_ctxs.each do |ctx|
15
+ %li
16
+ - if ctx.sent_at
17
+ \----
18
+ - else
19
+ = link_to '~', edit_email_context_path(ctx)
20
+ = link_to email_context_path(ctx) do
21
+ view
22
+ = button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
23
+ -# = link_to 'iframe', email_context_iframe_path(ctx), target: :_blank do
24
+
25
+ To #{ctx.to_email}: #{ctx.subject}
@@ -13,10 +13,6 @@
13
13
  .col.s6
14
14
  = f.label :slug
15
15
  = f.text_field :slug
16
- .row
17
- .col.s4
18
- = f.label :tags
19
- = f.select :tag_ids, @tags_list, {}, { multiple: true }
20
16
 
21
17
  = render 'ish_manager/application/form_nonpublic', f: f, model: gallery
22
18