ish_manager 0.1.8.28 → 0.1.8.29

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7292d2c1859450514a41a8e06de9039bb1f7f3bc
4
- data.tar.gz: 629ccdb9bc6838d31f126f97d5619874baad5445
3
+ metadata.gz: 4906e186c8e9a705ee44cf79f4634417b49a4846
4
+ data.tar.gz: 1c6c4f0140d51f29810b59fd3fccbdba51ecb7c1
5
5
  SHA512:
6
- metadata.gz: 3cc8adfea424ea18ee718676f81baae526a646d125a4f7c99106b963cf3a63fd78b5ab76a1b651f0efc0e4d71279f34419775f74e9a1559f72254ad796e08446
7
- data.tar.gz: 4fef125d5d9db186acd0db5a73e4399cddaf172986f51a383fd9358168fd5bb2cbb24615f63865d23c9e2254a8d44f58b2f698f45d640653393fe5183df654f9
6
+ metadata.gz: 61e5e96670dd89fe03d6380e4ea28ddd6b0352fb99cb3164579c4ca73c7e6ddc06c86878cb000780317ca4787832db957dbdb905eb05298d8c0cb1919f55ec5a
7
+ data.tar.gz: 008624bf8cd56187262d42f27334411e29225a7390d70a39a9ba0a03da097eea41c92786ac7563ea588aaaa72026e6200664da4ad559b48d3578ecf2d1aef817
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
1
 
2
2
  # Test
3
3
 
4
- # be rspec spec doesn't work so do
5
- be rspec spec/controllers
4
+ cd test/dummy && be rspec spec/controllers
@@ -26,5 +26,11 @@ module IshManager
26
26
  @tags_list = Tag.all.list
27
27
  end
28
28
 
29
+ private
30
+
31
+ def pp_errors err
32
+ err
33
+ end
34
+
29
35
  end
30
36
  end
@@ -4,65 +4,77 @@ class IshManager::FeaturesController < IshManager::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def new
7
- authorize! :new, ManagerFeature.new
8
- @city = City.find params[:city_id] unless params[:city_id].blank?
9
- @site = Site.find params[:site_id] unless params[:site_id].blank?
10
- @tag = Tag.find params[:tag_id] unless params[:tag_id].blank?
7
+ if params[:city_id]
8
+ @city = City.find params[:city_id]
9
+ authorize! :new_feature, @city
10
+ elsif params[:site_id]
11
+ @site = Site.find params[:site_id]
12
+ authorize! :new_feature, @site
13
+ elsif params[:tag_id]
14
+ @tag = Tag.find params[:tag_id]
15
+ authorize! :new_feature, @tag
16
+ end
17
+
11
18
  @feature = Feature.new
12
19
  end
13
20
 
14
21
  def create
15
- authorize! :create, ManagerFeature.new
22
+ @feature = Feature.new params[:feature].permit!
16
23
 
17
- @feature = Feature.new params[:feature].permit( :name, :subhead, :image_path, :link_path, :partial_name, :photo, :weight,
18
- :report, :report_id, :gallery, :gallery_id, :video, :video_id
19
- )
20
24
  if params[:city_id]
21
25
  @city = City.find params[:city_id]
26
+ authorize! :create_feature, @city
22
27
  @city.features << @feature
23
- redirect_path = manager_cities_path
28
+ @city.touch
29
+ redirect_path = cities_path
24
30
  end
25
31
  if params[:site_id]
26
32
  @site = Site.find params[:site_id]
33
+ authorize! :create_feature, @site
27
34
  @site.features << @feature
28
- redirect_path = manager_sites_path
35
+ @site.touch
36
+ redirect_path = sites_path
29
37
  end
30
38
  if params[:tag_id]
31
39
  @tag = Tag.find params[:tag_id]
40
+ authorize! :create_feature, @tag
32
41
  @tag.features << @feature
33
- redirect_path = manager_tags_path
42
+ @tag.touch
43
+ redirect_path = tags_path
34
44
  end
35
45
 
36
46
  if (@city && @city.save) || (@site && @site.save) || (@tag && @tag.save)
37
47
  flash[:notice] = 'Success.'
38
48
  redirect_to redirect_path
39
49
  else
40
- flash[:error] = 'No Luck. ' + ( @city || @site || @tag ).errors.inspect
50
+ flash[:alert] = "No luck: #{pp_errors @feature.errors.messages}"
41
51
  render :action => :new
