ish_manager 0.1.8.318 → 0.1.8.321

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/bg/{weather-development.png → weather-bg-development.png} +0 -0
  3. data/app/assets/images/bg/{weather.png → weather-bg.png} +0 -0
  4. data/app/assets/javascripts/ish_manager/application.js +2 -0
  5. data/app/assets/stylesheets/ish_manager/application.scss +33 -6
  6. data/app/assets/stylesheets/ish_manager/email_templates.scss +4 -2
  7. data/app/assets/stylesheets/ish_manager/galleries.scss +7 -4
  8. data/app/assets/stylesheets/ish_manager/maps.scss +14 -13
  9. data/app/controllers/ish_manager/application_controller.rb +6 -26
  10. data/app/controllers/ish_manager/email_contexts_controller.rb +2 -1
  11. data/app/controllers/ish_manager/email_templates_controller.rb +9 -3
  12. data/app/controllers/ish_manager/{unsubscribes_controller.rb → email_unsubscribes_controller.rb} +1 -1
  13. data/app/controllers/ish_manager/galleries_controller.rb +11 -4
  14. data/app/controllers/ish_manager/photos_controller.rb +18 -6
  15. data/app/controllers/ish_manager/reports_controller.rb +0 -12
  16. data/app/controllers/ish_manager/{tags_controller.rb → trash/tags_controller.rb} +0 -0
  17. data/app/controllers/ish_manager/{users_controller.rb → trash/users_controller.rb} +0 -0
  18. data/app/controllers/ish_manager/videos_controller.rb +1 -10
  19. data/app/mailers/ish_manager/application_mailer.rb +0 -5
  20. data/app/models/ish_manager/ability.rb +14 -25
  21. data/app/views/ish_manager/application/_form_nonpublic.haml +12 -14
  22. data/app/views/ish_manager/application/_main_footer.haml +3 -6
  23. data/app/views/ish_manager/application/_main_header_admin.haml +31 -23
  24. data/app/views/ish_manager/application/_main_header_guy.haml +23 -12
  25. data/app/views/ish_manager/application/_meta.haml +0 -5
  26. data/app/views/ish_manager/application/home.haml +1 -1
  27. data/app/views/ish_manager/application/{_main_header.haml → trash/_main_header.haml} +0 -0
  28. data/app/views/ish_manager/application/{_main_header_manager.haml → trash/_main_header_manager.haml} +0 -0
  29. data/app/views/ish_manager/email_campaigns/index.haml +2 -0
  30. data/app/views/ish_manager/email_contexts/index.haml +2 -4
  31. data/app/views/ish_manager/email_contexts/show.haml +3 -1
  32. data/app/views/ish_manager/email_templates/_index.haml +15 -0
  33. data/app/views/ish_manager/email_templates/_marketing_ror_1.html +751 -0
  34. data/app/views/ish_manager/email_templates/iframe_src.haml +4 -0
  35. data/app/views/ish_manager/email_templates/index.haml +1 -17
  36. data/app/views/ish_manager/email_templates/show.haml +5 -2
  37. data/app/views/ish_manager/galleries/_form.haml +0 -11
  38. data/app/views/ish_manager/galleries/_index.haml +2 -3
  39. data/app/views/ish_manager/galleries/_title.haml +5 -2
  40. data/app/views/ish_manager/galleries/show.haml +9 -7
  41. data/app/views/ish_manager/maps/_form.haml +92 -91
  42. data/app/views/ish_manager/maps/_map_meta_row.haml +3 -1
  43. data/app/views/ish_manager/maps/map_editor.haml +1 -1
  44. data/app/views/ish_manager/maps/show.haml +14 -9
  45. data/app/views/ish_manager/markers/_header.haml +3 -3
  46. data/app/views/ish_manager/markers/_index.haml +15 -16
  47. data/app/views/ish_manager/newsitems/_index.haml +1 -0
  48. data/app/views/ish_manager/photos/_form.haml +0 -0
  49. data/app/views/ish_manager/photos/index.haml +3 -0
  50. data/app/views/ish_manager/photos/new.haml +0 -0
  51. data/app/views/ish_manager/reports/_form.haml +0 -6
  52. data/app/views/ish_manager/reports/index.haml +0 -7
  53. data/app/views/ish_manager/user_profiles/_form.haml +0 -4
  54. data/app/views/ish_manager/videos/_form.haml +0 -3
  55. data/app/views/layouts/ish_manager/application.haml +5 -5
  56. data/config/routes.rb +6 -55
  57. data/{config → lib}/systemd/system/stockwatcher.service +0 -0
  58. data/{config → lib}/systemd/system/watch_stocks.service +0 -0
  59. data/lib/tasks/{migrate.rake → done/migrate.rake} +0 -0
  60. metadata +18 -16
  61. data/app/assets/stylesheets/ish_manager/tags.scss +0 -7
  62. data/app/models/ish_manager/application_record.rb +0 -7
  63. data/app/views/ish_manager/email_contexts/iframe_src.haml +0 -4
  64. data/config/systemd/system/README.txt +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cc1e1c6fd0e576fee2cf327929a540a650cc4da39b025eb0ff97332ada0439e
