community_engine 3.0.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +4 -1
  3. data/.travis.yml +5 -2
  4. data/CHANGELOG.markdown +270 -0
  5. data/Gemfile +3 -0
  6. data/README.markdown +20 -21
  7. data/Rakefile +8 -6
  8. data/TODO.markdown +3 -0
  9. data/UPGRADING.markdown +46 -36
  10. data/app/assets/javascripts/active_admin.js.coffee +19 -0
  11. data/app/assets/javascripts/ckeditor/configs/ads.js.coffee +175 -0
  12. data/app/assets/javascripts/ckeditor/configs/comments.js.coffee +2 -0
  13. data/app/assets/javascripts/ckeditor/configs/posts.js.coffee +248 -0
  14. data/app/assets/javascripts/ckeditor/rte/rte.ads.js.coffee +7 -0
  15. data/app/assets/javascripts/ckeditor/rte/rte.comments.js.coffee +8 -0
  16. data/app/assets/javascripts/ckeditor/rte/rte.js.coffee +20 -0
  17. data/app/assets/javascripts/ckeditor/rte/rte.posts.js.coffee +14 -0
  18. data/app/assets/javascripts/community_engine.js +114 -123
  19. data/{vendor → app}/assets/javascripts/jcrop/jquery.Jcrop.js +0 -0
  20. data/{vendor → app}/assets/javascripts/jcrop/jquery.color.js +0 -0
  21. data/{vendor → app}/assets/javascripts/tag-it/tag-it.js +0 -0
  22. data/app/assets/stylesheets/active_admin.css.scss +27 -0
  23. data/{vendor → app}/assets/stylesheets/jcrop/Jcrop.gif +0 -0
  24. data/{vendor → app}/assets/stylesheets/jcrop/jquery.Jcrop.min.css +0 -0
  25. data/{vendor → app}/assets/stylesheets/tag-it/tag-it.css +0 -0
  26. data/{vendor → app}/assets/stylesheets/tag-it/tagit.ui-zendesk.css +0 -0
  27. data/app/controllers/activities_controller.rb +4 -4
  28. data/app/controllers/albums_controller.rb +13 -18
  29. data/app/controllers/authorizations_controller.rb +1 -1
  30. data/app/controllers/base_controller.rb +9 -32
  31. data/app/controllers/categories_controller.rb +1 -78
  32. data/app/controllers/clippings_controller.rb +3 -7
  33. data/app/controllers/comments_controller.rb +4 -24
  34. data/app/controllers/events_controller.rb +3 -12
  35. data/app/controllers/favorites_controller.rb +2 -2
  36. data/app/controllers/forums_controller.rb +5 -9
  37. data/app/controllers/invitations_controller.rb +1 -1
  38. data/app/controllers/messages_controller.rb +4 -8
  39. data/app/controllers/moderators_controller.rb +1 -1
  40. data/app/controllers/monitorships_controller.rb +1 -1
  41. data/app/controllers/pages_controller.rb +0 -62
  42. data/app/controllers/password_resets_controller.rb +2 -2
  43. data/app/controllers/photo_manager_controller.rb +3 -3
  44. data/app/controllers/photos_controller.rb +43 -14
  45. data/app/controllers/posts_controller.rb +7 -14
  46. data/app/controllers/rsvps_controller.rb +3 -3
  47. data/app/controllers/sb_posts_controller.rb +20 -20
  48. data/app/controllers/sessions_controller.rb +1 -1
  49. data/app/controllers/tags_controller.rb +4 -52
  50. data/app/controllers/topics_controller.rb +15 -10
  51. data/app/controllers/users_controller.rb +9 -16
  52. data/app/controllers/votes_controller.rb +2 -2
  53. data/app/helpers/base_helper.rb +4 -14
  54. data/app/models/acts_as_taggable_on/tag.rb +9 -41
  55. data/app/models/clipping.rb +1 -1
  56. data/app/models/forum.rb +2 -2
  57. data/app/models/photo.rb +1 -1
  58. data/app/models/post.rb +1 -1
  59. data/app/models/sb_post.rb +19 -15
  60. data/app/models/topic.rb +10 -10
  61. data/app/models/user.rb +1 -1
  62. data/app/policies/active_admin/page_policy.rb +11 -0
  63. data/app/policies/application_policy.rb +59 -0
  64. data/app/policies/post_policy.rb +13 -0
  65. data/app/policies/sb_post_policy.rb +15 -0
  66. data/app/policies/topic_policy.rb +23 -0
  67. data/app/views/ckeditor/pictures/index.html.haml +15 -0
  68. data/app/views/ckeditor/shared/_asset.html.haml +9 -0
  69. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +14 -0
  70. data/app/views/comments/approve.js.haml +1 -1
  71. data/app/views/comments/create.js.erb +1 -1
  72. data/app/views/comments/edit.js.erb +2 -1
  73. data/app/views/events/_subscribe.html.haml +1 -1
  74. data/app/views/forums/show.html.haml +8 -4
  75. data/app/views/posts/show.html.haml +4 -0
  76. data/app/views/sb_posts/_edit_script.js.erb +2 -3
  77. data/app/views/sb_posts/_reply_script.js.erb +2 -4
  78. data/app/views/sb_posts/_sb_post.html.haml +7 -6
  79. data/app/views/sb_posts/create.js.erb +4 -4
  80. data/app/views/sb_posts/edit.js.erb +2 -1
  81. data/app/views/sessions/_menu_item.html.haml +4 -4
  82. data/app/views/shared/_end_javascript.html.haml +1 -2
  83. data/app/views/shared/_login_sidebar.html.haml +2 -2
  84. data/app/views/tags/show.html.haml +3 -3
  85. data/app/views/topics/show.html.haml +1 -1
  86. data/app/views/users/_profile_user_info_sidebar.html.haml +2 -2
  87. data/app/views/users/destroy.js.erb +3 -0
  88. data/app/views/users/new.html.haml +1 -1
  89. data/app/views/users/show.html.haml +1 -1
  90. data/app/views/users/signup_completed.html.haml +1 -1
  91. data/community_engine.gemspec +14 -11
  92. data/config/initializers/active_admin.rb +239 -0
  93. data/config/initializers/ckeditor.rb +8 -0
  94. data/config/initializers/ransack_bootstrap_fix.rb +25 -0
  95. data/config/locales/de-DE.yml +1 -0
  96. data/config/locales/en.yml +3 -0
  97. data/config/routes.rb +14 -19
  98. data/config/spring.rb +1 -0
  99. data/db/migrate/083_create_active_admin_comments.rb +19 -0
  100. data/lib/community_engine.rb +7 -3
  101. data/lib/community_engine/admin/ads.rb +3 -0
  102. data/lib/community_engine/admin/categories.rb +20 -0
  103. data/lib/community_engine/admin/comments.rb +4 -0
  104. data/lib/community_engine/admin/dashboard.rb +38 -0
  105. data/lib/community_engine/admin/events.rb +3 -0
  106. data/lib/community_engine/admin/forums.rb +3 -0
  107. data/lib/community_engine/admin/homepage_features.rb +25 -0
  108. data/lib/community_engine/admin/metro_areas.rb +4 -0
  109. data/lib/community_engine/admin/pages.rb +26 -0
  110. data/lib/community_engine/admin/posts.rb +92 -0
  111. data/lib/community_engine/admin/tags.rb +21 -0
  112. data/lib/community_engine/admin/users.rb +54 -0
  113. data/lib/community_engine/authenticated_system.rb +5 -20
  114. data/lib/community_engine/engine.rb +5 -0
  115. data/lib/community_engine/version.rb +1 -1
  116. data/lib/resource_feeder/atom.rb +2 -0
  117. data/lib/resource_feeder/rss.rb +2 -0
  118. data/lib/white_list.rb +6 -11
  119. data/test/fixtures/events.yml +10 -0
  120. data/test/fixtures/tags.yml +6 -5
  121. data/test/functional/activities_controller_test.rb +19 -19
  122. data/test/functional/admin/posts_controller_test.rb +16 -0
  123. data/test/functional/admin_controller_test.rb +82 -82
  124. data/test/functional/categories_controller_test.rb +0 -39
  125. data/test/functional/comments_controller_test.rb +14 -7
  126. data/test/functional/favorites_controller_test.rb +15 -16
  127. data/test/functional/pages_controller_test.rb +0 -71
  128. data/test/functional/posts_controller_test.rb +21 -2
  129. data/test/functional/sb_posts_controller_test.rb +3 -3
  130. data/test/functional/sessions_controller_test.rb +2 -2
  131. data/test/functional/tags_controller_test.rb +9 -20
  132. data/test/functional/users_controller_test.rb +0 -8
  133. data/test/functional/votes_controller_test.rb +1 -1
  134. data/test/testapp/config/spring.rb +1 -0
  135. data/test/testapp/db/schema.rb +16 -1
  136. data/test/unit/event_test.rb +1 -1
  137. metadata +204 -170
  138. data/CHANGELOG +0 -144
  139. data/app/controllers/admin_controller.rb +0 -80
  140. data/app/controllers/ads_controller.rb +0 -90
  141. data/app/controllers/homepage_features_controller.rb +0 -74
  142. data/app/controllers/metro_areas_controller.rb +0 -74
  143. data/app/controllers/statistics_controller.rb +0 -35
  144. data/app/views/admin/comments.html.haml +0 -53
  145. data/app/views/admin/events.html.haml +0 -26
  146. data/app/views/admin/messages.html.haml +0 -3
  147. data/app/views/admin/update.js.erb +0 -1
  148. data/app/views/admin/users.html.haml +0 -57
  149. data/app/views/ads/_form.html.haml +0 -21
  150. data/app/views/ads/edit.html.haml +0 -7
  151. data/app/views/ads/index.html.haml +0 -29
  152. data/app/views/ads/new.html.haml +0 -6
  153. data/app/views/ads/show.html.haml +0 -19
  154. data/app/views/categories/_form.html.haml +0 -8
  155. data/app/views/categories/edit.html.haml +0 -4
  156. data/app/views/categories/index.html.haml +0 -20
  157. data/app/views/categories/new.html.haml +0 -4
  158. data/app/views/homepage_features/_form.html.haml +0 -6
  159. data/app/views/homepage_features/edit.html.haml +0 -6
  160. data/app/views/homepage_features/index.html.haml +0 -24
  161. data/app/views/homepage_features/new.html.haml +0 -2
  162. data/app/views/homepage_features/show.html.haml +0 -27
  163. data/app/views/metro_areas/_form.html.haml +0 -6
  164. data/app/views/metro_areas/edit.html.haml +0 -8
  165. data/app/views/metro_areas/index.html.haml +0 -21
  166. data/app/views/metro_areas/new.html.haml +0 -6
  167. data/app/views/metro_areas/show.html.haml +0 -14
  168. data/app/views/pages/_form.html.haml +0 -18
  169. data/app/views/pages/edit.html.haml +0 -4
  170. data/app/views/pages/index.html.haml +0 -34
  171. data/app/views/pages/new.html.haml +0 -7
  172. data/app/views/shared/_admin_nav.html.haml +0 -17
  173. data/app/views/shared/_load_tinymce.js.erb +0 -15
  174. data/app/views/statistics/activities.xml.builder +0 -33
  175. data/app/views/statistics/index.html.haml +0 -48
  176. data/app/views/tags/edit.html.haml +0 -12
  177. data/app/views/tags/manage.html.haml +0 -30
  178. data/app/views/users/update.js.erb +0 -1
  179. data/test/functional/ads_controller_test.rb +0 -51
  180. data/test/functional/homepage_features_controller_test.rb +0 -69
  181. data/test/functional/metro_areas_controller_test.rb +0 -63
  182. data/test/functional/statistics_controller_test.rb +0 -18
  183. data/test/unit/acts_as_taggable_on/tag_test.rb +0 -22
  184. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/README +0 -3
  185. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/Rakefile +0 -22
  186. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/generators/publishing/publishing_generator.rb +0 -34
  187. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/generators/publishing/templates/migration.rb +0 -13
  188. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/install.rb +0 -3
  189. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/test/acts_as_publishable_test.rb +0 -8
  190. data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/uninstall.rb +0 -1
  191. data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/README +0 -4
  192. data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/Rakefile +0 -22
  193. data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/test/atom_feed_test.rb +0 -85
  194. data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/test/rss_feed_test.rb +0 -61
  195. data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/test/test_helper.rb +0 -60
  196. data/vendor/converted2.3plugins_to_lib_leftovers/white_list/README +0 -35
  197. data/vendor/converted2.3plugins_to_lib_leftovers/white_list/Rakefile +0 -22
  198. data/vendor/converted2.3plugins_to_lib_leftovers/white_list/test/white_list_test.rb +0 -120