42
52
  end
43
53
  end
44
54
 
45
55
  def edit
46
- authorize! :edit, ManagerCity.new
47
-
48
56
  if params[:city_id]
49
57
  @city = City.find params[:city_id]
50
58
  @feature = @city.features.find params[:id]
59
+ authorize! :edit_feature, @city
51
60
  end
52
61
 
53
62
  if params[:site_id]
54
63
  @site = Site.find params[:site_id]
55
64
  @feature = @site.features.find params[:id]
65
+ authorize! :edit_feature, @site
56
66
  end
57
67
 
58
68
  if params[:tag_id]
59
69
  @tag = Tag.find params[:tag_id]
60
70
  @feature = @tag.features.find params[:id]
71
+ authorize! :edit_feature, @tag
61
72
  end
62
73
 
63
74
  if params[:venue_id]
64
75
  @venue = Tag.find params[:venue_id]
65
76
  @feature = @venue.features.find params[:id]
77
+ authorize! :edit_feature, @venue
66
78
  end
67
79
 
68
80
  end
@@ -70,39 +82,44 @@ class IshManager::FeaturesController < IshManager::ApplicationController
70
82
  def update
71
83
  unless params[:city_id].blank?
72
84
  @city = City.find params[:city_id]
73
- authorize! :update, ManagerCity.new
85
+ authorize! :update_feature, @city
74
86
  @feature = @city.features.find params[:id]
75
- redirect_path = manager_city_path( @city )
87
+ redirect_path = city_path( @city )
76
88
  end
77
89
  unless params[:site_id].blank?
78
90
  @site = Site.find params[:site_id]
79
- authorize! :update, ManagerSite.new
91
+ authorize! :update_feature, @site
80
92
  @feature = @site.features.find params[:id]
81
- redirect_path = manager_site_path( @site )
93
+ redirect_path = site_path( @site )
82
94
  end
83
95
  unless params[:tag_id].blank?
84
96
  @tag = Tag.find params[:tag_id]
85
- authorize! :update, ManagerTag.new
97
+ authorize! :update_feature, @tag
86
98
  @feature = @tag.features.find params[:id]
87
- redirect_path = manager_tag_path( @tag )
99
+ redirect_path = tag_path( @tag )
88
100
  end
89
101
 
90
102
  if @feature.update_attributes params[:feature].permit!
91
- flash[:notice] = 'Success'
103
+ @city.touch if @city
104
+ @site.touch if @site
105
+ @tag.touch if @tag
106
+
107
+ flash[:notice] = 'updated feature'
92
108
  redirect_to redirect_path
93
109
  else
94
- flash[:error] = 'No Luck. ' + @feature.errors.inspect
95
- puts! @feature.errors, 'Errors updating feature'
96
- render :action => :edit_feature
110
+ flash[:error] = 'No Luck. ' + @feature.errors.messages
111
+ render :action => :edit
97
112
  end
98
113
  end
99
114
 
115
+ =begin
100
116
  def index
101
117
  if params[:tag_id]
102
118
  @resource = Tag.find params[:tag_id]
103
119
  end
104
120
 
105
121
  end
122
+ =end
106
123
 
107
124
  def destroy
108
125
  if params[:tag_id]
@@ -25,6 +25,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
25
25
  @city.newsitems << n
26
26
  flag = @city.save
27
27
  if flag
28
+ @city.touch
28
29
  url = edit_city_path( @city.id )
29
30
  else
30
31
  error = 'No Luck. ' + @city.errors.inspect
@@ -36,6 +37,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
36
37
  @site.newsitems << n
37
38
  flag = @site.save
38
39
  if flag
40
+ @site.touch
39
41
  url = edit_site_path( @site.id )
40
42
  else
41
43
  error = 'No Luck. ' + @site.errors.inspect
@@ -46,7 +48,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
46
48
  flash[:notice] = 'Success'
47
49
  redirect_to url
48
50
  else
49
- flash[:error] = error
51
+ flash[:alert] = error
50
52
  render :action => :new
51
53
  end
52
54
  end
@@ -108,6 +110,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
108
110
  def set_lists
109
111
  @videos_list = Video.list
110
112
  @galleries_list = Gallery.list
113
+ @reports_list = Report.list
111
114
  end
112
115
 
113
116
  end
