ish_lib_engine 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ish_lib_engine/version.rb +1 -1
  3. metadata +1 -23
  4. data/app/controllers/ish_lib_engine/manager/cities_controller.rb +0 -95
  5. data/app/controllers/ish_lib_engine/manager/cities_controller.rb~ +0 -95
  6. data/app/controllers/ish_lib_engine/manager/features_controller.rb +0 -122
  7. data/app/controllers/ish_lib_engine/manager/features_controller.rb~ +0 -122
  8. data/app/controllers/ish_lib_engine/manager/galleries_controller.rb +0 -78
  9. data/app/controllers/ish_lib_engine/manager/galleries_controller.rb~ +0 -78
  10. data/app/controllers/ish_lib_engine/manager/manager_controller.rb +0 -31
  11. data/app/controllers/ish_lib_engine/manager/manager_controller.rb~ +0 -31
  12. data/app/controllers/ish_lib_engine/manager/newsitems_controller.rb +0 -47
  13. data/app/controllers/ish_lib_engine/manager/newsitems_controller.rb~ +0 -47
  14. data/app/controllers/ish_lib_engine/manager/photos_controller.rb +0 -20
  15. data/app/controllers/ish_lib_engine/manager/photos_controller.rb~ +0 -20
  16. data/app/controllers/ish_lib_engine/manager/reports_controller.rb +0 -62
  17. data/app/controllers/ish_lib_engine/manager/reports_controller.rb~ +0 -62
  18. data/app/controllers/ish_lib_engine/manager/sites_controller.rb +0 -72
  19. data/app/controllers/ish_lib_engine/manager/sites_controller.rb~ +0 -72
  20. data/app/controllers/ish_lib_engine/manager/tags_controller.rb +0 -54
  21. data/app/controllers/ish_lib_engine/manager/tags_controller.rb~ +0 -54
  22. data/app/controllers/ish_lib_engine/manager/users_controller.rb +0 -13
  23. data/app/controllers/ish_lib_engine/manager/users_controller.rb~ +0 -13
  24. data/app/controllers/ish_lib_engine/manager/welcome_controller.rb +0 -8
  25. data/app/controllers/ish_lib_engine/manager/welcome_controller.rb~ +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e20f00594ea69bb0afd040450bfd308c1165d761
4
- data.tar.gz: d9b35d6006851aac7cacb9df0fcfe99a34c481b6
3
+ metadata.gz: f911b4d73f519682bf4013886037c8622a8b7c15
4
+ data.tar.gz: 4dcea9c1e4c9b58393ea9f51ad29ee2664dd6de4
5
5
  SHA512:
6
- metadata.gz: 9db0d223fde7177bb0ab0d8463c82f6024cc1ce0c7b7600258c80b990e66dd6a5e7fa8880e712e0dc9777ba47dac3de411400cc81c51a6594a18a0c007301651
7
- data.tar.gz: 941c4ea19342e5498da52082ab1c95ce4ca931407882fe2f3a51e3121b0f770e7f2bf5998637ae2768a4c97460e8d99b8f6c0bee559cacac994e1e9e6ecd3b9b
6
+ metadata.gz: 2841d7a99463857401445a2a2ffb2aa2a825ca0c8d82d67c38cc0636b8bb0f9bba4487ee19e36e7178aeb8839fc475f1432f5e8680c3d5ee7c29d4d032494038
7
+ data.tar.gz: 333776038161728d9119de8f1c2b793e033dc39d87d31c20c3478333f26c46eb49f461e2f5ddef8d15d40d73f28f3954ba06b3722861e334a2f0b07249fd04ce
@@ -1,3 +1,3 @@
1
1
  module IshLibEngine
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_lib_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Piousbox
@@ -125,28 +125,6 @@ files:
125
125
  - app/assets/stylesheets/scaffold.css
126
126
  - app/controllers/ish_lib_engine/application_controller.rb
127
127
  - app/controllers/ish_lib_engine/articles_controller.rb
128
- - app/controllers/ish_lib_engine/manager/cities_controller.rb
129
- - app/controllers/ish_lib_engine/manager/cities_controller.rb~
130
- - app/controllers/ish_lib_engine/manager/features_controller.rb
131
- - app/controllers/ish_lib_engine/manager/features_controller.rb~
132
- - app/controllers/ish_lib_engine/manager/galleries_controller.rb
133
- - app/controllers/ish_lib_engine/manager/galleries_controller.rb~
134
- - app/controllers/ish_lib_engine/manager/manager_controller.rb
135
- - app/controllers/ish_lib_engine/manager/manager_controller.rb~
136
- - app/controllers/ish_lib_engine/manager/newsitems_controller.rb
137
- - app/controllers/ish_lib_engine/manager/newsitems_controller.rb~
138
- - app/controllers/ish_lib_engine/manager/photos_controller.rb
139
- - app/controllers/ish_lib_engine/manager/photos_controller.rb~
140
- - app/controllers/ish_lib_engine/manager/reports_controller.rb
141
- - app/controllers/ish_lib_engine/manager/reports_controller.rb~
142
- - app/controllers/ish_lib_engine/manager/sites_controller.rb
143
- - app/controllers/ish_lib_engine/manager/sites_controller.rb~
144
- - app/controllers/ish_lib_engine/manager/tags_controller.rb
145
- - app/controllers/ish_lib_engine/manager/tags_controller.rb~
146
- - app/controllers/ish_lib_engine/manager/users_controller.rb
147
- - app/controllers/ish_lib_engine/manager/users_controller.rb~
148
- - app/controllers/ish_lib_engine/manager/welcome_controller.rb
149
- - app/controllers/ish_lib_engine/manager/welcome_controller.rb~
150
128
  - app/helpers/ish_lib_engine/application_helper.rb