data/CHANGELOG DELETED
@@ -1,144 +0,0 @@
1
- = TODO
2
- * datepicker for events
3
-
4
- =3.0.0 -- Trevor Bullock 02 Dec 2014
5
- * Upgraded to Bootstrap 3
6
- * Upgraded to Font Awesome 4
7
- * Upgraded to Configatron 4
8
- * Various bug fixes
9
-
10
- =3.0.0.pre3 -- BB Nov 2013
11
- * Merged in the jquery-bootstrap branch
12
- * Removed old prototype.js code
13
-
14
- =3.0.0.pre2 -- Polar Humenn 20 Sep 2013
15
- * Upgraded to tinyMCE 4.0.2 ; made fix to mce_options to make it work.
16
- * Removed curblyadvimage from tinymce plugins (not working)
17
- * Made fix for Users params when nothing is modified.
18
-
19
- =3.0.0.pre1 -- Polar Humenn 15 Aug 2013
20
- * Moved forms and links to unobtrusive javascript. Still using Prototype.
21
- * Addressed almost all 4.0/4.1 deprecation issues
22
- * Migrated to ActiveRecord Query syntax.
23
- * Replaced :method => :put with :method => :patch
24
- * Removed attr_accessible and attr_protected in favor of StrongParameters
25
- * Replaced some 2.3 style plugins with bona fide gems, removed, or moved to lib
26
- activity_tracker ---> lib
27
- acts_as_list ---> gem acts_as_list
28
- acts_as_commentable ---> gem acts_as_commentable, requires db:migrate
29
- acts_as_publishable ---> lib
30
- auto_complete ---> lib
31
- bborn-acts-as-taggable-on ---> gem acts_as_taggable-on
32
- enumerations_mixin ---> gem power_num
33
- prototype_legacy_helper ---> lib (about to be removed)
34
- resource_feeder ---> lib
35
- responds_to_parent ---> removed
36
- white_list ---> lib
37
- * Replaced or Upgraded gems
38
- gem ransak replaces gem meta_search
39
- gem friendly_id upgrade requires a db:migrate and syntactical changes
40
- * Added gems as per directions supporting caching in Rails 4
41
- gem actionpack-action_caching
42
- gem actionpack-page_caching
43
- gem rails-observers
44
-
45
- =2.3.1
46
- * Remove automatic loading of omniauth middleware, in favor of letting users load it themselves as specified in the README (this was causing bugs with duplicate inits of omniauth-facebook middleware)
47
- * Add spam comment moderation (comments identified as spam as held in 'pending status')
48
-
49
-
50
- =2.3.0
51
- * Upgrade omniauth to 1.1
52
-
53
-
54
- =2.0.0.beta4
55
- * Replace white_list plugin with Sanitize gem (white_list.rb initizlizer format has changed)
56
- * Upgrade to Rails 3.2
57
- * Use act_as_taggable_on
58
- * fix photo cropping
59
- * remove theme controller (no more theming functionality)
60
-
61
- =2.0.0.pre
62
- * Rails 3.1.0.beta1 compatibility
63
-
64
- =1.9.9
65
-
66
- * Rails 3.1 compatibility
67
- * Ruby 1.9.2 compatibility
68
- * Use Paperclip instead of attachment_fu
69
- * Add Omniauth
70
- * Remove lots of old, unused featured (contests, skills, offerings, etc.)
71
-
72
- =1.2.1
73
- * Anonymous forum replies
74
- * Turn comment notifications on or off by post
75
- * Allow admins/mods to edit comments (they can already delete them)
76
- * Fix security vulnerability in AuthenticatedSystem
77
-
78
- =1.2.0
79
- * Threaded private messages
80
- * Clear cache link in admin dashboard
81
- * Add support for using rakismet gem to check comments for spam (see README for instructions)
82
-
83
- =1.1.0
84
- * fixed time_ago formatting problem on user/index
85
- * user Authlogic's perishable token for doing password resets (instead of sending them a password)
86
-
87
-
88
- = 1.0.4.2
89
- * Rails 2.3.4 compatibility (all tests pass, Takk)
90
- * Add searchlogic gem dependency (searchlogic is awesome, will be using it more in the future, currently just using on admin_controller#comments)
91
- * Add searchlogic to manage tags page, add taggings_count to tags (new migration)
92
-
93
- = 1.0.4
94
- * Changes to Japanese language translations
95
- * Use authlogic instead of restful_authentication (augthlogic gem now required, new migrations required) (thanks jnimety!)
96
- * Big overhaul of i18n by sdecleire, more international-friendly translation tokens. `en` is now the default locale (instead of `en-US`)
97
-
98
-
99
- = 1.0.3
100
- * complete private messages integration, allow sending messages to multiple recipients
101
- * upgrades to Event functionality, including RSVPs (eksatx)
102
- * Photo albums, Static pages and messages controller tests (juafrlo, eksatx)
103
- * calendar_date_select, icalendar gems now required
104
- * added ability to unsubscribe from comment notifications for anonymous comments
105
- * ical format output for Events to allow subscriptions
106
-
107
- = 1.0.2
108
- * Rails 2.3 compatibility
109
- * RedCloth no longer required
110
- * fixed swfupload to work with 2.3 and use Rack middleware
111
- * use Desert plugin for code mixing and plugin migrations instead of Engines
112
- * allow moderators/activity owners to delete activities
113
- * only track login activity once per day
114
- * allow anonymous commenters to choose whether they want to receive follow-up comment notices by e-mail
115
- * refactor views to use 'box' helper for logical content modules, allowing better flexibility when trying to customize layouts
116
-
117
- = 1.0.1
118
- * fixed error when cropping photos using file system storage
119
- * fixed error on messages#delete
120
-
121
-
122
- = 1.0.0
123
- * postgres compatibility (thanks Johannes)
124
- * Some SEO improvements to page titles and urls for showing tags
125
- * Fixed a security vulnerability
126
- * updated to newest attachment_fu plugin (note new cropping in geometry strings for photo in application.yml)
127
- - this attachment fu requires ImageMagick 6.4 or greater
128
- * updated swfupload to fix flash 10 compatibility
129
- * added ability to crop profile photo to better fit dimensions (/username/crop_profile_photo)
130
- * updated TinyMCE scripts
131
- * updated to newest Prototype and scriptaculous, and removed unused javascript files
132
-
133
- = 0.10.8
134
-
135
- * Updating CE for Rails 2.2.2 compatibility
136
- * Removed Globalite in favor of Rails' native I18n API. Ce localization should work without modification
137
- * renamed dozens of files to use Rails 2.0 conventions (ie. .html.haml)
138
- * updated truncate calls to use new options hash format
139
-
140
-
141
- = 0.10.7
142
-
143
- * Updating CE to be compatible with Rails 2.1.2
144
- * Lots of il8n refactoring, mainly using symbol tokens instead of string for localization in views.
@@ -1,80 +0,0 @@
1
- class AdminController < BaseController
2
- before_filter :admin_required
3
-
4
- def clear_cache
5
- case Rails.cache
6
- when ActiveSupport::Cache::FileStore
7
- dir = Rails.cache.cache_path
8
- unless dir == Rails.public_path
9
- FileUtils.rm_r(Dir.glob(dir+"/*")) rescue Errno::ENOENT
10
- Rails.logger.info("Cache directory fully swept.")
11
- end
12
- flash[:notice] = :cache_cleared.l
13
- else
14
- Rails.logger.warn("Cache not swept: you must override AdminController#clear_cache to support #{Rails.cache}")
15
- end
16
- redirect_to admin_dashboard_path and return
17
- end
18
-
19
- def events
20
- @events = Event.order('start_time DESC').page(params[:page])
21
- end
22
-
23
- def messages
24
- @user = current_user
25
- @messages = Message.order('created_at DESC').page(params[:page]).per(50)
26
- end
27
-
28
- def users
29
- @users = User.recent
30
- user = User.arel_table
31
-
32
- if params['login']
33
- @users = @users.where(user[:login].matches("%#{params['login']}%"))
34
- end
35
- if params['email']
36
- @users = @users.where(user[:email].matches("%#{params['email']}%"))
37
- end
38
-
39
- @users = @users.page(params[:page]).per(100)
40
-
41
- respond_to do |format|
42
- format.html
43
- format.xml {
44
- render :xml => @users.to_xml(:except => [ :password, :crypted_password, :single_access_token, :perishable_token, :password_salt, :persistence_token ])
45
- }
46
- end
47
- end
48
-
49
- def comments
50
- @search = Comment.search(params[:q])
51
- @comments = @search.result.distinct
52
- @comments = @comments.order("created_at DESC").page(params[:page]).per(100)
53
- end
54
-
55
- def activate_user
56
- user = User.find(params[:id])
57
- user.activate
58
- flash[:notice] = :the_user_was_activated.l
59
- redirect_to :action => :users
60
- end
61
-
62
- def deactivate_user
63
- user = User.find(params[:id])
64
- user.deactivate
65
- flash[:notice] = :the_user_was_deactivated.l
66
- redirect_to :action => :users
67
- end
68
-
69
- def subscribers
70
- @users = User.where("notify_community_news = ? AND users.activated_at IS NOT NULL", (params[:unsubs] ? false : true))
71
-
72
- respond_to do |format|
73
- format.xml {
74
- render :xml => @users.to_xml(:only => [:login, :email])
75
- }
76
- end
77
-
78
- end
79
-
80
- end
@@ -1,90 +0,0 @@
1
- class AdsController < BaseController
2
-
3
- before_filter :login_required
4
- before_filter :admin_required
5
-
6
- uses_tiny_mce do
7
- {:only => [:new, :edit, :create, :update], :options => configatron.default_mce_options}
8
- end
9
-
10
- # GET /ads
11
- # GET /ads.xml
12
- def index
13
- @search = Ad.search(params[:q])
14
- @result = @search.result
15
- @ads = @result.order('created_at DESC').distinct
16
- @ads = @result.page(params[:page]).per(15)
17
-
18
- respond_to do |format|
19
- format.html
20
- end
21
- end
22
-
23
- # GET /ads/1
24
- # GET /ads/1.xml
25
- def show
26
- @ad = Ad.find(params[:id])
27
-
28
- respond_to do |format|
29
- format.html
30
- end
31
- end
32
-
33
- # GET /ads/new
34
- def new
35
- @ad = Ad.new
36
- end
37
-
38
- # GET /ads/1;edit
39
- def edit
40
- @ad = Ad.find(params[:id])
41
- end
42
-
43
- # POST /ads
44
- # POST /ads.xml
45
- def create
46
- @ad = Ad.new(ad_params)
47
-
48
- respond_to do |format|
49
- if @ad.save
50
- flash[:notice] = :ad_was_successfully_created.l
51
- format.html { redirect_to ad_url(@ad) }
52
- else
53
- format.html { render :action => "new" }
54
- end
55
- end
56
- end
57
-
58
- # PUT /ads/1
59
- # PUT /ads/1.xml
60
- def update
61
- @ad = Ad.find(params[:id])
62
-
63
- respond_to do |format|
64
- if @ad.update_attributes(ad_params)
65
- flash[:notice] = :ad_was_successfully_updated.l
66
- format.html { redirect_to ad_url(@ad) }
67
- else
68
- format.html { render :action => "edit" }
69
- end
70
- end
71
- end
72
-
73
- # DELETE /ads/1
74
- # DELETE /ads/1.xml
75
- def destroy
76
- @ad = Ad.find(params[:id])
77
- @ad.destroy
78
-
79
- respond_to do |format|
80
- format.html { redirect_to ads_url }
81
- format.xml { head :ok }
82
- end
83
- end
84
-
85
- private
86
-
87
- def ad_params
88
- params[:ad].permit(:html, :name, :frequency, :audience, :published, :time_constrained, :start_date, :end_date, :location)
89
- end
90
- end
@@ -1,74 +0,0 @@
1
- class HomepageFeaturesController < BaseController
2
- uses_tiny_mce do
3
- {:only => [:new, :edit, :create, :update ], :options => configatron.default_mce_options}
4
- end
5
-
6
- before_filter :login_required
7
- before_filter :admin_required
8
-
9
- def index
10
- @search = HomepageFeature.search(params[:q])
11
- @homepage_features = @search.result
12
- @homepage_features = @homepage_features.order('created_at DESC').page(params[:page]).per(100)
13
- respond_to do |format|
14
- format.html
15
- end
16
- end
17
-
18
- def show
19
- @homepage_feature = HomepageFeature.find(params[:id])
20
-
21
- respond_to do |format|
22
- format.html
23
- end
24
- end
25
-
26
- def new
27
- @homepage_feature = HomepageFeature.new
28
- end
29
-
30
- def edit
31
- @homepage_feature = HomepageFeature.find(params[:id])
32
- end
33
-
34
- def create
35
- @homepage_feature = HomepageFeature.new(homepage_feature_params)
36
-
37
- respond_to do |format|
38
- if @homepage_feature.save
39
- flash[:notice] = :homepage_feature_created.l
40
-
41
- format.html { redirect_to homepage_feature_url(@homepage_feature) }
42
- else
43
- format.html { render :action => "new" }
44
- end
45
- end
46
- end
47
-
48
- def update
49
- @homepage_feature = HomepageFeature.find(params[:id])
50
-
51
- respond_to do |format|
52
- if @homepage_feature.update_attributes(homepage_feature_params)
53
- format.html { redirect_to homepage_feature_url(@homepage_feature) }
54
- else
55
- format.html { render :action => "edit" }
56
- end
57
- end
58
- end
59
-
60
- def destroy
61
- @homepage_feature = HomepageFeature.find(params[:id])
62
- @homepage_feature.destroy
63
-
64
- respond_to do |format|
65
- format.html { redirect_to homepage_features_url }
66
- end
67
- end
68
-
69
- private
70
-
71
- def homepage_feature_params
72
- params[:homepage_feature].permit(:url, :title, :description, :image)
73
- end
74
- end
@@ -1,74 +0,0 @@
1
- class MetroAreasController < BaseController
2
- before_filter :login_required
3
- before_filter :admin_required
4
-
5
- def index
6
- @metro_areas = MetroArea.includes(:country).order("countries.name, metro_areas.name DESC").references(:countries).page(params[:page])
7
- end
8
-
9
- def show
10
- @metro_area = MetroArea.find(params[:id])
11
-
12
- respond_to do |format|
13
- format.html
14
- format.xml { render :xml => @metro_area.to_xml }
15
- end
16
- end
17
-
18
- def new
19
- @metro_area = MetroArea.new
20
- end
21
-
22
- def edit
23
- @metro_area = MetroArea.find(params[:id])
24
- end
25
-
26
- def create
27
- @metro_area = MetroArea.new(metro_area_params)
28
-
29
- respond_to do |format|
30
- if @metro_area.save
31
- flash[:notice] = :metro_area_was_successfully_created.l
32
-
33
- format.html { redirect_to metro_area_url(@metro_area) }
34
- format.xml do
35
- headers["Location"] = metro_area_url(@metro_area)
36
- render :nothing => true, :status => "201 Created"
37
- end
38
- else
39
- format.html { render :action => "new" }
40
- format.xml { render :xml => @metro_area.errors.to_xml }
41
- end
42
- end
43
- end
44
-
45
- def update
46
- @metro_area = MetroArea.find(params[:id])
47
-
48
- respond_to do |format|
49
- if @metro_area.update_attributes(metro_area_params)
50
- format.html { redirect_to metro_area_url(@metro_area) }
51
- format.xml { render :nothing => true }
52
- else
53
- format.html { render :action => "edit" }
54
- format.xml { render :xml => @metro_area.errors.to_xml }
55
- end
56
- end
57
- end
58
-
59
- def destroy
60
- @metro_area = MetroArea.find(params[:id])
61
- @metro_area.destroy
62
-
63
- respond_to do |format|
64
- format.html { redirect_to metro_areas_url }
65
- format.xml { render :nothing => true }
66
- end
67
- end
68
-
69
- private
70
-
71
- def metro_area_params
72
- params[:metro_area].permit(:name, :state, :country_id, :state_id)
73
- end
74
- end