@@ -0,0 +1,15 @@
1
+
2
+ class IshManager::UserProfilesController < IshManager::ApplicationController
3
+
4
+ def index
5
+ @user_profiles = IshModels::UserProfile.all
6
+ authorize! :index, IshModels::UserProfile
7
+ end
8
+
9
+ def show
10
+ @user_profile = IshModels::UserProfile.find params[:id]
11
+ authorize! :show, @user_profile
12
+ end
13
+
14
+ end
15
+
@@ -0,0 +1,13 @@
1
+
2
+ class IshManager::UsersController < IshManager::ApplicationController
3
+
4
+ def index
5
+ @users = User.all
6
+ end
7
+
8
+ def show
9
+ @user = User.find params[:id]
10
+ end
11
+
12
+ end
13
+
@@ -3,7 +3,7 @@
3
3
  %br
4
4
  .row
5
5
  .col-sm-6
6
- - if current_user
6
+ - if defined?( current_user ) && current_user
7
7
  >[ #{current_user.email} ]<
8
8
  = button_to '[x]', main_app.destroy_user_session_path, :method => :delete
9
9
  - else
@@ -13,5 +13,6 @@
13
13
  %li= link_to 'Sites', sites_path
14
14
  %li= link_to 'Venues', venues_path
15
15
  %li= link_to 'Videos', videos_path
16
+ %li= link_to 'Users', user_profiles_path
16
17
  %hr
17
18
 
@@ -1,8 +1,6 @@
1
1
 
2
- - url ||= manager_cities_path
3
-
4
2
  .manager-cities--form
5
- = form_for @city, :url => url do |f|
3
+ = form_for @city do |f|
6
4
  .row
7
5
  .small-6.columns
8
6
  .field
@@ -2,7 +2,9 @@
2
2
  .container
3
3
  .row
4
4
  .col-xs-12
5
- %h1 Cities
5
+ %h1
6
+ Cities
7
+ = link_to '[+]', new_city_path
6
8
 
7
9
  - @cities.each do |city|
8
10
  .col-xs-3
@@ -1,23 +1,17 @@
1
1
 
2
2
  -# manager/features/_form
3
3
 
4
- - if @site
5
- - if 'new' == params[:action]
6
- - url = manager_site_features_path site.id
7
- - if 'edit' == params[:action]
8
- - url = manager_site_feature_path site.id, feature.id
9
- - elsif @city
10
- - if 'new' == params[:action]
11
- - url = manager_city_features_path city.id
12
- - if 'edit' == params[:action]
13
- - url = manager_city_feature_path city.id, feature.id
14
- - elsif @tag
15
- - if 'new' == params[:action]
16
- - url = manager_tag_features_path tag.id
17
- - if 'edit' == params[:action]
18
- - url = manager_tag_feature_path tag.id, feature.id
19
-
20
- = form_for feature, :url => url do |f|
4
+ = form_for @feature do |f|
5
+ - if @city
6
+ = hidden_field_tag :city_id, @city.id
7
+ City #{@city.name}
8
+ - if @site
9
+ = hidden_field_tag :site_id, @site.id
10
+ Site #{@site.domain}
11
+ - if @tag
12
+ = hidden_field_tag :tag_id, @tag.id if @tag
13
+ Tag #{@tag.name}
14
+
21
15
  .row
22
16
  .large-6.columns
23
17
  = f.label :name
@@ -3,14 +3,5 @@
3
3
  .large-12.columns
4
4
  %h1
5
5
  Edit Feature
6
- .meta
7
- = "in city #{@feature.city.name}" unless @feature.city.blank?
8
- = "in site http://#{@feature.site.domain}/#{@feature.site.lang}" unless @feature.site.blank?
9
- = "in tag #{@feature.tag.name}" unless @feature.tag.blank?
10
6
 
11
- - if @site
12
- = render 'manager/features/form', :feature => @feature, :site => @site
13
- - elsif @city
14
- = render 'manager/features/form', :feature => @feature, :city => @city
15
- - elsif @tag
16
- = render 'manager/features/form', :feature => @feature, :tag => @tag
7
+ = render 'form', :feature => @feature
@@ -14,6 +14,9 @@
14
14
  .a
15
15
  = f.label :gallery
16
16
  = f.select :gallery_id, options_for_select( @galleries_list )
17
+ .a
18
+ = f.label :report
19
+ = f.select :report_id, options_for_select( @reports_list )
17
20
  .a
18
21
  = f.submit :submit
19
22
 
@@ -1,17 +1,19 @@
1
1
 
2
2
  - if defined? site
3
- - edit_url = ->(n) { edit_site_newsitem_path( site, n ) }
4
- - delete_url = ->(n) { site_newsitem_path( site, n ) }
3
+ - edit_url = ->(n) { edit_site_newsitem_path( site, n ) }
4
+ - delete_url = ->(n) { site_newsitem_path( site, n ) }
5
+ - new_newsitem = new_site_newsitem_path( site.id )
5
6
  - if defined? city
6
- - edit_url = ->(n) { edit_city_newsitem_path( city, n ) }
7
- - delete_url = ->(n) { city_newsitem_path( city, n ) }
8
-
7
+ - edit_url = ->(n) { edit_city_newsitem_path( city, n ) }
8
+ - delete_url = ->(n) { city_newsitem_path( city, n ) }
9
+ - new_newsitem = new_city_newsitem_path( city.id )
10
+
9
11
  - newsitems = newsitems.page( params[:newsitems_page] ).per( 10 )
10
12
 
11
13
  .manager-newsitems--index
12
14
  .row
13
15
  .col-sm-12
14
- %h2 Newsitems (#{newsitems.count}) #{link_to '[+]', new_site_newsitem_path( site.id )}
16
+ %h2 Newsitems (#{newsitems.count}) #{link_to '[+]', new_newsitem }
15
17
  = paginate newsitems, :param_name => 'newsitems_page'
16
18
  %ol
17
19
  - newsitems.each do |n|
@@ -1,2 +1,2 @@
1
1
 
2
- = render 'form', :site => @site, :url => manager_sites_path
2
+ = render 'form', :site => @site, :url => sites_path
@@ -0,0 +1,12 @@
1
+
2
+ %h1 User Profiles (#{@user_profiles.count})
3
+
4
+ %ul
5
+ - @user_profiles.each do |profile|
6
+ %li
7
+ &nbsp;
8
+ %ul
9
+ %li= profile.email
10
+ %li= profile.name
11
+ %li= profile.fb_access_token
12
+ %br
@@ -0,0 +1,2 @@
1
+
2
+ %h1 User Profiles
data/config/routes.rb CHANGED
@@ -11,21 +11,32 @@ IshManager::Engine.routes.draw do
11
11
  resources :events
12
12
  resources :venues
13
13
  end
14
+
14
15
  resources :events
16
+
17
+ resources :features
18
+
15
19
  resources :galleries do
16
20
  post 'multiadd', :to => 'photos#j_create', :as => :multiadd
17
21
  end
22
+
18
23
  resources :newsitems
24
+
19
25
  resources :photos
26
+
20
27
  resources :reports
28
+
21
29
  resources :sites do
22
30
  resources :features
23
31
  resources :galleries
24
32
  resources :newsitems
25
33
  resources :reports
26
34
  end
35
+
27
36
  resources :tags
37
+
28
38
  resources :user_profiles
39
+
29
40
  resources :venues
30
41
  resources :videos
31
42
 
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.28
4
+ version: 0.1.8.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-14 00:00:00.000000000 Z
11
+ date: 2017-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -145,6 +145,8 @@ files:
145
145
  - app/controllers/ish_manager/reports_controller.rb
146
146
  - app/controllers/ish_manager/sites_controller.rb
147
147
  - app/controllers/ish_manager/tags_controller.rb
148
+ - app/controllers/ish_manager/user_profiles_controller.rb
149
+ - app/controllers/ish_manager/user_profiles_controller.rb~
148
150
  - app/controllers/ish_manager/users_controller.rb
149
151
  - app/controllers/ish_manager/venues_controller.rb
150
152
  - app/controllers/ish_manager/venues_controller.rb~
@@ -243,6 +245,8 @@ files:
243
245
  - app/views/ish_manager/tags/index.haml
244
246
  - app/views/ish_manager/tags/new.haml
245
247
  - app/views/ish_manager/tags/show.haml
248
+ - app/views/ish_manager/user_profiles/index.haml
249
+ - app/views/ish_manager/user_profiles/index.haml~
246
250
  - app/views/ish_manager/users/_index.haml
247
251
  - app/views/ish_manager/users/_index.haml~
248
252
  - app/views/ish_manager/venues/_form.haml