Permalink
Browse files

merge latest from jeremiah

  • Loading branch information...
2 parents f8c6c15 + 27e1c3f commit f14dd7c75d202cb651715b778301521159079407 @jlapier committed Dec 15, 2010
Showing with 1,797 additions and 11,282 deletions.
  1. +1 −0 .gitignore
  2. +9 −26 Gemfile
  3. +90 −52 Gemfile.lock
  4. +58 −4 app/controllers/application_controller.rb
  5. +25 −0 app/controllers/dashboards_controller.rb
  6. +15 −3 app/helpers/application_helper.rb
  7. +29 −0 app/helpers/wiki_pages_helper.rb
  8. +55 −0 app/helpers/wikis_helper.rb
  9. +69 −0 app/models/ability.rb
  10. +57 −0 app/views/dashboards/event_calendar.html.erb
  11. +15 −0 app/views/dashboards/file_share.html.erb
  12. +59 −0 app/views/events/show.html.erb
  13. +16 −21 app/views/layouts/application.html.erb
  14. +1 −1 app/views/message_posts/_message_in_forum.html.erb
  15. +2 −0 app/views/site_settings/admin.html.erb
  16. +1 −1 app/views/user_groups/show.html.erb
  17. +6 −14 app/views/wikis/_top_links.html.erb
  18. +8 −12 app/views/wikis/index.html.erb
  19. +2 −6 app/views/wikis/show.html.erb
  20. +10 −0 config/blueprint_settings.yml
  21. +7 −0 config/routes.rb
  22. +33 −0 db/migrate/20101124231412_event_calendar_schema_after_make_events_revisable.rb
  23. +5 −0 db/migrate/20101124231413_event_calendar_seed.rb
  24. +15 −0 db/migrate/20101202170830_file_share_schema_after_create_file_attachments.rb
  25. +5 −0 db/migrate/20101202170831_file_share_seed.rb
  26. +50 −7 db/schema.rb
  27. +25 −0 lib/tasks/blueprint.rake
  28. +169 −0 lib/tasks/event_calendar.rake
  29. +169 −0 lib/tasks/file_share.rake
  30. +48 −0 notes.txt
  31. 0 public/javascripts/{application.js → cms_wiki_forum.js}
  32. 0 public/javascripts/{behaviors.js → cms_wiki_forum_behaviors.js}
  33. +0 −965 public/javascripts/controls.js
  34. +0 −974 public/javascripts/dragdrop.js
  35. +0 −1,123 public/javascripts/effects.js
  36. +0 −339 public/javascripts/lowpro.js
  37. +0 −6,001 public/javascripts/prototype.js
  38. +74 −1 public/stylesheets/application.css
  39. BIN public/stylesheets/icons/cross.png
  40. BIN public/stylesheets/icons/doc.png
  41. BIN public/stylesheets/icons/email.png
  42. BIN public/stylesheets/icons/external.png
  43. BIN public/stylesheets/icons/feed.png
  44. BIN public/stylesheets/icons/im.png
  45. BIN public/stylesheets/icons/key.png
  46. BIN public/stylesheets/icons/pdf.png
  47. BIN public/stylesheets/icons/tick.png
  48. BIN public/stylesheets/icons/visited.png
  49. BIN public/stylesheets/icons/xls.png
  50. +36 −0 public/stylesheets/ie.css
  51. +3 −0 public/stylesheets/main_elements.css
  52. +29 −0 public/stylesheets/print.css
  53. +12 −0 public/stylesheets/readme.txt
  54. +560 −0 public/stylesheets/screen.css
  55. +5 −1 spec/helpers/application_helper_spec.rb
  56. +5 −1 spec/views/wiki_comments/index.html.erb_spec.rb
  57. +1 −1 spec/views/wiki_pages/search.html.erb_spec.rb
  58. +14 −4 spec/views/wiki_pages/show.html.erb_spec.rb
  59. +2 −1 spec/views/wikis/index.html.erb_spec.rb
  60. +2 −1 spec/views/wikis/show.html.erb_spec.rb
  61. +0 −20 vendor/plugins/rails_upgrade/MIT-LICENSE
  62. +0 −20 vendor/plugins/rails_upgrade/README
  63. +0 −22 vendor/plugins/rails_upgrade/Rakefile
  64. +0 −2 vendor/plugins/rails_upgrade/init.rb
  65. +0 −38 vendor/plugins/rails_upgrade/install.rb
  66. +0 −472 vendor/plugins/rails_upgrade/lib/application_checker.rb
  67. +0 −95 vendor/plugins/rails_upgrade/lib/gemfile_generator.rb
  68. +0 −51 vendor/plugins/rails_upgrade/lib/new_configuration_generator.rb
  69. 0 vendor/plugins/rails_upgrade/lib/rails_upgrade.rb
  70. +0 −349 vendor/plugins/rails_upgrade/lib/routes_upgrader.rb
  71. +0 −78 vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake
  72. +0 −293 vendor/plugins/rails_upgrade/test/application_checker_test.rb
  73. +0 −72 vendor/plugins/rails_upgrade/test/gemfile_generator_test.rb
  74. +0 −63 vendor/plugins/rails_upgrade/test/new_configuration_generator_test.rb
  75. +0 −142 vendor/plugins/rails_upgrade/test/routes_upgrader_test.rb
  76. +0 −5 vendor/plugins/rails_upgrade/test/test_helper.rb
  77. +0 −1 vendor/plugins/rails_upgrade/uninstall.rb