151
129
  - app/helpers/ish_lib_engine/articles_helper.rb
152
130
  - app/models/ability.rb
@@ -1,95 +0,0 @@
1
-
2
- class IshLibEngine::Manager::CitiesController < Manager::ManagerController
3
-
4
- before_filter :set_lists, :only => [ :new_newsitem, :create_newsitem ]
5
- before_filter :sett_city, :only => [ :show, :edit ]
6
-
7
- def index
8
- authorize! :index, ManagerCity.new
9
- @cities = City.all
10
- @city = City.new
11
- @photo = Photo.new
12
- end
13
-
14
- def show
15
- authorize! :show, @city
16
- end
17
-
18
- def new
19
- authorize! :new, ManagerCity.new
20
- @city = City.new
21
- @photo = Photo.new
22
- end
23
-
24
- def create
25
- authorize! :create, ManagerCity.new
26
- @city = City.new params[:city].permit( :n_features, :n_newsitems, :x, :y, :is_feature, :cityname,
27
- :name_pt, :name_en, :name_ru, :name )
28
-
29
- if @city.save
30
- flash[:notice] = 'Success'
31
- redirect_to manager_cities_path
32
- else
33
- flash[:error] = 'No Luck'
34
- render :action => :new
35
- end
36
- end
37
-
38
- def edit
39
- authorize! :edit, @city
40
- end
41
-
42
- def update
43
- authorize! :update, ManagerCity.new
44
-
45
- @city = City.find( params[:id] )
46
-
47
- @city.update_attributes params[:city]
48
-
49
- if @city.save
50
- flash[:notice] = 'Success'
51
- redirect_to edit_manager_city_path @city.id
52
- else
53
- flash[:error] = 'No Luck. ' + @city.errors.inspect
54
- @newsitems = @city.newsitems.all.page( params[:newsitems_page] )
55
- @features = @city.features.all.page( params[:features_page] )
56
- @photo = Photo.new
57
- render :action => :edit
58
- end
59
- end
60
-
61
- def change_profile_pic
62
- authorize! :change_profile_pic, ManagerCity.new
63
-
64
- @city = City.find params[:id]
65
-
66
- @photo = Photo.new params[:photo]
67
- @photo.user = @current_user
68
- flag = @photo.save
69
- @city.profile_photo = @photo
70
- flagg = @city.save
71
- if flag && flagg
72
- flash[:notice] = 'Success'
73
- else
74
- flash[:error] = "No Luck. #{@photo.errors.inspect} #{@city.errors.inspect}"
75
- # puts! @photo.errors.inspect
76
- # puts! @city.errors.inspect
77
- end
78
-
79
- redirect_to manager_cities_path
80
- end
81
-
82
- private
83
-
84
- def sett_city
85
- @city = City.find params[:id]
86
- @photo = Photo.new
87
- end
88
-
89
- def set_lists
90
- @list_reports = Report.all.list
91
- @list_galleries = Gallery.all.list
92
- @list_users = [['', nil]] + User.all.order_by( :name => :asc ).map { |u| [u.username, u.username] }
93
- end
94
-
95
- end
@@ -1,95 +0,0 @@
1
-
2
- class Manager::CitiesController < Manager::ManagerController
3
-
4
- before_filter :set_lists, :only => [ :new_newsitem, :create_newsitem ]
5
- before_filter :sett_city, :only => [ :show, :edit ]
6
-
7
- def index
8
- authorize! :index, ManagerCity.new
9
- @cities = City.all
10
- @city = City.new
11
- @photo = Photo.new
12
- end
13
-
14
- def show
15
- authorize! :show, @city
16
- end
17
-
18
- def new
19
- authorize! :new, ManagerCity.new
20
- @city = City.new
21
- @photo = Photo.new
22
- end
23
-
24
- def create
25
- authorize! :create, ManagerCity.new
26
- @city = City.new params[:city].permit( :n_features, :n_newsitems, :x, :y, :is_feature, :cityname,
27
- :name_pt, :name_en, :name_ru, :name )
28
-
29
- if @city.save
30
- flash[:notice] = 'Success'
31
- redirect_to manager_cities_path
32
- else
33
- flash[:error] = 'No Luck'
34
- render :action => :new
35
- end
36
- end
37
-
38
- def edit
39
- authorize! :edit, @city
40
- end
41
-
42
- def update
43
- authorize! :update, ManagerCity.new
44
-
45
- @city = City.find( params[:id] )
46
-
47
- @city.update_attributes params[:city]
48
-
49
- if @city.save
50
- flash[:notice] = 'Success'
51
- redirect_to edit_manager_city_path @city.id
52
- else
53
- flash[:error] = 'No Luck. ' + @city.errors.inspect
54
- @newsitems = @city.newsitems.all.page( params[:newsitems_page] )
55
- @features = @city.features.all.page( params[:features_page] )
56
- @photo = Photo.new
57
- render :action => :edit
58
- end
59
- end
60
-
61
- def change_profile_pic
62
- authorize! :change_profile_pic, ManagerCity.new
63
-
64
- @city = City.find params[:id]
65
-
66
- @photo = Photo.new params[:photo]
67
- @photo.user = @current_user
68
- flag = @photo.save
69
- @city.profile_photo = @photo
70
- flagg = @city.save
71
- if flag && flagg
72
- flash[:notice] = 'Success'
73
- else
74
- flash[:error] = "No Luck. #{@photo.errors.inspect} #{@city.errors.inspect}"
75
- # puts! @photo.errors.inspect
76
- # puts! @city.errors.inspect
77
- end
78
-
79
- redirect_to manager_cities_path
80
- end
81
-
82
- private
83
-
84
- def sett_city
85
- @city = City.find params[:id]
86
- @photo = Photo.new
87
- end
88
-
89
- def set_lists
90
- @list_reports = Report.all.list
91
- @list_galleries = Gallery.all.list
92
- @list_users = [['', nil]] + User.all.order_by( :name => :asc ).map { |u| [u.username, u.username] }
93
- end
94
-
95
- end
@@ -1,122 +0,0 @@
1
-
2
- class IshLibEngine::Manager::FeaturesController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
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?
11
- @feature = Feature.new
12
- end
13
-
14
- def create
15
- authorize! :create, ManagerFeature.new
16
-
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
- if params[:city_id]
21
- @city = City.find params[:city_id]
22
- @city.features << @feature
23
- redirect_path = manager_cities_path
24
- end
25
- if params[:site_id]
26
- @site = Site.find params[:site_id]
27
- @site.features << @feature
28
- redirect_path = manager_sites_path
29
- end
30
- if params[:tag_id]
31
- @tag = Tag.find params[:tag_id]
32
- @tag.features << @feature
33
- redirect_path = manager_tags_path
34
- end
35
-
36
- if (@city && @city.save) || (@site && @site.save) || (@tag && @tag.save)
37
- flash[:notice] = 'Success.'
38
- redirect_to redirect_path
39
- else
40
- flash[:error] = 'No Luck. ' + ( @city || @site || @tag ).errors.inspect
41
- render :action => :new
42
- end
43
- end
44
-
45
- def edit
46
- authorize! :edit, ManagerCity.new
47
-
48
- if params[:city_id]
49
- @city = City.find params[:city_id]
50
- @feature = @city.features.find params[:id]
51
- end
52
-
53
- if params[:site_id]
54
- @site = Site.find params[:site_id]
55
- @feature = @site.features.find params[:id]
56
- end
57
-
58
- if params[:tag_id]
59
- @tag = Tag.find params[:tag_id]
60
- @feature = @tag.features.find params[:id]
61
- end
62
-
63
- if params[:venue_id]
64
- @venue = Tag.find params[:venue_id]
65
- @feature = @venue.features.find params[:id]
66
- end
67
-
68
- end
69
-
70
- def update
71
- unless params[:city_id].blank?
72
- @city = City.find params[:city_id]
73
- authorize! :update, ManagerCity.new
74
- @feature = @city.features.find params[:id]
75
- redirect_path = manager_city_path( @city )
76
- end
77
- unless params[:site_id].blank?
78
- @site = Site.find params[:site_id]
79
- authorize! :update, ManagerSite.new
80
- @feature = @site.features.find params[:id]
81
- redirect_path = manager_site_path( @site )
82
- end
83
- unless params[:tag_id].blank?
84
- @tag = Tag.find params[:tag_id]
85
- authorize! :update, ManagerTag.new
86
- @feature = @tag.features.find params[:id]
87
- redirect_path = manager_tag_path( @tag )
88
- end
89
-
90
- if @feature.update_attributes params[:feature].permit( :name, :subhead, :image_path, :link_path, :partial_name, :weight,
91
- :photo_id, :photo, :report_id, :gallery_id, :video_id )
92
- flash[:notice] = 'Success'
93
- redirect_to redirect_path
94
- else
95
- flash[:error] = 'No Luck. ' + @feature.errors.inspect
96
- puts! @feature.errors, 'Errors updating feature'
97
- render :action => :edit_feature
98
- end
99
- end
100
-
101
- def index
102
- if params[:tag_id]
103
- @resource = Tag.find params[:tag_id]
104
- end
105
-
106
- end
107
-
108
- def destroy
109
- if params[:tag_id]
110
- @resource = Tag.find params[:tag_id]
111
- end
112
- @feature = @resource.features.find params[:id]
113
- if @feature.destroy
114
- flash[:notice] = :'Success.'
115
- else
116
- flash[:error] = :'No luck.'
117
- end
118
- redirect_to request.referrer
119
- end
120
-
121
- end
122
-
@@ -1,122 +0,0 @@
1
-
2
- class Manager::FeaturesController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
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?
11
- @feature = Feature.new
12
- end
13
-
14
- def create
15
- authorize! :create, ManagerFeature.new
16
-
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
- if params[:city_id]
21
- @city = City.find params[:city_id]
22
- @city.features << @feature
23
- redirect_path = manager_cities_path
24
- end
25
- if params[:site_id]
26
- @site = Site.find params[:site_id]
27
- @site.features << @feature
28
- redirect_path = manager_sites_path
29
- end
30
- if params[:tag_id]
31
- @tag = Tag.find params[:tag_id]
32
- @tag.features << @feature
33
- redirect_path = manager_tags_path
34
- end
35
-
36
- if (@city && @city.save) || (@site && @site.save) || (@tag && @tag.save)
37
- flash[:notice] = 'Success.'
38
- redirect_to redirect_path
39
- else
40
- flash[:error] = 'No Luck. ' + ( @city || @site || @tag ).errors.inspect
41
- render :action => :new
42
- end
43
- end
44
-
45
- def edit
46
- authorize! :edit, ManagerCity.new
47
-
48
- if params[:city_id]
49
- @city = City.find params[:city_id]
50
- @feature = @city.features.find params[:id]
51
- end
52
-
53
- if params[:site_id]
54
- @site = Site.find params[:site_id]
55
- @feature = @site.features.find params[:id]
56
- end
57
-
58
- if params[:tag_id]
59
- @tag = Tag.find params[:tag_id]
60
- @feature = @tag.features.find params[:id]
61
- end
62
-
63
- if params[:venue_id]
64
- @venue = Tag.find params[:venue_id]
65
- @feature = @venue.features.find params[:id]
66
- end
67
-
68
- end
69
-
70
- def update
71
- unless params[:city_id].blank?
72
- @city = City.find params[:city_id]
73
- authorize! :update, ManagerCity.new
74
- @feature = @city.features.find params[:id]
75
- redirect_path = manager_city_path( @city )
76
- end
77
- unless params[:site_id].blank?
78
- @site = Site.find params[:site_id]
79
- authorize! :update, ManagerSite.new
80
- @feature = @site.features.find params[:id]
81
- redirect_path = manager_site_path( @site )
82
- end
83
- unless params[:tag_id].blank?
84
- @tag = Tag.find params[:tag_id]
85
- authorize! :update, ManagerTag.new
86
- @feature = @tag.features.find params[:id]
87
- redirect_path = manager_tag_path( @tag )
88
- end
89
-
90
- if @feature.update_attributes params[:feature].permit( :name, :subhead, :image_path, :link_path, :partial_name, :weight,
91
- :photo_id, :photo, :report_id, :gallery_id, :video_id )
92
- flash[:notice] = 'Success'
93
- redirect_to redirect_path
94
- else
95
- flash[:error] = 'No Luck. ' + @feature.errors.inspect
96
- puts! @feature.errors, 'Errors updating feature'
97
- render :action => :edit_feature
98
- end
99
- end
100
-
101
- def index
102
- if params[:tag_id]
103
- @resource = Tag.find params[:tag_id]
104
- end
105
-
106
- end
107
-
108
- def destroy
109
- if params[:tag_id]
110
- @resource = Tag.find params[:tag_id]
111
- end
112
- @feature = @resource.features.find params[:id]
113
- if @feature.destroy
114
- flash[:notice] = :'Success.'
115
- else
116
- flash[:error] = :'No luck.'
117
- end
118
- redirect_to request.referrer
119
- end
120
-
121
- end
122
-
@@ -1,78 +0,0 @@
1
-
2
- class IshLibEngine::Manager::GalleriesController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
6
- def index
7
- redirect_to manager_galleries_thumb_path
8
- end
9
-
10
- def index_title
11
- @galleries = Gallery.unscoped.where( :is_trash => false ).order_by( :created_at => :desc )
12
- end
13
-
14
- def index_thumb
15
- @galleries = Gallery.unscoped.where( :is_trash => false ).order_by( :created_at => :desc ).page( params[:galleries_page] ).per( 10 )
16
- end
17
-
18
- def index_mini
19
- @galleries = Gallery.all
20
- end
21
-
22
- def new
23
- @gallery = Gallery.new
24
- @cities_list = City.list
25
- @tags_list = Tag.list
26
- end
27
-
28
- def create
29
- @gallery = Gallery.new(params[:gallery].permit(:name, :city, :tag, :is_public, :is_done, :is_feature))
30
- @gallery.user = current_user
31
- @gallery.site = @site
32
- authorize! :create, @gallery
33
-
34
- if @gallery.save
35
- # expire_page :controller => 'galleries', :action => 'index', :domainname => @site.domain
36
- # expire_page :controller => 'sites', :action => 'show', :domainname => @site.domain
37
- flash[:notice] = 'Success'
38
- redirect_to manager_galleries_path
39
- else
40
- flash[:error] = 'No Luck. ' + @gallery.errors.inspect
41
- @cities_list = City.list
42
- @tags_list = Tag.list
43
- render :action => 'new'
44
- end
45
- end
46
-
47
- def edit
48
- @gallery = Gallery.unscoped.find params[:id]
49
- end
50
-
51
- def update
52
- @gallery = Gallery.unscoped.find params[:id]
53
- if @gallery.update_attributes( params[:gallery].permit( :username, :name, :galleryname, :subhead, :descr, :lang,
54
- :is_trash, :is_public, :is_done, :is_feature,
55
- :tag_id, :city_id, :venue_id, :site_id, :user_id, :site_id ) )
56
- flash[:notice] = 'Success.'
57
- redirect_to manager_galleries_path
58
- else
59
- flash[:error] = 'No Luck. ' + @gallery.errors
60
- render :action => :edit
61
- end
62
- end
63
-
64
- def show
65
- @gallery = Gallery.unscoped.find params[:id]
66
- @photos = @gallery.photos.unscoped.where({ :is_trash => false })
67
- end
68
-
69
- def destroy
70
- @gallery = Gallery.unscoped.find params[:id]
71
- @gallery.is_trash = true
72
- @gallery.save
73
- flash[:notice] = 'Logically deleted gallery.'
74
- redirect_to manager_galleries_title_path
75
- end
76
-
77
- end
78
-
@@ -1,78 +0,0 @@
1
-
2
- class Manager::GalleriesController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
6
- def index
7
- redirect_to manager_galleries_thumb_path
8
- end
9
-
10
- def index_title
11
- @galleries = Gallery.unscoped.where( :is_trash => false ).order_by( :created_at => :desc )
12
- end
13
-
14
- def index_thumb
15
- @galleries = Gallery.unscoped.where( :is_trash => false ).order_by( :created_at => :desc ).page( params[:galleries_page] ).per( 10 )
16
- end
17
-
18
- def index_mini
19
- @galleries = Gallery.all
20
- end
21
-
22
- def new
23
- @gallery = Gallery.new
24
- @cities_list = City.list
25
- @tags_list = Tag.list
26
- end
27
-
28
- def create
29
- @gallery = Gallery.new(params[:gallery].permit(:name, :city, :tag, :is_public, :is_done, :is_feature))
30
- @gallery.user = current_user
31
- @gallery.site = @site
32
- authorize! :create, @gallery
33
-
34
- if @gallery.save
35
- # expire_page :controller => 'galleries', :action => 'index', :domainname => @site.domain
36
- # expire_page :controller => 'sites', :action => 'show', :domainname => @site.domain
37
- flash[:notice] = 'Success'
38
- redirect_to manager_galleries_path
39
- else
40
- flash[:error] = 'No Luck. ' + @gallery.errors.inspect
41
- @cities_list = City.list
42
- @tags_list = Tag.list
43
- render :action => 'new'
44
- end
45
- end
46
-
47
- def edit
48
- @gallery = Gallery.unscoped.find params[:id]
49
- end
50
-
51
- def update
52
- @gallery = Gallery.unscoped.find params[:id]
53
- if @gallery.update_attributes( params[:gallery].permit( :username, :name, :galleryname, :subhead, :descr, :lang,
54
- :is_trash, :is_public, :is_done, :is_feature,
55
- :tag_id, :city_id, :venue_id, :site_id, :user_id, :site_id ) )
56
- flash[:notice] = 'Success.'
57
- redirect_to manager_galleries_path
58
- else
59
- flash[:error] = 'No Luck. ' + @gallery.errors
60
- render :action => :edit
61
- end
62
- end
63
-
64
- def show
65
- @gallery = Gallery.unscoped.find params[:id]
66
- @photos = @gallery.photos.unscoped.where({ :is_trash => false })
67
- end
68
-
69
- def destroy
70
- @gallery = Gallery.unscoped.find params[:id]
71
- @gallery.is_trash = true
72
- @gallery.save
73
- flash[:notice] = 'Logically deleted gallery.'
74
- redirect_to manager_galleries_title_path
75
- end
76
-
77
- end
78
-
@@ -1,31 +0,0 @@
1
-
2
- class IshLibEngine::Manager::ManagerController < ApplicationController
3
-
4
- layout 'manager'
5
-
6
- prepend_before_filter :authenticate_user!
7
- before_filter :validate_manager
8
-
9
- private
10
-
11
- def validate_manager
12
- if 'piousbox' == current_user['username'] || 'manager' == current_user['username']
13
- return true
14
- else
15
- redirect_to root_path
16
- end
17
- end
18
-
19
- def set_lists
20
- @tags_list = Tag.all.list
21
- @sites_list = Site.all.list
22
- @cities_list = City.all.list
23
- @venues_list = Venue.all.list
24
- @users_list = User.all.list
25
-
26
- @reports_list = Report.all.list
27
- @galleries_list = Gallery.all.list
28
- @videos_list = Video.all.list
29
- end
30
-
31
- end
@@ -1,31 +0,0 @@
1
-
2
- class Manager::ManagerController < ApplicationController
3
-
4
- layout 'manager'
5
-
6
- prepend_before_filter :authenticate_user!
7
- before_filter :validate_manager
8
-
9
- private
10
-
11
- def validate_manager
12
- if 'piousbox' == current_user['username'] || 'manager' == current_user['username']
13
- return true
14
- else
15
- redirect_to root_path
16
- end
17
- end
18
-
19
- def set_lists
20
- @tags_list = Tag.all.list
21
- @sites_list = Site.all.list
22
- @cities_list = City.all.list
23
- @venues_list = Venue.all.list
24
- @users_list = User.all.list
25
-
26
- @reports_list = Report.all.list
27
- @galleries_list = Gallery.all.list
28
- @videos_list = Video.all.list
29
- end
30
-
31
- end
@@ -1,47 +0,0 @@
1
-
2
- class IshLibEngine::Manager::NewsitemsController < Manager::ManagerController
3
-
4
- def new
5
- authorize! :new, ManagerNewsitem.new
6
-
7
- @newsitem = Newsitem.new
8
- @city = City.find params[:city_id]
9
-
10
- end
11
-
12
- def create
13
- authorize! :create, ManagerNewsitem.new
14
-
15
- n = Newsitem.new params[:newsitem]
16
- n.report = Report.find params[:newsitem][:report_id] unless params[:newsitem][:report_id].blank?
17
- n.gallery = Gallery.find params[:newsitem][:gallery_id] unless params[:newsitem][:gallery_id].blank?
18
- n.photo = Photo.find params[:newsitem][:photo_id] unless params[:newsitem][:photo_id].blank?
19
- n.descr = params[:newsitem][:descr]
20
-
21
- @city = City.find params[:city_id]
22
- @city.newsitems << n
23
-
24
- if @city.save
25
- flash[:notice] = 'Success'
26
- redirect_to edit_manager_city_path( @city.id )
27
- else
28
- flash[:error] = 'No Luck. ' + @city.errors.inspect
29
- render :action => :new_newsitem
30
-
31
- end
32
- end
33
-
34
- def show
35
- end
36
-
37
- def index
38
- end
39
-
40
- def destroy
41
- end
42
-
43
- def update
44
- end
45
-
46
- end
47
-
@@ -1,47 +0,0 @@
1
-
2
- class Manager::NewsitemsController < Manager::ManagerController
3
-
4
- def new
5
- authorize! :new, ManagerNewsitem.new
6
-
7
- @newsitem = Newsitem.new
8
- @city = City.find params[:city_id]
9
-
10
- end
11
-
12
- def create
13
- authorize! :create, ManagerNewsitem.new
14
-
15
- n = Newsitem.new params[:newsitem]
16
- n.report = Report.find params[:newsitem][:report_id] unless params[:newsitem][:report_id].blank?
17
- n.gallery = Gallery.find params[:newsitem][:gallery_id] unless params[:newsitem][:gallery_id].blank?
18
- n.photo = Photo.find params[:newsitem][:photo_id] unless params[:newsitem][:photo_id].blank?
19
- n.descr = params[:newsitem][:descr]
20
-
21
- @city = City.find params[:city_id]
22
- @city.newsitems << n
23
-
24
- if @city.save
25
- flash[:notice] = 'Success'
26
- redirect_to edit_manager_city_path( @city.id )
27
- else
28
- flash[:error] = 'No Luck. ' + @city.errors.inspect
29
- render :action => :new_newsitem
30
-
31
- end
32
- end
33
-
34
- def show
35
- end
36
-
37
- def index
38
- end
39
-
40
- def destroy
41
- end
42
-
43
- def update
44
- end
45
-
46
- end
47
-
@@ -1,20 +0,0 @@
1
-
2
- class IshLibEngine::Manager::PhotosController < Manager::ManagerController
3
-
4
- def without_gallery
5
- @photos = Photo.unscoped.where( :gallery => nil, :is_trash => false )
6
- end
7
-
8
- def destroy
9
- @photo = Photo.unscoped.find params[:id]
10
- @photo.is_trash = true
11
- @photo.save
12
- redirect_to request.referrer
13
- end
14
-
15
- def show
16
- @photo = Photo.unscoped.find params[:id]
17
- end
18
-
19
- end
20
-
@@ -1,20 +0,0 @@
1
-
2
- class Manager::PhotosController < Manager::ManagerController
3
-
4
- def without_gallery
5
- @photos = Photo.unscoped.where( :gallery => nil, :is_trash => false )
6
- end
7
-
8
- def destroy
9
- @photo = Photo.unscoped.find params[:id]
10
- @photo.is_trash = true
11
- @photo.save
12
- redirect_to request.referrer
13
- end
14
-
15
- def show
16
- @photo = Photo.unscoped.find params[:id]
17
- end
18
-
19
- end
20
-
@@ -1,62 +0,0 @@
1
-
2
- class IshLibEngine::Manager::ReportsController < Manager::ManagerController
3
-
4
- before_action :authenticate_user!
5
- before_filter :set_lists
6
-
7
- def index
8
- @reports = Report.unscoped.where( :is_trash => false ).page( params[:reports_page] ).per( Report::PER_PAGE )
9
- if false === params[:site]
10
- @reports = @reports.where( :site_id => nil )
11
- end
12
- if params[:site_id]
13
- @site = Site.find params[:site_id]
14
- @reports = @reports.where( :site_id => params[:site_id] )
15
- end
16
- end
17
-
18
- def show
19
- @report = Report.unscoped.where({ :is_trash => false }).find params[:id]
20
- end
21
-
22
- def edit
23
- @report = Report.unscoped.find params[:id]
24
- end
25
-
26
- def destroy
27
- @report = Report.unscoped.find params[:id]
28
- @report.is_trash = true
29
- @report.save
30
- redirect_to request.referrer
31
- end
32
-
33
- def update
34
- @report = Report.unscoped.find params[:id]
35
- authorize! :update, @report
36
-
37
- # photo
38
- photo = Photo.new
39
- photo.photo = params[:report][:photo]
40
- photo.report_id = @report.id
41
- photo.user = @report.user
42
- photo.is_public = @report.is_public
43
- photo.is_trash = false
44
- photo.save
45
- @report.photo = photo
46
- params[:report][:photo] = nil
47
-
48
- respond_to do |format|
49
- if @report.update_attributes(params[:report].permit( :name, :subhead, :descr, :venue, :city, :x, :y, :tag, :is_public, :photo, :site, :site_id ))
50
- format.html do
51
- redirect_to manager_report_path(@report), :notice => 'Report was successfully updated.'
52
- end
53
- format.json { head :ok }
54
- else
55
- format.html { render :action => "edit" }
56
- format.json { render :json => @report.errors, :status => :unprocessable_entity }
57
- end
58
- end
59
- end
60
-
61
- end
62
-
@@ -1,62 +0,0 @@
1
-
2
- class Manager::ReportsController < Manager::ManagerController
3
-
4
- before_action :authenticate_user!
5
- before_filter :set_lists
6
-
7
- def index
8
- @reports = Report.unscoped.where( :is_trash => false ).page( params[:reports_page] ).per( Report::PER_PAGE )
9
- if false === params[:site]
10
- @reports = @reports.where( :site_id => nil )
11
- end
12
- if params[:site_id]
13
- @site = Site.find params[:site_id]
14
- @reports = @reports.where( :site_id => params[:site_id] )
15
- end
16
- end
17
-
18
- def show
19
- @report = Report.unscoped.where({ :is_trash => false }).find params[:id]
20
- end
21
-
22
- def edit
23
- @report = Report.unscoped.find params[:id]
24
- end
25
-
26
- def destroy
27
- @report = Report.unscoped.find params[:id]
28
- @report.is_trash = true
29
- @report.save
30
- redirect_to request.referrer
31
- end
32
-
33
- def update
34
- @report = Report.unscoped.find params[:id]
35
- authorize! :update, @report
36
-
37
- # photo
38
- photo = Photo.new
39
- photo.photo = params[:report][:photo]
40
- photo.report_id = @report.id
41
- photo.user = @report.user
42
- photo.is_public = @report.is_public
43
- photo.is_trash = false
44
- photo.save
45
- @report.photo = photo
46
- params[:report][:photo] = nil
47
-
48
- respond_to do |format|
49
- if @report.update_attributes(params[:report].permit( :name, :subhead, :descr, :venue, :city, :x, :y, :tag, :is_public, :photo, :site, :site_id ))
50
- format.html do
51
- redirect_to manager_report_path(@report), :notice => 'Report was successfully updated.'
52
- end
53
- format.json { head :ok }
54
- else
55
- format.html { render :action => "edit" }
56
- format.json { render :json => @report.errors, :status => :unprocessable_entity }
57
- end
58
- end
59
- end
60
-
61
- end
62
-
@@ -1,72 +0,0 @@
1
-
2
- class IshLibEngine::Manager::SitesController < Manager::ManagerController
3
-
4
- PERMITTED_ATTRIBUTES = [ :domain, :lang, :title, :subhead, :homepage_layout, :layout,
5
- :n_features, :n_newsitems, :is_trash, :is_ads_enabled, :is_private,
6
- :home_redirect_path, :is_video_enabled, :is_resume_enabled, :is_primary
7
- ]
8
-
9
-
10
- def index
11
- @sites = Site.all.order_by( :domainname => :desc, :lang => :desc )
12
- end
13
-
14
- def trash
15
- @sites = Site.unscoped.where( :is_trash => true ).order_by( :domainname => :desc, :lang => :desc )
16
- render :action => :index
17
- end
18
-
19
- def show
20
- @site = Site.find params[:id]
21
- @galleries = @site.galleries.unscoped.where({ :is_trash => false }).page( params[:galleries_page] ).per( 10 )
22
- @reports = @site.reports.unscoped.where({ :is_trash => false }).page( params[:reports_page] ).per( 10 )
23
- @videos = @site.videos.page( params[:videos_page] ).per( 5 )
24
- @tags = @site.tags.page( params[:tags_page] ).per( 100 )
25
- @features = @site.features.page( params[:features_page] ).per( 9 )
26
- @newsitems = @site.newsitems.page( params[:newsitems_page] ).per( 10 )
27
- end
28
-
29
- def edit
30
- @site = Site.find params[:id]
31
- authorize! :update, @site
32
- end
33
-
34
- def new
35
- authorize! :new, Site.new
36
- @site = Site.new
37
- end
38
-
39
- def create
40
- authorize! :create, Site.new
41
- @site = Site.new params[:site].permit( PERMITTED_ATTRIBUTES )
42
- if @site.save
43
- flash[:notice] = 'Success'
44
- else
45
- flash[:error] = 'No Luck. ' + @site.errors.inspect
46
- end
47
- redirect_to manager_sites_path
48
- end
49
-
50
- def update
51
- @site = Site.find params[:id]
52
- authorize! :update, @site
53
-
54
- if @site.update_attributes params[:site].permit( PERMITTED_ATTRIBUTES )
55
- flash[:notice] = 'Success'
56
- else
57
- flash[:error] = 'No Luck'
58
- end
59
- redirect_to manager_sites_path
60
- end
61
-
62
- def newsitem_delete
63
- @site = Site.find params[:site_id]
64
- authorize! :update, @site
65
- n = @site.newsitems.find( params[:newsitem_id] )
66
- n.delete
67
- @site.save
68
- flash[:notice] = 'Probably successfully deleted a newsitem.'
69
- redirect_to manager_site_path( @site.id )
70
- end
71
-
72
- end
@@ -1,72 +0,0 @@
1
-
2
- class Manager::SitesController < Manager::ManagerController
3
-
4
- PERMITTED_ATTRIBUTES = [ :domain, :lang, :title, :subhead, :homepage_layout, :layout,
5
- :n_features, :n_newsitems, :is_trash, :is_ads_enabled, :is_private,
6
- :home_redirect_path, :is_video_enabled, :is_resume_enabled, :is_primary
7
- ]
8
-
9
-
10
- def index
11
- @sites = Site.all.order_by( :domainname => :desc, :lang => :desc )
12
- end
13
-
14
- def trash
15
- @sites = Site.unscoped.where( :is_trash => true ).order_by( :domainname => :desc, :lang => :desc )
16
- render :action => :index
17
- end
18
-
19
- def show
20
- @site = Site.find params[:id]
21
- @galleries = @site.galleries.unscoped.where({ :is_trash => false }).page( params[:galleries_page] ).per( 10 )
22
- @reports = @site.reports.unscoped.where({ :is_trash => false }).page( params[:reports_page] ).per( 10 )
23
- @videos = @site.videos.page( params[:videos_page] ).per( 5 )
24
- @tags = @site.tags.page( params[:tags_page] ).per( 100 )
25
- @features = @site.features.page( params[:features_page] ).per( 9 )
26
- @newsitems = @site.newsitems.page( params[:newsitems_page] ).per( 10 )
27
- end
28
-
29
- def edit
30
- @site = Site.find params[:id]
31
- authorize! :update, @site
32
- end
33
-
34
- def new
35
- authorize! :new, Site.new
36
- @site = Site.new
37
- end
38
-
39
- def create
40
- authorize! :create, Site.new
41
- @site = Site.new params[:site].permit( PERMITTED_ATTRIBUTES )
42
- if @site.save
43
- flash[:notice] = 'Success'
44
- else
45
- flash[:error] = 'No Luck. ' + @site.errors.inspect
46
- end
47
- redirect_to manager_sites_path
48
- end
49
-
50
- def update
51
- @site = Site.find params[:id]
52
- authorize! :update, @site
53
-
54
- if @site.update_attributes params[:site].permit( PERMITTED_ATTRIBUTES )
55
- flash[:notice] = 'Success'
56
- else
57
- flash[:error] = 'No Luck'
58
- end
59
- redirect_to manager_sites_path
60
- end
61
-
62
- def newsitem_delete
63
- @site = Site.find params[:site_id]
64
- authorize! :update, @site
65
- n = @site.newsitems.find( params[:newsitem_id] )
66
- n.delete
67
- @site.save
68
- flash[:notice] = 'Probably successfully deleted a newsitem.'
69
- redirect_to manager_site_path( @site.id )
70
- end
71
-
72
- end
@@ -1,54 +0,0 @@
1
-
2
- class IshLibEngine::Manager::TagsController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
6
- def index
7
- @tags = Tag.unscoped
8
- authorize! :index, Tag.new
9
- end
10
-
11
- def show
12
- @tag = Tag.unscoped.find params[:id]
13
- authorize! :show, @tag
14
- end
15
-
16
- def new
17
- @tag = Tag.new
18
- authorize! :new, @tag
19
- end
20
-
21
- def create
22
- @tag = Tag.create params[:tag].permit( :name, :name_seo, :descr, :is_public, :is_feature, :is_trash,
23
- :weight, :parent_tag_id, :site_id )
24
- authorize! :create, @tag
25
- if @tag.save
26
- flash[:notice] = 'Success.'
27
- redirect_to manager_tags_path
28
- else
29
- puts! @tag.errors, "error creating tag."
30
- flash[:error] = "No luck. #{@tag.errors.messages}"
31
- render :action => :new
32
- end
33
- end
34
-
35
- def edit
36
- @tag = Tag.unscoped.find params[:id]
37
- authorize! :edit, @tag
38
- end
39
-
40
- def update
41
- @tag = Tag.unscoped.find params[:id]
42
- authorize! :update, @tag
43
- if @tag.update_attributes params[:tag].permit( :name, :name_seo, :descr,
44
- :is_public, :is_trash, :is_feature, :weight,
45
- :site_id, :parent_tag_id )
46
- flash[:notice] = 'Success.'
47
- redirect_to manager_tags_path
48
- else
49
- flash[:error] = 'No luck.'
50
- render :action => :new
51
- end
52
- end
53
-
54
- end
@@ -1,54 +0,0 @@
1
-
2
- class Manager::TagsController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
6
- def index
7
- @tags = Tag.unscoped
8
- authorize! :index, Tag.new
9
- end
10
-
11
- def show
12
- @tag = Tag.unscoped.find params[:id]
13
- authorize! :show, @tag
14
- end
15
-
16
- def new
17
- @tag = Tag.new
18
- authorize! :new, @tag
19
- end
20
-
21
- def create
22
- @tag = Tag.create params[:tag].permit( :name, :name_seo, :descr, :is_public, :is_feature, :is_trash,
23
- :weight, :parent_tag_id, :site_id )
24
- authorize! :create, @tag
25
- if @tag.save
26
- flash[:notice] = 'Success.'
27
- redirect_to manager_tags_path
28
- else
29
- puts! @tag.errors, "error creating tag."
30
- flash[:error] = "No luck. #{@tag.errors.messages}"
31
- render :action => :new
32
- end
33
- end
34
-
35
- def edit
36
- @tag = Tag.unscoped.find params[:id]
37
- authorize! :edit, @tag
38
- end
39
-
40
- def update
41
- @tag = Tag.unscoped.find params[:id]
42
- authorize! :update, @tag
43
- if @tag.update_attributes params[:tag].permit( :name, :name_seo, :descr,
44
- :is_public, :is_trash, :is_feature, :weight,
45
- :site_id, :parent_tag_id )
46
- flash[:notice] = 'Success.'
47
- redirect_to manager_tags_path
48
- else
49
- flash[:error] = 'No luck.'
50
- render :action => :new
51
- end
52
- end
53
-
54
- end
@@ -1,13 +0,0 @@
1
-
2
- class IshLibEngine::Manager::UsersController < Manager::ManagerController
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
-
@@ -1,13 +0,0 @@
1
-
2
- class Manager::UsersController < Manager::ManagerController
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
-
@@ -1,8 +0,0 @@
1
-
2
- class IshLibEngine::Manager::WelcomeController < Manager::ManagerController
3
-
4
- def home
5
- ;
6
- end
7
-
8
- end
@@ -1,9 +0,0 @@
1
-
2
-
3
- class Manager::WelcomeController < Manager::ManagerController
4
-
5
- def home
6
- ;
7
- end
8
-
9
- end