4
- data.tar.gz: 83eb8dc00dd3fd7647ef6b65cf165f43d52986683ca8ce64cab8e8cefd9943ae
3
+ metadata.gz: 7b554f3447bbf60499ac307a8efeb764f61f5db98d420ef4d927c5d6eed58ff7
4
+ data.tar.gz: 1b494df22a16f71380129f99a69a95acde34d52d217afb884f93486b7cc98dbb
5
5
  SHA512:
6
- metadata.gz: 51f0cde29fabb31471868d98df64781619746d210388b6a5ff5f0228143f06b35f52ed1f9144d847e781be7e2e4607749b387080b07e696bfd3aae1424a2d69c
7
- data.tar.gz: df027163d5387582f1a8edd003151864544ef15dd7e09d0f5cb59d94774bb822a6de471049b82ec645ab5e6f6e6f8b432774a40e61f2123497687cf0326f2a84
6
+ metadata.gz: 821d34cfce66540bc6ccd23cfd653a8838e1bbabc6701e8caf2f93ff91d6cd5294ceeacd8a04d18af0e1dfb61a3a3b29ebbded4c211c2c8abe98b7883b21dde0
7
+ data.tar.gz: cfda033dae665b39fe6bc71614ad1ab1620217590ee313529f09e021496f8525a873d947a940846ef6af0606b6a19eaf75196dd34123dbe37f64036bc01d3613
@@ -78,6 +78,8 @@ $(function () {
78
78
  localStorage.setItem("collapse-expand#"+thisId, "collapsed")
79
79
  }
80
80
  $(this).next().slideToggle();
81
+ }).children().click(function (e) {
82
+ e.stopPropagation()
81
83
  })
82
84
 
83
85
 
@@ -4,7 +4,7 @@
4
4
  *= require ish_manager/jquery-ui
5
5
  *= require_self
6
6
  *
7
- * includes email contexts:
7
+ * includes email context:
8
8
  *= require ish_manager/email_templates
9
9
  *
10
10
  *= require ish_manager/galleries
@@ -12,12 +12,17 @@
12
12
  *= require ish_manager/markers
13
13
  *= require ish_manager/leads
14
14
  *= require ish_manager/photos
15
- *= require ish_manager/tags
16
15
  *= require ish_manager/user_profiles
17
16
  *= require ish_manager/videos
18
17
  *= require ish_manager/pagination
19
18
  **/
20
19
 
20
+ a[target='_blank'] {
21
+ &::after {
22
+ content: ' ^]' !important;
23
+ // font-size: .5em;
24
+ }
25
+ }
21
26
 