View
@@ -20,3 +20,4 @@ public/themes
public/images/favorite.png
coverage/
.rvmrc
+public/files
View
35 Gemfile
@@ -1,39 +1,22 @@
source 'http://rubygems.org'
-gem 'rails', '3.0.1'
-
-# Bundle edge Rails instead:
-# gem 'rails', :git => 'git://github.com/rails/rails.git'
+gem 'rails', '3.0.3'
gem 'sqlite3-ruby', :require => 'sqlite3'
-# Use unicorn as the web server
-# gem 'unicorn'
-
-# Deploy with Capistrano
-# gem 'capistrano'
-
-# To use debugger
-# gem 'ruby-debug'
-
-# Bundle the extra gems:
-# gem 'bj'
-# gem 'nokogiri'
-# gem 'sqlite3-ruby', :require => 'sqlite3'
-# gem 'aws-s3', :require => 'aws/s3'
-
-gem 'RedCloth'
+gem "acts_as_versioned"
gem 'authlogic', :git => 'http://github.com/binarylogic/authlogic.git'
gem 'authlogic-oid', :require => 'authlogic_openid'
+gem 'cancan'
+gem 'event_calendar_engine', '~> 0.1.0', :require => 'event_calendar'
+gem 'file_share', '~> 0.1.4'
+gem 'formtastic'
+gem 'RedCloth'
gem 'ruby-openid', :require => 'openid'
gem "will_paginate", "~> 3.0.pre2"
-gem "acts_as_versioned"
-# Bundle gems for the local environment. Make sure to
-# put test-only gems in this group so their generators
-# and rake tasks are available in development mode:
group :development, :test do
- gem 'rspec-rails', '~> 2.1.0'
+ gem 'rspec-rails'
gem 'webrat'
- gem 'factory_girl' #, '>= 1.2.4'
+ gem 'factory_girl'
end
View
@@ -10,85 +10,119 @@ GEM
specs:
RedCloth (4.2.3)
abstract (1.0.0)
- actionmailer (3.0.1)
- actionpack (= 3.0.1)
- mail (~> 2.2.5)
- actionpack (3.0.1)
- activemodel (= 3.0.1)
- activesupport (= 3.0.1)
+ actionmailer (3.0.3)
+ actionpack (= 3.0.3)
+ mail (~> 2.2.9)
+ actionpack (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
builder (~> 2.1.2)
erubis (~> 2.6.6)
- i18n (~> 0.4.1)
+ i18n (~> 0.4)
rack (~> 1.2.1)
- rack-mount (~> 0.6.12)
- rack-test (~> 0.5.4)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.6)
tzinfo (~> 0.3.23)
- activemodel (3.0.1)
- activesupport (= 3.0.1)
+ activemodel (3.0.3)
+ activesupport (= 3.0.3)
builder (~> 2.1.2)
- i18n (~> 0.4.1)
- activerecord (3.0.1)
- activemodel (= 3.0.1)
- activesupport (= 3.0.1)
- arel (~> 1.0.0)
+ i18n (~> 0.4)
+ activerecord (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ arel (~> 2.0.2)
tzinfo (~> 0.3.23)
- activeresource (3.0.1)
- activemodel (= 3.0.1)
- activesupport (= 3.0.1)
- activesupport (3.0.1)
+ activeresource (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ activesupport (3.0.3)
+ acts_as_revisable (1.1.1)
acts_as_versioned (0.6.0)
activerecord (~> 3.0.0.beta4)
- arel (1.0.1)
- activesupport (~> 3.0.0)
+ arel (2.0.6)
authlogic-oid (1.0.4)
authlogic
builder (2.1.2)
+ cancan (1.4.1)
diff-lcs (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
+ event_calendar_engine (0.1.0)
+ RedCloth
+ RedCloth
+ acts_as_revisable
+ acts_as_revisable
+ formtastic
+ formtastic
+ prarupa
+ prarupa
+ rails (= 3.0.3)
+ rails (= 3.0.3)
+ sqlite3-ruby
+ sqlite3-ruby
+ will_paginate (~> 3.0.pre2)
+ will_paginate (~> 3.0.pre2)
factory_girl (1.3.2)
- i18n (0.4.2)
- mail (2.2.9)
+ file_share (0.1.4)
+ formtastic
+ formtastic
+ rails (= 3.0.3)
+ rails (= 3.0.3)
+ sqlite3-ruby
+ sqlite3-ruby
+ formtastic (1.2.2)
+ actionpack (>= 2.3.7)
+ activesupport (>= 2.3.7)
+ i18n (>= 0.4.0)
+ i18n (0.5.0)
+ mail (2.2.12)
activesupport (>= 2.3.6)
- i18n (~> 0.4.1)
+ i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
- nokogiri (1.4.3.1)
+ nokogiri (1.4.4)
polyglot (0.3.1)
+ prarupa (0.1.2)
+ RedCloth (~> 4.2)
+ rdiscount (~> 1.6)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-test (0.5.6)
rack (>= 1.0)
- rails (3.0.1)
- actionmailer (= 3.0.1)
- actionpack (= 3.0.1)
- activerecord (= 3.0.1)
- activeresource (= 3.0.1)
- activesupport (= 3.0.1)
- bundler (~> 1.0.0)
- railties (= 3.0.1)
- railties (3.0.1)
- actionpack (= 3.0.1)
- activesupport (= 3.0.1)
- rake (>= 0.8.4)
- thor (~> 0.14.0)
+ rails (3.0.3)
+ actionmailer (= 3.0.3)
+ actionpack (= 3.0.3)
+ activerecord (= 3.0.3)
+ activeresource (= 3.0.3)
+ activesupport (= 3.0.3)
+ bundler (~> 1.0)
+ railties (= 3.0.3)
+ railties (3.0.3)
+ actionpack (= 3.0.3)
+ activesupport (= 3.0.3)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
rake (0.8.7)
- rspec (2.1.0)
- rspec-core (~> 2.1.0)
- rspec-expectations (~> 2.1.0)
- rspec-mocks (~> 2.1.0)
- rspec-core (2.1.0)
- rspec-expectations (2.1.0)
+ rdiscount (1.6.5)
+ rspec (2.2.0)
+ rspec-core (~> 2.2)
+ rspec-expectations (~> 2.2)
+ rspec-mocks (~> 2.2)
+ rspec-core (2.2.1)
+ rspec-expectations (2.2.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.1.0)
- rspec-rails (2.1.0)
- rspec (~> 2.1.0)
+ rspec-mocks (2.2.0)
+ rspec-rails (2.2.1)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec (~> 2.2.0)
ruby-openid (2.1.8)
sqlite3-ruby (1.3.2)
- thor (0.14.4)
- treetop (1.4.8)
+ thor (0.14.6)
+ treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
webrat (0.7.2)
@@ -105,9 +139,13 @@ DEPENDENCIES
acts_as_versioned
authlogic!
authlogic-oid
+ cancan
+ event_calendar_engine (~> 0.1.0)
factory_girl
- rails (= 3.0.1)
- rspec-rails (~> 2.1.0)
+ file_share (~> 0.1.4)
+ formtastic
+ rails (= 3.0.3)
+ rspec-rails
ruby-openid
sqlite3-ruby
webrat
@@ -1,10 +1,63 @@
class ApplicationController < ActionController::Base
+
+ before_filter :protect_event_calendar
+ before_filter :protect_file_share
+ before_filter :setup_file_share
+
protect_from_forgery
- helper_method :current_user_session, :current_user
+ helper EventCalendar::ApplicationHelper
+ helper FileShare::ApplicationHelper
+
+ helper_method :current_user_session, :current_user, :in_event_calendar?,
+ :in_file_share?, :has_authorization?
before_filter :get_menus, :get_layout
-
+
+ private
+
+ def has_authorization?(*args)
+ return false unless current_user
+ return can?(*args)
+ end
+
+ def in_event_calendar?
+ self.class.ancestors.include?(EventCalendar::ApplicationController)
+ end
+
+ def in_file_share?
+ self.class.ancestors.include?(FileShare::ApplicationController)
+ end
+
+ def protect_event_calendar
+ if in_event_calendar?
+ # allow all users to view events
+ unless controller_name == "events" &&
+ action_name =~ /(index|show)/
+ return require_admin_user
+ end
+ end
+ end
+
+ def protect_file_share
+ if in_file_share?
+ if controller_name == 'file_attachments' && action_name == 'download'
+ # allow anonymous users to view/download files
+ return true
+ end
+ # attendees et al avail. to admin only
+ return require_admin_user
+ end
+ end
+
+ def setup_file_share
+ Event.send :include, FileContainer
+ EventsController.send :helper, FileAttachmentsHelper
+ end
+
+ protected
+
+ public
# checks to see if user is a member of a given access group - if not,
# redirect to account controller
@@ -106,9 +159,10 @@ def require_user
end
def require_admin_user
- unless current_user and current_user.is_admin?
+ return false unless require_user
+ unless current_user.is_admin?
flash[:error] = "You do not have permission to access that page."
- redirect_to login_path
+ redirect_to account_path
return false
end
end
@@ -0,0 +1,25 @@
+class DashboardsController < ApplicationController
+
+ before_filter :require_admin_user
+ before_filter :setup_file_share
+
+ private
+
+ def setup_file_share
+ unless defined?(FileShare::FileAttachmentsHelper)
+ self.class.helper FileShare::FileAttachmentsHelper
+ end
+ end
+
+ public
+
+ def event_calendar
+ @past_events = Event.past.order("start_on ASC")
+ @future_events = Event.future.order("start_on ASC")
+ end
+
+ def file_share
+ @orphaned_files = FileAttachment.where('attachable_id IS NULL')
+ @files = FileAttachment.where('attachable_id IS NOT NULL')
+ end
+end
@@ -8,7 +8,7 @@ def side_menu
end
def logo_image
- image_tag(site_logo)
+ "<img src=\"/images/#{site_logo}\" alt=\"logo\"/>".html_safe
end
def site_title
@@ -57,7 +57,6 @@ def site_footer
def user_box
#out = "#{pluralize User.logged_in.count, 'user'} currently logged in<br />\n"
out = ""
-
if current_user
out += "Welcome, #{current_user.first_name}!<br />\n"
out += link_to("My Account", account_path) + " | " +
@@ -84,7 +83,10 @@ def user_box
else
out += link_to("Register", new_account_path) + " | " +
link_to( "Log In", new_user_session_path)
- end
+ end
+ out += " | "
+ out += link_to_events({:no_wrapper => true},
+ {:link_text => 'Events'})
out.html_safe
end
@@ -108,4 +110,14 @@ def post_time(time)
time_ago_in_words(time) + " ago"
end
end
+ def event_file_javascripts
+ (event_calendar_javascript_includes + file_share_javascript_includes).compact.uniq
+ end
+ def javascripts
+ [
+ 'jquery', 'rails', 'lowpro.jquery.js', 'jquery.string.1.0-min.js',
+ 'jquery.tablesorter.min.js', 'jquery-ui-1.7.2.custom.min.js',
+ 'cms_wiki_forum_behaviors'
+ ]
+ end
end
Oops, something went wrong.

0 comments on commit f14dd7c

Please sign in to comment.