22
27
  body {
23
28
  background: #dedede;
@@ -27,6 +32,12 @@ hr {
27
32
  background: red;
28
33
  height: 1px !important;
29
34
  }
35
+
36
+ input[type='file'] {
37
+ overflow: auto;
38
+ max-width: 100%;
39
+ }
40
+
30
41
  pre {
31
42
  background: #e0e0e0;
32
43
  padding: 1em;
@@ -105,8 +116,13 @@ ul:not(.browser-default).bullets, {
105
116
  text-align: center;
106
117
  }
107
118
 
119
+
108
120
  .collapse-expand {
109
121
  cursor: pointer;
122
+
123
+ > * {
124
+ display: inline-block;
125
+ }
110
126
  }
111
127
 
112
128
  /* D */
@@ -186,7 +202,7 @@ textarea.large {
186
202
 
187
203
 
188
204
  .main-header {
189
- background: url('/assets/bg/weather.png');
205
+ background: url('//d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2022/10/05192823/weather-bg.png');
190
206
 
191
207
  a {
192
208
  background: white;
@@ -222,9 +238,8 @@ textarea.large {
222
238
  }
223
239
  }
224
240
 
225
- .main-header.development,
226
- .main-header.development_production {
227
- background: url('/assets/bg/weather-development.png');
241
+ .main-header.development {
242
+ background: url('//d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2022/10/05192822/weather-bg-development.png');
228
243
  }
229
244
 
230
245
  .menu-secondary {
@@ -296,6 +311,18 @@ textarea.large {
296
311
 
297
312
  /* W */
298
313
 
314
+ .W0 {
315
+ margin-top: 10px;
316
+ }
317
+
318
+ .WBordered {
319
+ border: 1px solid gray;
320
+ border-radius: 4px;
321
+ padding: 1em;
322
+ }
323
+
324
+ /* Y */
325
+
299
326
  .youtube_img {
300
327
  width: 100px;
301
328
  }
@@ -7,10 +7,11 @@
7
7
  }
8
8
  }
9
9
 
10
- .email-contexts-show {
10
+ .email-contexts-show,
11
+ .email-templates-show {
11
12
 
12
13
  iframe {
13
- min-height: 500px;
14
+ min-height: 80vh;
14
15
  }
15
16
 
16
17
  }
@@ -32,6 +33,7 @@
32
33
 
33
34
  }
34
35
 
36
+
35
37
  .email-templates--form {
36
38
  border: 1px solid red;
37
39
  padding: 1em;
@@ -5,14 +5,16 @@
5
5
  }
6
6
 
7
7
  .galleries--title {
8
- text-align: center;
8
+ // text-align: center;
9
9
  }
10
10
 
11
11
  .galleries-show {
12
- .row {
13
- display: block;
12
+ > * {
14
13
  border-bottom: 2px solid red;
14
+ }
15
15
 
16
+ > *:last-child {
17
+ border-bottom: none;
16
18
  }
17
19
 
18
20
  .row-large .goto {
@@ -30,7 +32,8 @@
30
32
  // }
31
33
 
32
34
  .row-large .item {
33
- border: 1px solid red;
35
+ // border: 1px solid red;
36
+ border-radius: 20px;
34
37
 
35
38
  display: block;
36
39
  margin-bottom: 1em;
@@ -2,22 +2,23 @@
2
2
  * Alphabetized : )
3
3
  **/
4
4
 
5
+ .maps--map-meta-row {
6
+ .flat-row {
7
+ display: flex;
8
+ flex-direction: row;
9
+ justify-content: flex-start;
10
+ align-content: flex-start;
5
11
 
6
- .flat-row {
7
- display: flex;
8
- flex-direction: row;
9
- justify-content: flex-start;
10
- align-content: flex-start;
11
-
12
- height: 2.4em;
13
- line-height: 3em;
12
+ // height: 2.4em;
13
+ line-height: 3em;
14
14
 
15
- width: 100%;
16
- margin: 1em 0 0 0;
17
- padding: 0;
15
+ width: 100%;
16
+ margin: 1em 0 0 0;
17
+ padding: 0;
18
18
 
19
- > * {
20
- padding-right: 1em;
19
+ > * {
20
+ padding-right: 1em;
21
+ }
21
22
  }
22
23
  }
23
24
 
@@ -1,25 +1,11 @@
1
1
  module IshManager
2
2
  class ApplicationController < ActionController::Base
3
- # protect_from_forgery :with => :exception, :prepend => true
3
+ protect_from_forgery :with => :exception, :prepend => true
4
4
  before_action :set_current_ability
5
5
  before_action :set_changelog
6
6
  check_authorization
7
7
  rescue_from ::CanCan::AccessDenied, :with => :access_denied
8
8
 
9
- def email_test
10
- authorize! :home, IshManager::Ability
11
- IshManager::ApplicationMailer.test_email(' 3dva ').deliver_later
12
-
13
- # wait_until = "2022-05-03T15:09".to_datetime.in_time_zone
14
- # puts! wait_until, 'wait untl'
15
-
16
- # # IshManager::TestEmailJob.set({ wait_until: wait_until }).perform_later
17
- # IshManager::TestEmailJob.perform_later
18
-
19
- flash[:notice] = 'Scheduled delivery.'
20
- redirect_to request.referrer
21
- end
22
-
23
9
  def home
24
10
  authorize! :home, IshManager::Ability
25
11
  render 'home'
@@ -35,20 +21,17 @@ module IshManager
35
21
  end
36
22
 
37
23
  def set_current_ability
38
- @current_ability ||= ::IshManager::Ability.new( current_user )
24
+ @current_profile ||= ::Ish::UserProfile.find_by({ email: current_user.email })
25
+ @current_ability ||= ::IshManager::Ability.new( @current_profile )
39
26
  end
40
27
 
28
+ # @TODO: obsolete, remove _vp_ 2022-10-15
41
29
  def set_lists
42
30
  # alphabetized! : )
43
- @cities_list = City.list
44
31
  @galleries_list = Gallery.all.list
45
- @locations_list = ::Gameui::Map.list
46
32
  @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
47
33
  @reports_list = Report.all.list
48
- @sites_list = Site.all.list
49
- @tags_list = Tag.list
50
34
  @user_profiles_list = Ish::UserProfile.list
51
- @venues_list = Venue.all.list
52
35
  @videos_list = Video.all.list
53
36
  end
54
37
 
@@ -66,10 +49,11 @@ module IshManager
66
49
  puts a.inspect
67
50
  end
68
51
 
52
+ # @TODO: obsolete, remove _vp_ 2022-10-15
69
53
  def update_profile_pic
70
54
  return unless params[:photo]
71
55
  @photo = Photo.new :photo => params[:photo]
72
- @photo.user_profile = @current_user.profile
56
+ @photo.user_profile = @current_profile
73
57
  flag = @photo.save
74
58
  @resource.profile_photo = @photo
75
59
  flagg = @resource.save
@@ -83,12 +67,8 @@ module IshManager
83
67
 
84
68
  def resource_path resource
85
69
  case resource.class.name
86
- when 'City'
87
- city_path( resource.id )
88
70
  when 'Event'
89
71
  event_path( resource.id )
90
- when 'Venue'
91
- venue_path( resource.id )
92
72
  end
93
73
  end
94
74
 
@@ -32,7 +32,8 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
32
32
  def iframe_src
33
33
  authorize! :iframe_src, Ish::EmailContext
34
34
  @email_ctx = EmailContext.find params[:id]
35
- render layout: false
35
+ @email_template = @email_ctx.email_template
36
+ render 'ish_manager/email_templates/iframe_src', layout: false
36
37
  end
37
38
 
38
39
  def index
@@ -25,6 +25,10 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
25
25
 
26
26
  def iframe_src
27
27
  authorize! :iframe_src, Ish::EmailTemplate
28
+ @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
29
+ Ish::EmailTemplate.find_by({ slug: params[:id] })
30
+ @email_ctx = EmailContext.new({ body: Ish::LoremIpsum.html })
31
+ render layout: false
28
32
  end
29
33
 
30
34
  def index
@@ -34,9 +38,11 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
34
38
 
35
39
  def show
36
40
  authorize! :show, Ish::EmailTemplate
37
- @email_ctx = EmailContext.new
38
- @template = Ish::EmailTemplate.where({ id: params[:id] }).first || Ish::EmailTemplate.find_by({ slug: params[:id] })
39
- # render params[:id], layout: false
41
+ @templates = Ish::EmailTemplate.all.page( params[:templates_page] )
42
+
43
+ @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
44
+ Ish::EmailTemplate.find_by({ slug: params[:id] })
45
+ @email_ctx = EmailContext.new({ body: Ish::LoremIpsum.html })
40
46
  end
41
47
 
42
48
 
@@ -1,5 +1,5 @@
1
1
 
2
- class ::IshManager::UnsubscribesController < IshManager::ApplicationController
2
+ class ::IshManager::EmailUnsubscribesController < IshManager::ApplicationController
3
3
 
4
4
  layout false
5
5
 
@@ -38,15 +38,18 @@ class IshManager::GalleriesController < IshManager::ApplicationController
38
38
 
39
39
  def index
40
40
  authorize! :index, Gallery
41
- @galleries = Gallery.unscoped.where(
42
- # :is_done.in => [false, nil],
43
- # :is_trash.in => [false, nil],
44
- # :user_profile => current_user.profile
41
+ @page_title = 'Galleries'
42
+ @galleries = Gallery.unscoped.where( ## This must be so for role `guy`. _vp_ 2022-10-03
43
+ :is_done.in => [false, nil],
44
+ :is_trash.in => [false, nil],
45
+ :user_profile => current_user.profile
45
46
  ).order_by( :created_at => :desc )
47
+
46
48
  if params[:q]
47
49
  @galleries = @galleries.where({ :name => /#{params[:q]}/i })
48
50
  # @galleries.selector.delete('is_done')
49
51
  end
52
+
50
53
  @galleries = @galleries.page( params[:galleries_page] ).per( 10 )
51
54
  render params[:render_type]
52
55
  end
@@ -68,11 +71,13 @@ class IshManager::GalleriesController < IshManager::ApplicationController
68
71
 
69
72
  def new
70
73
  @gallery = Gallery.new
74
+ @page_title = 'New Gallery'
71
75
  authorize! :new, @gallery
72
76
  end
73
77
 
74
78
  def shared_with_me
75
79
  authorize! :index, Gallery
80
+ @page_title = 'Galleries Shared With Me'
76
81
  @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
77
82
  ).order_by( :created_at => :desc
78
83
  ).page( params[:shared_galleries_page] ).per( 10 )
@@ -116,6 +121,8 @@ class IshManager::GalleriesController < IshManager::ApplicationController
116
121
  rescue
117
122
  @gallery = Gallery.unscoped.find params[:id]
118
123
  end
124
+ @page_title = "#{@gallery.name} Gallery"
125
+ @page_description = @gallery.subhead
119
126
  end
120
127
 
121
128
  end
@@ -5,9 +5,7 @@ class IshManager::PhotosController < IshManager::ApplicationController
5
5
  skip_authorization_check :only => [ :j_create ]
6
6
  protect_from_forgery :except => [ :j_create]
7
7
 
8
- def without_gallery
9
- @photos = Photo.unscoped.where( :gallery => nil, :is_trash => false )
10
- end
8
+ ## Alphabetized : )
11
9
 
12
10
  def destroy
13
11
  @photo = Photo.unscoped.find params[:id]
@@ -23,9 +21,9 @@ class IshManager::PhotosController < IshManager::ApplicationController
23
21
  redirect_to request.referrer || root_path
24
22
  end
25
23
 
26
- def show
27
- @photo = Photo.unscoped.find params[:id]
28
- authorize! :show, @photo
24
+ def index
25
+ authorize! :index, Photo
26
+ @photos = Photo.all.page( params[:photos_page] )
29
27
  end
30
28
 
31
29
  def j_create
@@ -63,5 +61,19 @@ class IshManager::PhotosController < IshManager::ApplicationController
63
61
  end
64
62
  end
65
63
 
64
+ def new
65
+ authorize! :new, Photo
66
+ @photo = Photo.new
67
+ end
68
+
69
+ def show
70
+ @photo = Photo.unscoped.find params[:id]
71
+ authorize! :show, @photo
72
+ end
73
+
74
+ def without_gallery
75
+ @photos = Photo.unscoped.where( :gallery => nil, :is_trash => false )
76
+ end
77
+
66
78
  end
67
79
 
@@ -32,8 +32,6 @@ class IshManager::ReportsController < IshManager::ApplicationController
32
32
  format.html do
33
33
  flash[:alert] = @report.errors.full_messages
34
34
  @tags_list = Tag.all.list
35
- @sites_list = Site.all.list
36
- @cities_list = City.all.list
37
35
 
38
36
  render :action => "new"
39
37
  end
@@ -60,13 +58,6 @@ class IshManager::ReportsController < IshManager::ApplicationController
60
58
  @reports = Report.unscoped.order_by( :created_at => :desc
61
59
  ).where( :is_trash => false, :user_profile => current_user.profile
62
60
  ).page( params[:reports_page] ).per( Report::PER_PAGE )
63
- if false === params[:site]
64
- @reports = @reports.where( :site_id => nil )
65
- end
66
- if params[:site_id]
67
- @site = Site.find params[:site_id]
68
- @reports = @reports.where( :site_id => params[:site_id] )
69
- end
70
61
  if params[:q]
71
62
  @reports = @reports.or({ slug: /#{params[:q]}/i }, { name: /#{params[:q]}}/i }) # @TODO: why can't I have space in search term?
72
63
  if @reports.length == 1
@@ -80,9 +71,6 @@ class IshManager::ReportsController < IshManager::ApplicationController
80
71
  @report = Report.new
81
72
  authorize! :new, @report
82
73
  @tags_list = Tag.all.where( :is_public => true ).list
83
- @sites_list = Site.all.list
84
- @cities_list = City.list
85
- @venues_list = Venue.all.list
86
74
 
87
75
  respond_to do |format|
88
76
  format.html do
@@ -7,7 +7,7 @@ class IshManager::VideosController < IshManager::ApplicationController
7
7
 
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
- tags city site user_profile premium_tier premium_purchases thumb video |)
10
+ site user_profile premium_tier premium_purchases thumb video |)
11
11
  @video.user_profile = current_user.profile
12
12
  if !params[:video][:site_id].blank?
13
13
  @video.site = Site.find params[:video][:site_id]
@@ -26,7 +26,6 @@ class IshManager::VideosController < IshManager::ApplicationController
26
26
  else
27
27
  flash[:alert] = 'No luck'
28
28
  @tags_list = Tag.list
29
- @cities_list = City.list
30
29
  render :action => 'new'
31
30
  end
32
31
  end
@@ -35,7 +34,6 @@ class IshManager::VideosController < IshManager::ApplicationController
35
34
  @video = Video.unscoped.find params[:id]
36
35
  authorize! :destroy, @video
37
36
  flag = @video.delete
38
- @video.city.touch if @video.city
39
37
  @video.site.touch if @video.site
40
38
  @video.tags.map &:touch
41
39
  if flag
@@ -52,18 +50,12 @@ class IshManager::VideosController < IshManager::ApplicationController
52
50
  authorize! :edit, @video
53
51
 
54
52
  @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
55
- @cities_list = City.list
56
53
  end
57
54
 
58
55
  def index
59
56
  authorize! :index, Video.new
60
57
  @videos = Video.unscoped.where( is_trash: false, :user_profile => current_user.profile ).order_by( :created_at => :desc )
61
58
 
62
- if params[:city_id]
63
- city = City.find params[:city_id]
64
- @videos = @videos.where( :city => city )
65
- end
66
-
67
59
  if params[:tag_id]
68
60
  tag = Tag.find params[:tag_id]
69
61
  @videos = @videos.where( :tag => tag )
@@ -108,7 +100,6 @@ class IshManager::VideosController < IshManager::ApplicationController
108
100
  authorize! :new, @video
109
101
 
110
102
  @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
111
- @cities_list = City.list
112
103
  end
113
104
 
114
105
  def update
@@ -25,10 +25,5 @@ module IshManager
25
25
  mail( :to => stock.profile.email, :subject => "IshManager Stock Alert :: #{stock.ticker}" ).deliver
26
26
  end
27
27
 
28
- def test_email s=''
29
- puts! s, "#test_email - delivering"
30
- mail( to: 'piousbox@gmail.com', subject: "Test #{s} :: #{DateTime.now.strftime("%Y-%m-%d %l:%M:%S %P")}" )
31
- end
32
-
33
28
  end
34
29
  end
@@ -2,17 +2,17 @@
2
2
  class IshManager::Ability
3
3
  include ::CanCan::Ability
4
4
 
5
- def initialize user
5
+ def initialize user_profile
6
6
 
7
7
  #
8
8
  # signed in user
9
9
  #
10
- if !user.blank?
10
+ if !user_profile.blank?
11
11
 
12
12
  #
13
13
  # only sudoer... total power
14
14
  #
15
- if user.profile && user.profile.sudoer?
15
+ if user_profile.sudoer?
16
16
  can :manage, :all
17
17
  end
18
18
 
@@ -21,53 +21,42 @@ class IshManager::Ability
21
21
  #
22
22
  # role admin
23
23
  #
24
- if user.profile && [ :admin ].include?( user.profile.role_name )
24
+ if user_profile && [ :admin ].include?( user_profile.role_name )
25
25
 
26
- can [ :create_newsitem, :show, :new_feature, :create_feature,
27
- :index, :new, :create, :edit, :update ], City
28
-
29
- can [ :new ], ::Feature
30
26
  can [ :friends_index, :friends_new ], ::Ish::UserProfile
31
27
 
32
28
  can [ :index, :new, :create, :create_photo ], ::Gallery
33
29
  can [ :edit, :update ], ::Gallery do |g|
34
- !g.is_trash && ( g.is_public || g.user_profile == user.profile )
30
+ !g.is_trash && ( g.is_public || g.user_profile == user_profile )
35
31
  end
36
32
  can [ :edit, :index, :show, :update,
37
33
  :new_marker, :edit_marker, :create_marker, :update_marker,
38
34
  ], Gameui::Map
39
35
 
40
- can [ :cities_index, :home, :sites_index ], ::Manager
36
+ can [ :home, :sites_index ], ::Manager
41
37
 
42
38
  can [ :new ], Newsitem
43
39
 
44
40
  can [ :index, :new, :create ], Report
45
41
  can [ :edit, :update, :destroy ], Report do |g|
46
- !g.is_trash && ( g.is_public || g.user_profile == user.profile )
42
+ !g.is_trash && ( g.is_public || g.user_profile == user_profile )
47
43
  end
48
44
 
49
- can [ :show, :edit, :update, :create_newsitem, :new_feature, :create_feature, :newsitems_index ], ::Site do |site|
50
- !site.is_private && !site.is_trash
51
- end
52
45
  # can [ :manage ], ::Warbler::StockWatch
53
46
 
54
47
  can [ :index, :new, :create ], ::Tag
55
48
 
56
49
  can [ :index, :new, :create ], ::Video
57
50
  can [ :edit, :update, :destroy ], ::Video do |v|
58
- !v.is_trash && ( v.is_public || v.user_profile == user.profile )
51
+ !v.is_trash && ( v.is_public || v.user_profile == user_profile )
59
52
  end
60
53
 
61
- can [ :index, :add, :create, :edit, :update, :show ], Venue
62
-
63
54
  end
64
55
 
65
56
  #
66
57
  # role manager
67
58
  #
68
- if user.profile && :manager == user.profile.role_name
69
- can [ :create_newsitem, :show, :new_feature, :create_feature,
70
- :index, :new, :create, :edit, :update ], City
59
+ if user_profile && :manager == user_profile.role_name
71
60
 
72
61
  can [ :edit, :index, :show, :update,
73
62
  :new_marker, :edit_marker, :create_marker, :update_marker,
@@ -79,14 +68,14 @@ class IshManager::Ability
79
68
  #
80
69
  # role guy (and manager)
81
70
  #
82
- if user.profile && [ :manager, :guy ].include?( user.profile.role_name )
71
+ if user_profile && [ :manager, :guy ].include?( user_profile.role_name )
83
72
 
84
73
  can [ :index, :new, :create ], ::Gallery
85
74
  can [ :show, :edit, :update, :create_photo ], ::Gallery do |gallery|
86
- gallery.user_profile == user.profile
75
+ gallery.user_profile == user_profile
87
76
  end
88
77
  can [ :show ], ::Gallery do |gallery|
89
- gallery.shared_profiles.include? user.profile
78
+ gallery.shared_profiles.include? user_profile
90
79
  end
91
80
 
92
81
  # can [ :index ], ::Report
@@ -100,7 +89,7 @@ class IshManager::Ability
100
89
  #
101
90
  # anonymous user
102
91
  #
103
- user ||= ::User.new
92
+ user_profile ||= ::Ish::UserProfile.new
104
93
 
105
94
  can [ :open_permission ], IshManager::Ability
106
95
 
@@ -112,7 +101,7 @@ class IshManager::Ability
112
101
  report.is_public
113
102
  end
114
103
 
115
- can [ :new, :create ], Ish::Unsubscribe
104
+ can [ :new, :create ], Ish::EmailUnsubscribe
116
105
 
117
106
  end
118
107
  end
@@ -1,16 +1,14 @@
1
1
 
2
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;
3
+ .WBordered
4
+ .row
5
+ .col-sm-3
6
+ = f.check_box :is_public
7
+ = f.label :is_public
8
+ .col-sm-4
9
+ = f.label 'Shared with'
10
+ = f.select :shared_profiles, options_for_select(@user_profiles_list, selected: model.shared_profile_ids), {}, { :multiple => true }
11
+ .col-sm-4
12
+ Shared with:<br />
13
+ - model.shared_profiles.each do |p|
14
+ &gt; #{p.email} <br />