├── public ├── favicon.ico ├── blank_iframe.html ├── demo │ ├── demo.jpg │ ├── freehub.mp4 │ └── summary.html ├── images │ ├── rails.png │ ├── body_bg.png │ ├── ey-logo.gif │ ├── spinner.gif │ ├── footer_bg.png │ ├── tag_yellow.png │ ├── design │ │ ├── Person.png │ │ ├── Visits.png │ │ ├── home_started.png │ │ ├── freehub_profile1.jpg │ │ └── freehub_profile2.jpg │ └── calendar_date_select │ │ └── calendar.gif ├── javascripts │ ├── calendar_date_select │ │ ├── locale │ │ │ ├── fi.js │ │ │ └── pl.js │ │ ├── format_euro_24hr.js │ │ ├── format_italian.js │ │ ├── format_american.js │ │ ├── format_finnish.js │ │ ├── format_db.js │ │ └── format_hyphen_ampm.js │ └── application.js ├── robots.txt ├── stylesheets │ ├── reset-min.css │ ├── tags.css │ ├── people.css │ └── scaffold.css ├── 422.html ├── 404.html ├── 500.html └── maintenance.html ├── .ruby-gemset ├── .ruby-version ├── log └── .gitignore ├── vendor └── plugins │ ├── userstamp │ ├── TODO │ ├── doc │ │ ├── created.rid │ │ ├── index.html │ │ ├── classes │ │ │ ├── UserstampTest.src │ │ │ │ ├── M000001.html │ │ │ │ ├── M000002.html │ │ │ │ ├── M000011.html │ │ │ │ ├── M000006.html │ │ │ │ ├── M000007.html │ │ │ │ ├── M000003.html │ │ │ │ ├── M000005.html │ │ │ │ └── M000004.html │ │ │ └── ActiveRecord │ │ │ │ ├── Base.src │ │ │ │ ├── M000016.html │ │ │ │ └── M000015.html │ │ │ │ └── Userstamp.src │ │ │ │ ├── M000013.html │ │ │ │ └── M000012.html │ │ ├── fr_file_index.html │ │ └── fr_class_index.html │ ├── CHANGELOG │ ├── test │ │ ├── fixtures │ │ │ ├── customers.yml │ │ │ ├── posts.yml │ │ │ ├── users.yml │ │ │ ├── entries.yml │ │ │ └── mysql.sql │ │ ├── connection.rb │ │ └── abstract_unit.rb │ └── init.rb │ ├── restful_authentication │ ├── install.rb │ ├── generators │ │ └── authenticated │ │ │ ├── USAGE │ │ │ └── templates │ │ │ ├── helper.rb │ │ │ ├── model_helper.rb │ │ │ ├── activation.html.erb │ │ │ ├── signup_notification.html.erb │ │ │ ├── observer.rb │ │ │ ├── login.html.erb │ │ │ ├── authenticated_test_helper.rb │ │ │ ├── signup.html.erb │ │ │ ├── mailer_test.rb │ │ │ ├── mailer.rb │ │ │ ├── fixtures.yml │ │ │ ├── migration.rb │ │ │ └── controller.rb │ ├── Rakefile │ ├── lib │ │ └── restful_authentication │ │ │ └── rails_commands.rb │ └── README │ ├── blue-ridge │ ├── vendor │ │ ├── js.jar │ │ ├── README │ │ ├── smoke.stub.js │ │ ├── screw.mocking.js │ │ ├── jquery.fn.js │ │ ├── LICENSE-Smoke │ │ ├── LICENSE-Screw.Unit │ │ ├── screw.events.js │ │ └── smoke.core.js │ ├── generators │ │ ├── blue_ridge │ │ │ ├── templates │ │ │ │ ├── spec_helper.js │ │ │ │ ├── application_spec.js │ │ │ │ └── application.html │ │ │ └── blue_ridge_generator.rb │ │ └── javascript_spec │ │ │ ├── templates │ │ │ ├── javascript_spec.js.erb │ │ │ └── fixture.html.erb │ │ │ └── javascript_spec_generator.rb │ ├── spec │ │ ├── javascripts │ │ │ ├── spec_helper.js │ │ │ ├── smoke │ │ │ │ ├── stub_spec.js │ │ │ │ └── screw_integration_spec.js │ │ │ └── fixtures │ │ │ │ ├── smoke │ │ │ │ ├── core.html │ │ │ │ ├── mock.html │ │ │ │ ├── stub.html │ │ │ │ └── screw_integration.html │ │ │ │ ├── screw.unit │ │ │ │ ├── screw.print.html │ │ │ │ ├── screw.behaviors.html │ │ │ │ └── screw.matchers.html │ │ │ │ ├── blue_ridge_browser.html │ │ │ │ └── blue_ridge_command_line.html │ │ └── rubies │ │ │ └── spec_helper.rb │ ├── Rakefile │ ├── lib │ │ ├── shell.js │ │ ├── consoleReportForRake.js │ │ └── blue_ridge.rb │ ├── CONTRIBUTORS │ ├── LICENSE │ └── tasks │ │ └── javascript_testing_tasks.rake │ ├── paginating_find │ ├── test_app │ │ ├── app │ │ │ └── controllers │ │ │ │ └── application.rb │ │ ├── test │ │ │ ├── fixtures │ │ │ │ ├── authors.yml │ │ │ │ ├── edits.yml │ │ │ │ ├── articles.yml │ │ │ │ └── models.rb │ │ │ ├── unit │ │ │ │ ├── abstract_test.rb │ │ │ │ └── group_test.rb │ │ │ └── test_helper.rb │ │ ├── script │ │ │ ├── console │ │ │ └── breakpointer │ │ ├── config │ │ │ ├── database.yml │ │ │ ├── environments │ │ │ │ └── test.rb │ │ │ ├── routes.rb │ │ │ └── boot.rb │ │ ├── Rakefile │ │ └── db │ │ │ └── schema.rb │ ├── init.rb │ └── lib │ │ └── paging_helper.rb │ ├── auto_complete │ ├── init.rb │ ├── Rakefile │ ├── README │ └── lib │ │ └── auto_complete.rb │ └── haml │ └── init.rb ├── .dockerignore ├── app ├── helpers │ ├── reports_helper.rb │ ├── sessions_helper.rb │ ├── visits_helper.rb │ ├── services_helper.rb │ ├── organizations_helper.rb │ ├── users_helper.rb │ ├── people_helper.rb │ ├── notes_helper.rb │ ├── url_helper.rb │ └── application_helper.rb ├── controllers │ ├── layout_controller.rb │ ├── tags_controller.rb │ ├── taggings_controller.rb │ ├── sessions_controller.rb │ └── application_controller.rb ├── views │ ├── user_mailer │ │ ├── activation.html.erb │ │ ├── reset_password.html.erb │ │ ├── signup_notification.html.erb │ │ └── forgot_password.html.erb │ ├── users │ │ ├── edit.html.haml │ │ ├── new.html.haml │ │ ├── show.html.haml │ │ ├── forgot.html.haml │ │ ├── reset.html.haml │ │ ├── _form.html.haml │ │ └── index.html.haml │ ├── organizations │ │ ├── edit.html.haml │ │ ├── show.html.haml │ │ ├── _form.html.haml │ │ └── new.html.haml │ ├── services │ │ ├── new.html.haml │ │ ├── edit.html.haml │ │ ├── show.html.haml │ │ ├── _form.html.haml │ │ └── index.html.haml │ ├── visits │ │ ├── new.html.haml │ │ ├── show.html.haml │ │ ├── _form.html.haml │ │ ├── edit.html.haml │ │ ├── _person_search.html.haml │ │ ├── index.html.haml │ │ └── day.html.haml │ ├── notes │ │ ├── new.html.haml │ │ ├── show.html.haml │ │ ├── edit.html.haml │ │ └── index.html.haml │ ├── people │ │ ├── new.html.haml │ │ └── edit.html.haml │ ├── sessions │ │ └── new.html.haml │ ├── reports │ │ ├── index.html.haml │ │ └── visits.html.haml │ ├── taggings │ │ └── _index.html.haml │ └── tags │ │ └── show.html.haml └── models │ ├── user_observer.rb │ ├── service_type.rb │ ├── role.rb │ ├── user_mailer.rb │ └── note.rb ├── .gitignore ├── script ├── about ├── plugin ├── runner ├── server ├── console ├── destroy ├── generate ├── dbconsole ├── process │ ├── reaper │ ├── spawner │ └── inspector └── performance │ ├── profiler │ ├── request │ └── benchmarker ├── lib ├── tag.rb ├── tagging.rb ├── tasks │ ├── freehub.rake │ └── hoptoad_notifier_tasks.rake ├── authenticated_test_helper.rb ├── activerecord_extensions.rb ├── legacy_models.rb └── named_scope_extensions.rb ├── config ├── initializers │ ├── custom_titlecase.rb │ ├── hoptoad.rb │ ├── mime_types.rb │ ├── inflections.rb │ ├── backtrace_silencers.rb │ ├── utf8_params.rb │ ├── session_store.rb │ └── new_rails_defaults.rb ├── locales │ └── en.yml ├── database.yml ├── preinitializer.rb └── environments │ ├── development.rb │ ├── staging.rb │ ├── test.rb │ └── production.rb ├── doc └── README_FOR_APP ├── db ├── migrate │ ├── 010_add_person_year_of_birth.rb │ ├── 008_add_organization_location.rb │ ├── 20100626223127_visits_arrived_at.rb │ ├── 009_add_visit_staff_member.rb │ ├── 001_create_organizations.rb │ ├── 005_create_roles.rb │ ├── 002_create_users.rb │ ├── 007_create_notes.rb │ ├── 20100611221211_acts_as_taggable_on_migration.rb │ ├── 004_create_visits.rb │ ├── 006_create_services.rb │ └── 003_create_people.rb └── seeds.rb ├── test ├── fixtures │ ├── tags.yml │ ├── taggings.yml │ ├── roles.yml │ ├── organizations.yml │ ├── visits.yml │ ├── notes.yml │ └── services.yml ├── unit │ ├── note_test.rb │ ├── service_type_test.rb │ ├── role_test.rb │ ├── user_mailer_test.rb │ └── organization_test.rb ├── javascript │ └── spec_helper.js ├── functional │ ├── tags_controller_test.rb │ └── notes_controller_test.rb └── test_helper.rb ├── Rakefile ├── docker-compose.yaml ├── LICENSE ├── README.rdoc ├── Gemfile ├── flexbox.html ├── flexbox.css ├── Dockerfile └── Gemfile.lock /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | freehub 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 1.9.3-p551 2 | -------------------------------------------------------------------------------- /log/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/TODO: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git* 2 | log/* 3 | tmp/* 4 | -------------------------------------------------------------------------------- /app/helpers/reports_helper.rb: -------------------------------------------------------------------------------- 1 | module ReportsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | .idea 3 | *.iml 4 | .generators 5 | .rakeTasks -------------------------------------------------------------------------------- /app/helpers/visits_helper.rb: -------------------------------------------------------------------------------- 1 | module VisitsHelper 2 | 3 | end 4 | -------------------------------------------------------------------------------- /app/helpers/services_helper.rb: -------------------------------------------------------------------------------- 1 | module ServicesHelper 2 | 3 | end 4 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/created.rid: -------------------------------------------------------------------------------- 1 | Sat Jan 21 17:08:50 MST 2006 2 | -------------------------------------------------------------------------------- /app/helpers/organizations_helper.rb: -------------------------------------------------------------------------------- 1 | module OrganizationsHelper 2 | 3 | end 4 | -------------------------------------------------------------------------------- /public/blank_iframe.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/demo/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/demo/demo.jpg -------------------------------------------------------------------------------- /vendor/plugins/userstamp/CHANGELOG: -------------------------------------------------------------------------------- 1 | 2 | 1.0 (01-18-2006) 3 | * Initial Release 4 | -------------------------------------------------------------------------------- /public/demo/freehub.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/demo/freehub.mp4 -------------------------------------------------------------------------------- /public/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/rails.png -------------------------------------------------------------------------------- /public/images/body_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/body_bg.png -------------------------------------------------------------------------------- /public/images/ey-logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/ey-logo.gif -------------------------------------------------------------------------------- /public/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/spinner.gif -------------------------------------------------------------------------------- /public/images/footer_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/footer_bg.png -------------------------------------------------------------------------------- /public/images/tag_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/tag_yellow.png -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/install.rb: -------------------------------------------------------------------------------- 1 | puts IO.read(File.join(File.dirname(__FILE__), 'README')) -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/fixtures/customers.yml: -------------------------------------------------------------------------------- 1 | first_customer: 2 | id: 1 3 | name: Customer One -------------------------------------------------------------------------------- /public/images/design/Person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/design/Person.png -------------------------------------------------------------------------------- /public/images/design/Visits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/design/Visits.png -------------------------------------------------------------------------------- /script/about: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/about' 4 | -------------------------------------------------------------------------------- /script/plugin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/plugin' 4 | -------------------------------------------------------------------------------- /script/runner: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/runner' 4 | -------------------------------------------------------------------------------- /script/server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/server' 4 | -------------------------------------------------------------------------------- /app/controllers/layout_controller.rb: -------------------------------------------------------------------------------- 1 | class LayoutController < ApplicationController 2 | 3 | def grid 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /public/images/design/home_started.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/design/home_started.png -------------------------------------------------------------------------------- /script/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/console' 4 | -------------------------------------------------------------------------------- /script/destroy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/destroy' 4 | -------------------------------------------------------------------------------- /script/generate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/generate' 4 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/USAGE: -------------------------------------------------------------------------------- 1 | ./script/generate authenticated USERMODEL CONTROLLERNAME -------------------------------------------------------------------------------- /public/images/design/freehub_profile1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/design/freehub_profile1.jpg -------------------------------------------------------------------------------- /public/images/design/freehub_profile2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/design/freehub_profile2.jpg -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/vendor/plugins/blue-ridge/vendor/js.jar -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/app/controllers/application.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/helper.rb: -------------------------------------------------------------------------------- 1 | module <%= controller_class_name %>Helper 2 | end -------------------------------------------------------------------------------- /lib/tag.rb: -------------------------------------------------------------------------------- 1 | # Only here to get rake db:fixtures:load to work. Do not use for any other purpose. 2 | class Tag < ActsAsTaggableOn::Tag; end -------------------------------------------------------------------------------- /script/dbconsole: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.expand_path('../../config/boot', __FILE__) 3 | require 'commands/dbconsole' 4 | -------------------------------------------------------------------------------- /app/views/user_mailer/activation.html.erb: -------------------------------------------------------------------------------- 1 | <%= @user.login %>, welcome to Freehub! 2 | 3 | Your account has been activated. 4 | 5 | <%= @url %> -------------------------------------------------------------------------------- /script/process/reaper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/process/reaper' 4 | -------------------------------------------------------------------------------- /script/process/spawner: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/process/spawner' 4 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/model_helper.rb: -------------------------------------------------------------------------------- 1 | module <%= model_controller_class_name %>Helper 2 | end -------------------------------------------------------------------------------- /config/initializers/custom_titlecase.rb: -------------------------------------------------------------------------------- 1 | class String 2 | def custom_titlecase 3 | self.gsub(/\b\w/) { |w| w.upcase } 4 | end 5 | end -------------------------------------------------------------------------------- /lib/tagging.rb: -------------------------------------------------------------------------------- 1 | # Only here to get rake db:fixtures:load to work. Do not use for any other purpose. 2 | class Tagging < ActsAsTaggableOn::Tagging; end -------------------------------------------------------------------------------- /public/images/calendar_date_select/calendar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/images/calendar_date_select/calendar.gif -------------------------------------------------------------------------------- /script/process/inspector: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/process/inspector' 4 | -------------------------------------------------------------------------------- /vendor/plugins/auto_complete/init.rb: -------------------------------------------------------------------------------- 1 | ActionController::Base.send :include, AutoComplete 2 | ActionController::Base.helper AutoCompleteMacrosHelper -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/init.rb: -------------------------------------------------------------------------------- 1 | ActiveRecord::Base.send(:include, PaginatingFind) 2 | ActionView::Base.send(:include, PaginatingFind::Helpers) -------------------------------------------------------------------------------- /script/performance/profiler: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/performance/profiler' 4 | -------------------------------------------------------------------------------- /script/performance/request: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/performance/request' 4 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/fixtures/posts.yml: -------------------------------------------------------------------------------- 1 | first_post: 2 | id: 1 3 | name: Post One 4 | 5 | second_post: 6 | id: 2 7 | name: Post Two -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/locale/fi.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asalant/freehub/HEAD/public/javascripts/calendar_date_select/locale/fi.js -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/blue_ridge/templates/spec_helper.js: -------------------------------------------------------------------------------- 1 | // Use this file to require common dependencies or to setup useful test functions. -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/fixtures/authors.yml: -------------------------------------------------------------------------------- 1 | alex: 2 | id: 1 3 | name: Alex Wolfe 4 | 5 | sam: 6 | id: 2 7 | name: Sam I Am -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | first_user: 2 | id: 1 3 | name: Tester One 4 | 5 | second_user: 6 | id: 2 7 | name: Tester Two -------------------------------------------------------------------------------- /app/views/user_mailer/reset_password.html.erb: -------------------------------------------------------------------------------- 1 | Password reset successfully for: 2 | 3 | Login: <%= @user.login %> 4 | Email: <%= @user.email %> 5 | 6 | 7 | -------------------------------------------------------------------------------- /script/performance/benchmarker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/performance/benchmarker' 4 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/script/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/console' -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/script/breakpointer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/breakpointer' -------------------------------------------------------------------------------- /config/initializers/hoptoad.rb: -------------------------------------------------------------------------------- 1 | require 'hoptoad_notifier/rails' 2 | HoptoadNotifier.configure do |config| 3 | config.api_key = '19dac31e381a2814509b2c4955a9f0b3' 4 | end 5 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/config/database.yml: -------------------------------------------------------------------------------- 1 | test: 2 | adapter: mysql 3 | database: paginating_find_test 4 | username: root 5 | password: 6 | host: localhost 7 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/activation.html.erb: -------------------------------------------------------------------------------- 1 | <%%= @<%= file_name %>.login %>, your account has been activated. You may now start adding your plugins: 2 | 3 | <%%= @url %> -------------------------------------------------------------------------------- /app/views/user_mailer/signup_notification.html.erb: -------------------------------------------------------------------------------- 1 | Your account has been created. 2 | 3 | Username: <%= @user.login %> 4 | Password: <%= @user.password %> 5 | 6 | Visit this url to activate your account: 7 | 8 | <%= @url %> -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. 3 | -------------------------------------------------------------------------------- /app/views/users/edit.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 Editing user 4 | =error_messages_for :user 5 | -form_for @user do |f| 6 | %ul 7 | = render :partial => 'users/form', :object => f 8 | %li= f.submit 'Update' 9 | -------------------------------------------------------------------------------- /app/views/users/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 New user 4 | =error_messages_for :user 5 | -form_for @user do |f| 6 | %ul 7 | = render :partial => 'users/form', :object => f 8 | %li= f.submit 'Sign Up' 9 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" -------------------------------------------------------------------------------- /lib/tasks/freehub.rake: -------------------------------------------------------------------------------- 1 | namespace :models do 2 | desc "Updates model and fixture annotations with database fields" 3 | task :annotate do 4 | system 'annotate --delete' 5 | system 'annotate --position before --exclude tests' 6 | end 7 | end -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/README: -------------------------------------------------------------------------------- 1 | env.rhino.js: 2 | * Version: 1.2.0.6 3 | * Modifications: removed the Env.js header log message 4 | 5 | js.jar: 6 | * Version: (not sure) 7 | * Origin: pulled from the "rhino" directory from env.js (v1.2.0.2) 8 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/fixtures/entries.yml: -------------------------------------------------------------------------------- 1 | first_entry: 2 | id: 1 3 | name: Entry One 4 | created_by: 1 5 | updated_by: 1 6 | 7 | second_entry: 8 | id: 2 9 | name: Entry Two 10 | created_by: 2 11 | updated_by: 2 -------------------------------------------------------------------------------- /db/migrate/010_add_person_year_of_birth.rb: -------------------------------------------------------------------------------- 1 | class AddPersonYearOfBirth < ActiveRecord::Migration 2 | def self.up 3 | add_column :people, :yob, :integer 4 | end 5 | 6 | def self.down 7 | remove_column :people, :yob 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/fixtures/tags.yml: -------------------------------------------------------------------------------- 1 | key_holder: 2 | name: key holder 3 | 4 | board_member: 5 | name: board member 6 | 7 | youth: 8 | name: youth 9 | 10 | mom: 11 | name: mom 12 | 13 | mechanic: 14 | name: mechanic 15 | 16 | church: 17 | name: church -------------------------------------------------------------------------------- /vendor/plugins/userstamp/init.rb: -------------------------------------------------------------------------------- 1 | # plugin init file for rails 2 | # this file will be picked up by rails automatically and 3 | # add the userstamp extensions to rails 4 | 5 | require 'userstamp' 6 | 7 | ActiveRecord::Base.send(:include, ActiveRecord::Userstamp) -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/fixtures/edits.yml: -------------------------------------------------------------------------------- 1 | new_idea: 2 | id: 1 3 | text: I have a new idea 4 | author_id: 1 5 | article_id: 1 6 | 7 | remove_para: 8 | id: 2 9 | text: Remove paragraph 2 10 | author_id: 2 11 | article_id: 1 -------------------------------------------------------------------------------- /db/migrate/008_add_organization_location.rb: -------------------------------------------------------------------------------- 1 | class AddOrganizationLocation < ActiveRecord::Migration 2 | def self.up 3 | add_column :organizations, :location, :string 4 | end 5 | 6 | def self.down 7 | remove_column :organizations, :location 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20100626223127_visits_arrived_at.rb: -------------------------------------------------------------------------------- 1 | class VisitsArrivedAt < ActiveRecord::Migration 2 | def self.up 3 | rename_column :visits, :datetime, :arrived_at 4 | end 5 | 6 | def self.down 7 | rename_column :visits, :arrived_at, :datetime 8 | end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/signup_notification.html.erb: -------------------------------------------------------------------------------- 1 | Your account has been created. 2 | 3 | Username: <%%= @<%= file_name %>.login %> 4 | Password: <%%= @<%= file_name %>.password %> 5 | 6 | Visit this url to activate your account: 7 | 8 | <%%= @url %> -------------------------------------------------------------------------------- /app/views/user_mailer/forgot_password.html.erb: -------------------------------------------------------------------------------- 1 | Request to reset password received for: 2 | 3 | Login: <%= @user.login %> 4 | Email: <%= @user.email %> 5 | 6 | Visit this url to choose a new password: 7 | 8 | <%= @url %> 9 | 10 | (Your password will remain the same if no action is taken.) 11 | 12 | -------------------------------------------------------------------------------- /app/views/organizations/edit.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | %h1 #{link_to @organization.name, @organization} : Edit 3 | 4 | =error_messages_for :organization 5 | -form_for @organization do |f| 6 | %ul 7 | = render :partial => 'form', :object => f 8 | %li 9 | =f.submit 'Update' 10 | -------------------------------------------------------------------------------- /app/controllers/tags_controller.rb: -------------------------------------------------------------------------------- 1 | class TagsController < ApplicationController 2 | 3 | permit "admin or (manager of :organization)" 4 | 5 | def show 6 | @tag = ActsAsTaggableOn::Tag.find(params[:id]) 7 | @people = Person.for_organization(@organization).tagged_with(@tag.name).paginate(params) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/009_add_visit_staff_member.rb: -------------------------------------------------------------------------------- 1 | class AddVisitStaffMember < ActiveRecord::Migration 2 | def self.up 3 | add_column :visits, :staff, :boolean 4 | add_column :visits, :member, :boolean 5 | end 6 | 7 | def self.down 8 | remove_column :visits, :staff 9 | remove_column :visits, :member 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/locale/pl.js: -------------------------------------------------------------------------------- 1 | Date.weekdays = $w('P W Ś C P S N'); 2 | Date.months = $w('Styczeń Luty Marzec Kwiecień Maj Czerwiec Lipiec Sierpień Wrzesień Październik Listopad Grudzień'); 3 | 4 | Date.first_day_of_week = 1 5 | 6 | _translations = { 7 | "OK": "OK", 8 | "Now": "Teraz", 9 | "Today": "Dziś" 10 | } -------------------------------------------------------------------------------- /test/unit/note_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NoteTest < ActiveSupport::TestCase 4 | def test_for_person 5 | assert_equal 4, Note.for_person(people(:mary)).size 6 | assert_equal 4, Note.count_for_person(people(:mary)) 7 | assert_equal 2, Note.for_person(people(:mary), :limit => 2).size 8 | end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require(File.join(File.dirname(__FILE__), 'config', 'boot')) 5 | 6 | require 'rake' 7 | require 'rake/testtask' 8 | require 'rdoc/task' 9 | 10 | require 'tasks/rails' 11 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/unit/abstract_test.rb: -------------------------------------------------------------------------------- 1 | 2 | $:.unshift(File.dirname(__FILE__) + '/../../../lib') 3 | require 'paginating_find' 4 | require 'test_helper' 5 | require File.join(File.dirname(__FILE__), '/../fixtures/models') 6 | load(File.dirname(__FILE__) + "/../../db/schema.rb") 7 | load(File.dirname(__FILE__) + "/../../../init.rb") 8 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/spec_helper.js: -------------------------------------------------------------------------------- 1 | function fixture(element) { 2 | $('
').append(element).appendTo("body"); 3 | } 4 | 5 | function teardownFixtures() { 6 | $("#fixtures").remove(); 7 | } 8 | 9 | function createDescribeDiv(name){ 10 | return $('
  • ').append('

    ' + name + '

    '); 11 | } 12 | -------------------------------------------------------------------------------- /app/views/services/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 4 | =link_to @person.full_name, person_path(:id => @person) 5 | = " : " 6 | =link_to 'Services', services_path(:person_id => @person) 7 | = " : New" 8 | 9 | -form_for @service do |f| 10 | =error_messages_for :service 11 | =render :partial => 'services/form', :object => f 12 | -------------------------------------------------------------------------------- /app/views/organizations/show.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | -if current_user.activated_at.nil? 3 | %div.section 4 | %p.warn 5 | Your account is pending activation. We've sent an activation email to #{current_user.email}. 6 | Check that email account and your spam filter for the activation email. 7 | 8 | = render :partial => 'visits/person_search' 9 | -------------------------------------------------------------------------------- /app/views/visits/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | %h1 3 | =link_to @person.full_name, person_path(:id => @person) 4 | = ' : ' 5 | =link_to 'Visits', visits_path(:person_id => @person) 6 | = ' : New' 7 | 8 | -form_for @visit do |f| 9 | =error_messages_for :visit 10 | =render :partial => 'visits/form', :object => f, :locals => { :visit => @visit } 11 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) 7 | # Major.create(:name => 'Daley', :city => cities.first) 8 | -------------------------------------------------------------------------------- /app/views/services/edit.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 4 | =link_to @person.full_name, person_path(:id => @person) 5 | = " : " 6 | =link_to 'Services', services_path(:person_id => @person) 7 | = " : Edit" 8 | 9 | -form_for @service, :url => service_path do |f| 10 | =error_messages_for :service 11 | =render :partial => 'services/form', :object => f 12 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/format_euro_24hr.js: -------------------------------------------------------------------------------- 1 | // Formats date and time as "01 January 2000 17:00" 2 | Date.prototype.toFormattedString = function(include_time) 3 | { 4 | str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); 5 | if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } 6 | return str; 7 | } -------------------------------------------------------------------------------- /public/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // Always set the csrf token for ajax requests 2 | (function($) 3 | { 4 | $.ajaxSetup({ 5 | beforeSend: function(xhr) { 6 | var token = $('meta[name="csrf-token"]').attr('content'); 7 | xhr.setRequestHeader('X-CSRF-TOKEN', token); 8 | console.log('X-CSRF-TOKEN', token); 9 | } 10 | }); 11 | })(jQuery); -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require(File.join(File.dirname(__FILE__), 'config', 'boot')) 5 | 6 | require 'rake' 7 | require 'rake/testtask' 8 | require 'rake/rdoctask' 9 | 10 | require 'tasks/rails' 11 | -------------------------------------------------------------------------------- /test/unit/service_type_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ServiceTypeTest < Test::Unit::TestCase 4 | 5 | def test_new 6 | membership = ServiceType.new('MEMBERSHIP', "Membership", "Membership for this shop.") 7 | assert_equal "MEMBERSHIP", membership.id 8 | end 9 | 10 | def test_indexed 11 | assert_equal 'MEMBERSHIP', ServiceType[:membership].id 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/javascript_spec/templates/javascript_spec.js.erb: -------------------------------------------------------------------------------- 1 | require("spec_helper.js"); 2 | require("../../public/javascripts/<%= file_path_without_spec %>.js"); 3 | 4 | Screw.Unit(function(){ 5 | describe("<%= class_name_without_spec %>", function(){ 6 | it("does something", function(){ 7 | expect("hello").to(equal, "hello"); 8 | }); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /app/views/notes/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 #{link_to @person.full_name, person_path(:id => @person)} : #{link_to 'Notes', notes_path(:person_id => @person)} : New 4 | 5 | =error_messages_for :note 6 | -form_for @note do |f| 7 | %ul 8 | =labeled_input 'Text', :for => :text do 9 | -capture do 10 | =f.text_area :text, :rows => 6 11 | %li 12 | =f.submit "Create" 13 | -------------------------------------------------------------------------------- /app/views/users/show.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 #{@user.name} Profile 4 | %ul 5 | =labeled_value 'Name', @user.name 6 | =labeled_value 'Email', @user.email 7 | =labeled_value 'Login', @user.login 8 | =labeled_value 'Activated at', @user.activated_at.nil? ? 'Not yet activated' : datetime_long(@user.activated_at) 9 | -if permit?('owner of :user') 10 | =link_to 'Edit', edit_user_path(@user) 11 | -------------------------------------------------------------------------------- /test/javascript/spec_helper.js: -------------------------------------------------------------------------------- 1 | // Use this file to require common dependencies or to setup useful test functions. 2 | 3 | jQuery.fn.fixture = function() { 4 | this.each(function() { 5 | if (this.original) { 6 | $(this).html(this.original); 7 | } else { 8 | this.original = $(this).html(); 9 | } 10 | }); 11 | }; 12 | 13 | function isHeadless() { 14 | return navigator.userAgent.match(/Envjs/); 15 | } -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/fixtures/articles.yml: -------------------------------------------------------------------------------- 1 | testing: 2 | id: 1 3 | name: Testing Rails Applications 4 | author_id: 1 5 | 6 | deploying: 7 | id: 2 8 | name: Deploying Rails Applications 9 | author_id: 2 10 | 11 | donkies: 12 | id: 3 13 | name: What about the donkies? 14 | author_id: 2 15 | 16 | whales: 17 | id: 4 18 | name: Won't somebody think of the whales? 19 | author_id: 2 -------------------------------------------------------------------------------- /app/views/notes/show.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 #{link_to @person.full_name, person_path(:id => @person)} : #{link_to 'Notes', notes_path(:person_id => @person)} : Detail 4 | 5 | %ul.note 6 | =labeled_value 'Notable', "#{@note.notable_type} (#{@note.notable_id})" 7 | =labeled_value 'Text', note_text(@note) 8 | -userstamp_labeled_values @note 9 | 10 | =link_to 'Edit', edit_note_path(:id => @note) 11 | -------------------------------------------------------------------------------- /lib/authenticated_test_helper.rb: -------------------------------------------------------------------------------- 1 | module AuthenticatedTestHelper 2 | # Sets the current user in the session from the user fixtures. 3 | def login_as(user) 4 | @request.session[:user_id] = user ? users(user).id : nil 5 | end 6 | 7 | def authorize_as(user) 8 | @request.env["HTTP_AUTHORIZATION"] = user ? ActionController::HttpAuthentication::Basic.encode_credentials(users(user).login, 'test') : nil 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/models/user_observer.rb: -------------------------------------------------------------------------------- 1 | class UserObserver < ActiveRecord::Observer 2 | def after_create(user) 3 | UserMailer.deliver_signup_notification(user) 4 | end 5 | 6 | def after_save(user) 7 | UserMailer.deliver_activation(user) if user.pending? 8 | UserMailer.deliver_forgot_password(user) if user.recently_forgot_password? 9 | UserMailer.deliver_reset_password(user) if user.recently_reset_password? 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/connection.rb: -------------------------------------------------------------------------------- 1 | print "Using native MySQL\n" 2 | require 'logger' 3 | 4 | ActiveRecord::Base.logger = Logger.new("debug.log") 5 | 6 | db = 'userstamp_test' 7 | 8 | ActiveRecord::Base.establish_connection( 9 | :adapter => "mysql", 10 | :host => "localhost", 11 | :username => "root", 12 | :password => "", 13 | :database => db, 14 | :socket => "/var/run/mysqld/mysqld.sock" 15 | ) 16 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | -------------------------------------------------------------------------------- /public/demo/summary.html: -------------------------------------------------------------------------------- 1 | 2 | Short Demo on Freehub 3 | 4 | 10 | 11 | 12 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/unit/role_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RoleTest < ActiveSupport::TestCase 4 | 5 | def test_admin_role 6 | assert users(:admin).is_admin? 7 | assert !users(:sfbk).is_admin? 8 | end 9 | 10 | def test_manager_role 11 | assert users(:sfbk).is_manager? 12 | assert users(:sfbk).is_manager_of?(organizations(:sfbk)) 13 | assert !users(:sfbk).is_manager_of?(organizations(:scbc)) 14 | end 15 | 16 | end 17 | 18 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying do debug a problem that might steem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! -------------------------------------------------------------------------------- /db/migrate/001_create_organizations.rb: -------------------------------------------------------------------------------- 1 | class CreateOrganizations < ActiveRecord::Migration 2 | def self.up 3 | create_table :organizations do |t| 4 | t.string :name, :nil => false 5 | t.string :key, :nil => false 6 | t.string :timezone, :nil => false 7 | 8 | t.timestamps 9 | end 10 | 11 | add_index :organizations, :key , :unique => true 12 | end 13 | 14 | def self.down 15 | drop_table :organizations 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Based on https://blog.codeship.com/running-rails-development-environment-docker/ 2 | app: 3 | build: . 4 | environment: 5 | - DATABASE_HOST=mysql 6 | command: /app/script/server 7 | volumes: 8 | - .:/app 9 | ports: 10 | - "3000:3000" 11 | links: 12 | - mysql 13 | mysql: 14 | image: mariadb:10.0 # Matches features of mysql:5.6 15 | environment: 16 | - MYSQL_ROOT_PASSWORD=password 17 | ports: 18 | - "3306" 19 | -------------------------------------------------------------------------------- /app/views/users/forgot.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 User: Send password reset 4 | 5 | -form_for @user, :url => forgot_path do |f| 6 | =error_messages_for :user 7 | %ul 8 | =labeled_input 'Email', :for => :user_email do 9 | -capture do 10 | = f.text_field(:email) 11 | %p.instruct Enter the email address you signed up with. You will get an email with a link to reset your password. 12 | %li 13 | =submit_tag 'Submit' 14 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/rubies/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require "rubygems" 2 | require "micronaut" 3 | 4 | def not_in_editor? 5 | ['TM_MODE', 'EMACS', 'VIM'].all? { |k| !ENV.has_key?(k) } 6 | end 7 | 8 | Micronaut.configure do |config| 9 | config.formatter = :progress 10 | config.mock_with :mocha 11 | config.color_enabled = not_in_editor? 12 | config.filter_run :focused => true 13 | config.alias_example_to :fit, :focused => true 14 | config.profile_examples = false 15 | end 16 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/observer.rb: -------------------------------------------------------------------------------- 1 | class <%= class_name %>Observer < ActiveRecord::Observer 2 | def after_create(<%= file_name %>) 3 | <%= class_name %>Mailer.deliver_signup_notification(<%= file_name %>) 4 | end 5 | 6 | def after_save(<%= file_name %>) 7 | <% if options[:include_activation] %> 8 | <%= class_name %>Mailer.deliver_activation(<%= file_name %>) if <%= file_name %>.pending? 9 | <% end %> 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/tasks/hoptoad_notifier_tasks.rake: -------------------------------------------------------------------------------- 1 | # Don't load anything when running the gems:* tasks. 2 | # Otherwise, hoptoad_notifier will be considered a framework gem. 3 | # https://thoughtbot.lighthouseapp.com/projects/14221/tickets/629 4 | unless ARGV.any? {|a| a =~ /^gems/} 5 | 6 | Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier| 7 | $: << File.join(vendored_notifier, 'lib') 8 | end 9 | 10 | require 'hoptoad_notifier/tasks' 11 | 12 | end 13 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/Rakefile: -------------------------------------------------------------------------------- 1 | require "rubygems" 2 | require "micronaut" 3 | require "micronaut/rake_task" 4 | 5 | ENV["BLUE_RIDGE_PREFIX"] = File.dirname(__FILE__) 6 | import File.dirname(__FILE__) + '/tasks/javascript_testing_tasks.rake' 7 | 8 | namespace :test do 9 | desc "Run all micronaut examples using rcov" 10 | Micronaut::RakeTask.new :rubies do |t| 11 | t.pattern = "spec/rubies/**/*_spec.rb" 12 | end 13 | end 14 | 15 | task :default => ["test:rubies", "test:javascripts"] -------------------------------------------------------------------------------- /test/fixtures/taggings.yml: -------------------------------------------------------------------------------- 1 | mary_mom: 2 | taggable: mary (Person) 3 | context: tags 4 | tag: mom 5 | 6 | mary_mechanic: 7 | taggable: mary (Person) 8 | context: tags 9 | tag: mechanic 10 | 11 | marty_mechanic: 12 | taggable: marty (Person) 13 | context: tags 14 | tag: mechanic 15 | 16 | marty_key_holder: 17 | taggable: marty (Person) 18 | context: tags 19 | tag: key_holder 20 | 21 | mary_scbc_church: 22 | taggable: mary_scbc (Person) 23 | context: tags 24 | tag: church -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/fixtures/models.rb: -------------------------------------------------------------------------------- 1 | class Author < ActiveRecord::Base 2 | has_many :edits 3 | end 4 | 5 | class Edit < ActiveRecord::Base 6 | belongs_to :author 7 | belongs_to :article 8 | end 9 | 10 | class Article < ActiveRecord::Base 11 | has_many :edits 12 | has_many :editors, :through => :edits, :source => :author 13 | belongs_to :author 14 | 15 | def self.find_with_scope(options={}, &block) 16 | with_scope(:find => options, &block) 17 | end 18 | end -------------------------------------------------------------------------------- /app/views/people/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | %h1 People : New 3 | %p 4 | Only First Name is required. For those who wish not to be identified, please sign in as 5 | = "#{ link_to 'Anonymous', report_path(:action => :people, :report => { :matching_name => 'Anonymous' }) }." 6 | 7 | =error_messages_for :person 8 | -form_for @person do |f| 9 | = render :partial => 'people/form', :object => f, :locals => { :person => @person } 10 | :javascript 11 | $('person_first_name').focus(); 12 | -------------------------------------------------------------------------------- /lib/activerecord_extensions.rb: -------------------------------------------------------------------------------- 1 | module Freehub 2 | module Userstamp 3 | 4 | def self.included(mod) 5 | mod.extend(ClassMethods) 6 | end 7 | 8 | module ClassMethods 9 | def has_userstamps 10 | belongs_to :created_by, :class_name => "User", :foreign_key => "created_by_id" 11 | belongs_to :updated_by, :class_name => "User", :foreign_key => "updated_by_id" 12 | end 13 | end 14 | end 15 | end 16 | 17 | ActiveRecord::Base.send(:include, Freehub::Userstamp) -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/blue_ridge/templates/application_spec.js: -------------------------------------------------------------------------------- 1 | require("spec_helper.js"); 2 | require("../../public/javascripts/application.js"); 3 | 4 | Screw.Unit(function(){ 5 | describe("Your application javascript", function(){ 6 | it("does something", function(){ 7 | expect("hello").to(equal, "hello"); 8 | }); 9 | 10 | it("accesses the DOM from fixtures/application.html", function(){ 11 | expect($('.select_me').length).to(equal, 2); 12 | }); 13 | }); 14 | }); 15 | 16 | -------------------------------------------------------------------------------- /lib/legacy_models.rb: -------------------------------------------------------------------------------- 1 | module Legacy 2 | class Operation < ActiveRecord::Base 3 | end 4 | 5 | class OperationDate < ActiveRecord::Base 6 | belongs_to :operation 7 | has_many :visits 8 | has_many :people, :through => :visits 9 | end 10 | 11 | class Person < ActiveRecord::Base 12 | has_many :visits 13 | end 14 | 15 | class Visit < ActiveRecord::Base 16 | belongs_to :person 17 | belongs_to :operation_date 18 | 19 | TYPES = %w{Patron Staff EAB} 20 | end 21 | end -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | 3 | def userstamp_labeled_values(model) 4 | [labeled_value('Created', "#{datetime_short(model.created_at)} by #{user_link(model.created_by)}"), 5 | labeled_value('Updated', "#{datetime_short(model.updated_at)} by #{user_link(model.updated_by)}")].join 6 | end 7 | 8 | def user_link(user) 9 | return unless user 10 | Haml::Engine.new(< user) 14 | end 15 | 16 | end -------------------------------------------------------------------------------- /app/views/people/edit.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | %h1= "#{link_to @person.full_name, person_path(:id => @person)} : Detail" 3 | %p 4 | If this record is a mistake you can 5 | = link_to "remove #{@person.first_name}", person_path(:id => @person), :confirm => 'Are you sure?', :method => :delete 6 | from the system. 7 | 8 | =error_messages_for :person 9 | -form_for @person, :url => person_path(:id => @person) do |f| 10 | = render :partial => 'people/form', :object => f, :locals => { :person => @person } 11 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/abstract_unit.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'rubygems' 3 | require_gem 'activesupport' 4 | require_gem 'activerecord' 5 | require 'connection' 6 | require 'active_record/fixtures' 7 | 8 | RAILS_ROOT = File.dirname(__FILE__) 9 | 10 | $: << "../lib" 11 | 12 | require 'userstamp.rb' 13 | 14 | class ActiveRecord::Base 15 | include ActiveRecord::Userstamp 16 | end 17 | 18 | 19 | class Test::Unit::TestCase 20 | self.fixture_path = File.dirname(__FILE__) + "/fixtures/" 21 | end -------------------------------------------------------------------------------- /app/views/notes/edit.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 #{link_to @person.full_name, person_path(:id => @person)} : #{link_to 'Notes', notes_path(:person_id => @person)} : Edit 4 | 5 | =error_messages_for :note 6 | -form_for @note, :url => note_path do |f| 7 | %ul 8 | =labeled_input 'Regarding' do 9 | -capture do 10 | =notable_link(@note.notable) 11 | =labeled_input 'Text', :for => :text do 12 | -capture do 13 | =f.text_area :text, :rows => 6 14 | %li 15 | =f.submit "Create" 16 | -------------------------------------------------------------------------------- /app/views/users/reset.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 User: Reset password for #{@user.email} 4 | =error_messages_for :user 5 | -form_for @user, :url => reset_path(:reset_code => params[:reset_code]), :html => { :method => :post } do |f| 6 | =labeled_input 'Password', :for => :password do 7 | -capture do 8 | =f.password_field :password 9 | =labeled_input 'Confirm Password', :for => :password_confirmation do 10 | -capture do 11 | =f.password_field :password_confirmation 12 | %li= submit_tag 'Reset' 13 | -------------------------------------------------------------------------------- /db/migrate/005_create_roles.rb: -------------------------------------------------------------------------------- 1 | class CreateRoles < ActiveRecord::Migration 2 | 3 | def self.up 4 | create_table :roles_users, :id => false, :force => true do |t| 5 | t.integer :user_id, :role_id 6 | t.timestamps 7 | end 8 | 9 | create_table :roles, :force => true do |t| 10 | t.string :name, :authorizable_type, :limit => 40 11 | t.integer :authorizable_id 12 | t.timestamps 13 | end 14 | end 15 | 16 | def self.down 17 | drop_table :roles 18 | drop_table :roles_users 19 | end 20 | 21 | end 22 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/db/schema.rb: -------------------------------------------------------------------------------- 1 | ActiveRecord::Schema.define(:version => 0) do 2 | create_table :authors, :force => true do |t| 3 | t.column :name, :string 4 | end 5 | 6 | create_table :edits, :force => true do |t| 7 | t.column :author_id, :integer 8 | t.column :article_id, :integer 9 | t.column :text, :string 10 | end 11 | 12 | create_table :articles, :force => true do |t| 13 | t.column :author_id, :integer 14 | t.column :name, :string 15 | end 16 | end -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/login.html.erb: -------------------------------------------------------------------------------- 1 | <%% form_tag <%= controller_singular_name %>_path do -%> 2 |


    3 | <%%= text_field_tag 'login' %>

    4 | 5 |


    6 | <%%= password_field_tag 'password' %>

    7 | 8 | 12 | 13 |

    <%%= submit_tag 'Log in' %>

    14 | <%% end -%> 15 | -------------------------------------------------------------------------------- /app/views/visits/show.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | %h1 3 | =link_to @person.full_name, person_path(:id => @person) 4 | = ' : ' 5 | =link_to 'Visits', visits_path(:person_id => @person) 6 | = ' : Detail' 7 | %ul 8 | =labeled_value 'Datetime', datetime_long(@visit.arrived_at) 9 | =labeled_value 'Volunteer', @visit.volunteer? 10 | =labeled_value 'Note', note_text(@visit.note) 11 | =labeled_value 'Person', @visit.person.full_name 12 | -userstamp_labeled_values @visit 13 | 14 | =link_to 'Edit', edit_visit_path(:id => @visit) 15 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb: -------------------------------------------------------------------------------- 1 | module AuthenticatedTestHelper 2 | # Sets the current <%= file_name %> in the session from the <%= file_name %> fixtures. 3 | def login_as(<%= file_name %>) 4 | @request.session[:<%= file_name %>_id] = <%= file_name %> ? <%= table_name %>(<%= file_name %>).id : nil 5 | end 6 | 7 | def authorize_as(user) 8 | @request.env["HTTP_AUTHORIZATION"] = user ? ActionController::HttpAuthentication::Basic.encode_credentials(users(user).login, 'test') : nil 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: mysql 3 | encoding: utf8 4 | database: freehub_for_all_development 5 | username: root 6 | password: password 7 | host: <%= ENV['DATABASE_HOST'] %> 8 | 9 | # Warning: The database defined as 'test' will be erased and 10 | # re-generated from your development database when you run 'rake'. 11 | # Do not set this db to the same as development or production. 12 | test: 13 | adapter: mysql 14 | encoding: utf8 15 | database: freehub_for_all_test 16 | username: root 17 | password: password 18 | host: <%= ENV['DATABASE_HOST'] %> 19 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/smoke/stub_spec.js: -------------------------------------------------------------------------------- 1 | Screw.Unit(function() { 2 | describe("stubbing", function() { 3 | before(function() { 4 | foo = {bar: function(attribute){return 'hello'}, baz:'goodbye'}; 5 | }); 6 | 7 | it("should return the stubbed value of a property", function() { 8 | stub(foo,'baz').and_set_to('baz'); 9 | expect(foo.baz).to(equal, 'baz'); 10 | }); 11 | 12 | it("should return the stubbed value of a function", function() { 13 | stub(foo,'bar').and_return('bar'); 14 | expect(foo.bar()).to(equal, 'bar'); 15 | }); 16 | }); 17 | }); -------------------------------------------------------------------------------- /app/views/users/_form.html.haml: -------------------------------------------------------------------------------- 1 | =labeled_input 'Full Name', :for => :name do 2 | -capture do 3 | =form.text_field :name 4 | =labeled_input 'Email', :for => :email do 5 | -capture do 6 | =form.text_field :email, :autocapitalize => 'none' 7 | =labeled_input 'Login', :for => :login do 8 | -capture do 9 | =form.text_field :login 10 | =labeled_input 'Password', :for => :password do 11 | -capture do 12 | =form.password_field :password 13 | =labeled_input 'Confirm Password', :for => :password_confirmation do 14 | -capture do 15 | =form.password_field :password_confirmation 16 | -------------------------------------------------------------------------------- /app/views/visits/_form.html.haml: -------------------------------------------------------------------------------- 1 | %ul 2 | =labeled_input 'Datetime', :for => :visit_arrived_at do 3 | -capture do 4 | =calendar_date_select_tag "visit[arrived_at]", visit.arrived_at, :time => true, :year_range => 3.years.ago..0.years.from_now 5 | =labeled_input 'Volunteer', :for => :visit_volunteer do 6 | -capture do 7 | =form.check_box :volunteer 8 | -fields_for :note, visit.note do |note| 9 | =labeled_input 'Note', :for => :visit_note do 10 | -capture do 11 | =note.text_area :text, :rows => 6 12 | %li 13 | =form.submit visit.new_record? ? "Create" : "Update" 14 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/javascript_spec/templates/fixture.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= class_name_without_spec %> | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008 San Francisco Bike Kitchen 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /app/views/visits/edit.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | %h1 3 | =link_to @person.full_name, person_path(:id => @person) 4 | = ' : ' 5 | =link_to 'Visits', visits_path(:person_id => @person) 6 | = ' : Edit' 7 | 8 | -form_for @visit, :url => visit_path do |f| 9 | =error_messages_for :visit 10 | -if params[:destination] 11 | =hidden_field_tag :destination, params[:destination] 12 | =render :partial => 'visits/form', :object => f, :locals => { :visit => @visit } 13 | :javascript 14 | Event.observe(window, 'load', function() { 15 | $('note_text').focus(); 16 | }); 17 | -------------------------------------------------------------------------------- /test/fixtures/roles.yml: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: roles 4 | # 5 | # id :integer(4) not null, primary key 6 | # name :string(40) 7 | # authorizable_type :string(40) 8 | # authorizable_id :integer(4) 9 | # created_at :datetime 10 | # updated_at :datetime 11 | # 12 | 13 | admin: 14 | name: admin 15 | 16 | sfbk_manager: 17 | name: manager 18 | authorizable: sfbk (Organization) 19 | 20 | scbc_manager: 21 | name: manager 22 | authorizable: scbc (Organization) 23 | 24 | cbi_manager: 25 | name: manager 26 | authorizable: cbi (Organization) 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/views/sessions/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 Log In 4 | 5 | -form_tag session_path do 6 | %ul 7 | =labeled_input 'Login', :for => :login do 8 | -capture do 9 | =text_field_tag 'login', '', :autocapitalize => 'none' 10 | =labeled_input 'Password', :for => :password do 11 | -capture do 12 | =password_field_tag 'password' 13 | %li 14 | =check_box_tag('remember_me') 15 | %label.choice.remember_me{:for => 'remember_me'} Remember me 16 | %li 17 | =submit_tag 'Log in' 18 | %li 19 | =link_to 'Forgot username or password?', forgot_path 20 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | {rdoc-image:https://dl.circleci.com/status-badge/img/gh/asalant/freehub/tree/master.svg?style=svg}[https://dl.circleci.com/status-badge/redirect/gh/asalant/freehub/tree/master] 2 | 3 | == Freehub 4 | 5 | Freehub is a Rails application created by the San Francisco Bike Kitchen 6 | to track members and visits to the shop in San Francisco. 7 | 8 | It is built as a multi-tentant system and deployed at http://freehub.bikekitchen.org 9 | where it is also used by several other community bike shops. 10 | 11 | The project home is http://github.com/asalant/freehub. For project details, support, developer guide and more see https://github.com/asalant/freehub/wiki. 12 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/signup.html.erb: -------------------------------------------------------------------------------- 1 | <%%= error_messages_for :<%= file_name %> %> 2 | <%% form_for :<%= file_name %>, :url => <%= table_name %>_path do |f| -%> 3 |


    4 | <%%= f.text_field :login %>

    5 | 6 |


    7 | <%%= f.text_field :email %>

    8 | 9 |


    10 | <%%= f.password_field :password %>

    11 | 12 |


    13 | <%%= f.password_field :password_confirmation %>

    14 | 15 |

    <%%= submit_tag 'Sign up' %>

    16 | <%% end -%> 17 | -------------------------------------------------------------------------------- /app/views/services/show.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | 3 | %h1 4 | =link_to @person.full_name, person_path(:id => @person) 5 | = " : " 6 | =link_to 'Services', services_path(:person_id => @person) 7 | = " : Detail" 8 | 9 | %ul 10 | =labeled_value 'Service type', @service.service_type.name 11 | =labeled_value 'Start date', @service.start_date 12 | =labeled_value 'End date', @service.end_date 13 | =labeled_value 'Paid', @service.paid 14 | =labeled_value 'Volunteered', @service.volunteered 15 | =labeled_value 'Note', note_text(@service.note) 16 | =userstamp_labeled_values @service 17 | 18 | =link_to 'Edit', edit_service_path(:id => @service) 19 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/blue_ridge/templates/application.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Application | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 |
    15 | 16 | 17 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/smoke/core.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Smoke Core | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/smoke/screw_integration_spec.js: -------------------------------------------------------------------------------- 1 | Screw.Unit(function() { 2 | describe("integrating with Screw.Unit", function() { 3 | before(function() { 4 | foo = {bar: function(attribute){return 'hello'}, baz:'goodbye'}; 5 | }); 6 | 7 | it("should forward stub() calls to new Stub to allow stub().and_return()", function() { 8 | var myStub = stub(foo,'baz') 9 | expect(myStub.and_return).to_not(equal, undefined); 10 | }); 11 | 12 | it("should forward mock() calls to new mock object to allow mock().should_receive()", function() { 13 | var myMock = mock(foo); 14 | expect(myMock.should_receive).to_not(equal,undefined) 15 | }); 16 | }); 17 | }); -------------------------------------------------------------------------------- /vendor/plugins/haml/init.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here 3 | rescue LoadError 4 | begin 5 | require 'haml' # From gem 6 | rescue LoadError => e 7 | # gems:install may be run to install Haml with the skeleton plugin 8 | # but not the gem itself installed. 9 | # Don't die if this is the case. 10 | raise e unless defined?(Rake) && 11 | (Rake.application.top_level_tasks.include?('gems') || 12 | Rake.application.top_level_tasks.include?('gems:install')) 13 | end 14 | end 15 | 16 | # Load Haml and Sass. 17 | # Haml may be undefined if we're running gems:install. 18 | Haml.init_rails(binding) if defined?(Haml) 19 | -------------------------------------------------------------------------------- /vendor/plugins/auto_complete/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rake/testtask' 3 | require 'rake/rdoctask' 4 | 5 | desc 'Default: run unit tests.' 6 | task :default => :test 7 | 8 | desc 'Test auto_complete plugin.' 9 | Rake::TestTask.new(:test) do |t| 10 | t.libs << 'lib' 11 | t.pattern = 'test/**/*_test.rb' 12 | t.verbose = true 13 | end 14 | 15 | desc 'Generate documentation for auto_complete plugin.' 16 | Rake::RDocTask.new(:rdoc) do |rdoc| 17 | rdoc.rdoc_dir = 'rdoc' 18 | rdoc.title = 'Auto Complete' 19 | rdoc.options << '--line-numbers' << '--inline-source' 20 | rdoc.rdoc_files.include('README') 21 | rdoc.rdoc_files.include('lib/**/*.rb') 22 | end 23 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/smoke/mock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Smoke Mocking | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/smoke/stub.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Smoke Stubbing | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /config/preinitializer.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require "rubygems" 3 | require "bundler" 4 | rescue LoadError 5 | raise "Could not load the bundler gem. Install it with `gem install bundler`." 6 | end 7 | 8 | if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24") 9 | raise RuntimeError, "Your bundler version is too old for Rails 2.3." + 10 | "Run `gem install bundler` to upgrade." 11 | end 12 | 13 | begin 14 | # Set up load paths for all bundled gems 15 | ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__) 16 | Bundler.setup 17 | rescue Bundler::GemNotFound 18 | raise RuntimeError, "Bundler couldn't find some gems." + 19 | "Did you run `bundle install`?" 20 | end 21 | 22 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/smoke/screw_integration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Smoke Stubbing | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/blue_ridge/blue_ridge_generator.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path(File.dirname(__FILE__) + '/../../lib/blue_ridge') 2 | 3 | class BlueRidgeGenerator < Rails::Generator::Base 4 | def manifest 5 | record do |m| 6 | base_dir = BlueRidge.javascript_spec_dir 7 | 8 | m.directory base_dir 9 | m.file 'application_spec.js', "#{base_dir}/application_spec.js" 10 | m.file 'spec_helper.js', "#{base_dir}/spec_helper.js" 11 | 12 | m.directory "#{base_dir}/fixtures" 13 | m.file 'application.html', "#{base_dir}/fixtures/application.html" 14 | m.file 'screw.css', "#{base_dir}/fixtures/screw.css" 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/screw.unit/screw.print.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Screw.Unit Print | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/smoke.stub.js: -------------------------------------------------------------------------------- 1 | Smoke.Stub = function(obj,attr) { 2 | this.obj = obj; 3 | this.attribute = attr; 4 | this.and_return(this.defaultReturn); 5 | }; 6 | 7 | Smoke.Stub.prototype = { 8 | defaultReturn: null, 9 | property: function(p){ 10 | this.property = p; 11 | this.and_set_to(this.defaultReturn); 12 | return this 13 | }, 14 | method: function(f){ 15 | this.func = f; 16 | this.and_return(this.defaultReturn); 17 | return this 18 | }, 19 | and_return: function(v){ 20 | this.obj[this.attribute] = function() { 21 | return v 22 | }; 23 | return this.obj 24 | }, 25 | and_set_to: function(v){ 26 | this.obj[this.attribute] = v; 27 | return this.obj 28 | } 29 | }; -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/blue_ridge_browser.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blue Ridge In-Browser Test Runner | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/screw.unit/screw.behaviors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Screw.Unit Behaviors | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/screw.unit/screw.matchers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Screw.Unit Matchers | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rake/testtask' 3 | require 'rake/rdoctask' 4 | 5 | desc 'Default: run unit tests.' 6 | task :default => :test 7 | 8 | desc 'Test the restful_authentication plugin.' 9 | Rake::TestTask.new(:test) do |t| 10 | t.libs << 'lib' 11 | t.pattern = 'test/**/*_test.rb' 12 | t.verbose = true 13 | end 14 | 15 | desc 'Generate documentation for the restful_authentication plugin.' 16 | Rake::RDocTask.new(:rdoc) do |rdoc| 17 | rdoc.rdoc_dir = 'rdoc' 18 | rdoc.title = 'RestfulAuthentication' 19 | rdoc.options << '--line-numbers' << '--inline-source' 20 | rdoc.rdoc_files.include('README') 21 | rdoc.rdoc_files.include('lib/**/*.rb') 22 | end 23 | -------------------------------------------------------------------------------- /app/models/service_type.rb: -------------------------------------------------------------------------------- 1 | class ServiceType 2 | attr_reader :id, :name, :description 3 | 4 | def initialize(id, name, description) 5 | @id, @name, @description = id, name, description 6 | end 7 | 8 | TYPES = [ 9 | ServiceType.new('MEMBERSHIP', "Membership", "Membership for this shop."), 10 | ServiceType.new('EAB', "Earn a Bike/Digging Rights", "One of everything you can find in the shop to build or fix one bike."), 11 | ServiceType.new('CLASS', "Class", "Membership for this shop.") 12 | ] 13 | 14 | def self.[](id) 15 | TYPES.select{|type| type.id == id.to_s.upcase }.first 16 | end 17 | 18 | def self.find_all 19 | TYPES 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/spec/javascripts/fixtures/blue_ridge_command_line.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blue Ridge Command-Line Test Runner | JavaScript Testing Results 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/models/role.rb: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: roles 4 | # 5 | # id :integer(4) not null, primary key 6 | # name :string(40) 7 | # authorizable_type :string(40) 8 | # authorizable_id :integer(4) 9 | # created_at :datetime 10 | # updated_at :datetime 11 | # 12 | 13 | # Defines named roles for users that may be applied to 14 | # objects in a polymorphic fashion. For example, you could create a role 15 | # "moderator" for an instance of a model (i.e., an object), a model class, 16 | # or without any specification at all. 17 | class Role < ActiveRecord::Base 18 | has_and_belongs_to_many :users 19 | belongs_to :authorizable, :polymorphic => true 20 | end 21 | -------------------------------------------------------------------------------- /app/helpers/people_helper.rb: -------------------------------------------------------------------------------- 1 | module PeopleHelper 2 | 3 | # See vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb 4 | def auto_complete_result_with_add_person(entries, field, phrase = nil) 5 | return unless entries 6 | items = entries.map do |entry| 7 | content_tag("li", phrase ? highlight(entry[field], phrase) : h(entry[field]), 8 | :class => 'person', 9 | :url => person_path(:organization_key => @organization.key, :id => entry.id)) 10 | end 11 | items << content_tag("li", content_tag("b", 'Add Person'), 12 | :class => 'add', 13 | :url => new_person_path(:organization_key => @organization.key)) 14 | content_tag("ul", items.uniq.join('')) 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /test/functional/tags_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TagsControllerTest < ActionController::TestCase 4 | context "Tag" do 5 | setup do 6 | login_as 'greeter' 7 | 8 | people(:mary).save! 9 | end 10 | 11 | context "show" do 12 | setup do 13 | get :show, :organization_key => 'sfbk', :id => tags(:mom).id 14 | end 15 | 16 | should respond_with :success 17 | should render_template :show 18 | should assign_to :tag 19 | should assign_to :people 20 | 21 | should 'find matching people' do 22 | assert_equal 1, assigns(:people).size 23 | assert_equal people(:mary), assigns(:people).first 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /db/migrate/002_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def self.up 3 | create_table "users", :force => true do |t| 4 | t.string :login, :nil => false 5 | t.string :email, :nil => false 6 | t.string :name 7 | t.string :crypted_password, :limit => 40 8 | t.string :salt, :limit => 40 9 | t.string :remember_token 10 | t.datetime :remember_token_expires_at 11 | t.string :activation_code, :limit => 40 12 | t.datetime :activated_at 13 | t.string :reset_code, :limit => 40 14 | 15 | t.timestamps 16 | end 17 | end 18 | 19 | def self.down 20 | drop_table "users" 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/views/users/index.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | 3 | %h1 Listing users 4 | %table 5 | %tr 6 | %th Name 7 | %th Email 8 | %th Login 9 | %th Activated at 10 | %th Created at 11 | -for user in @users 12 | %tr{:class => cycle('odd','even')} 13 | %td= user.name 14 | %td= user.email 15 | %td= user.login 16 | %td= user.activated_at.nil? ? 'Not yet activated' : datetime_short(user.activated_at) 17 | %td= datetime_short(user.created_at) 18 | %td= link_to 'Show', user 19 | %td= link_to 'Edit', edit_user_path(user) 20 | %td= link_to 'Remove', user, :confirm => 'Are you sure?', :method => :delete 21 | %br 22 | =link_to 'New user', new_user_path 23 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem "rails", "2.3.17" 4 | gem "mysql" 5 | gem "tzinfo", "~> 0.3.61" # See https://github.com/asalant/freehub/pull/56 6 | gem 'authorization', git: "https://github.com/asalant/rails-authorization-plugin" 7 | gem 'json', '1.7.7' # (CVE-2013-026) Can remove once rails depends on > 1.7.6 8 | gem 'haml', "3.0.25" 9 | gem 'googlecharts', "1.6.0" 10 | gem 'calendar_date_select', "1.16.1" 11 | gem "acts-as-taggable-on", "2.0.6" 12 | gem "newrelic_rpm" 13 | gem 'hoptoad_notifier' 14 | gem 'validates_email_format_of' 15 | gem 'rdoc' 16 | 17 | group :development, :test do 18 | gem 'annotate' 19 | gem 'test-unit' 20 | gem 'thoughtbot-shoulda' 21 | end 22 | 23 | group :production do 24 | gem 'unicorn' 25 | end 26 | -------------------------------------------------------------------------------- /flexbox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Some Web Page 7 | 8 | 9 | 10 |
    11 |
    12 |
    A
    13 |
    14 |
    15 |
    B
    16 |
    17 |
    18 |
    C
    19 |
    20 |
    21 |
    D
    22 |
    23 |
    24 | 25 | 26 | -------------------------------------------------------------------------------- /flexbox.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | .flex-container { 8 | background-color: lightgray; 9 | padding: 10px; 10 | max-width: 955px; 11 | display: flex; 12 | justify-content: flex-start; 13 | flex-wrap: wrap; 14 | } 15 | 16 | .item { 17 | background-color: white; 18 | height: 100px; 19 | margin: 5px; 20 | padding: 20px; 21 | font-size: 30px; 22 | border-radius: 4px; 23 | text-align: center; 24 | } 25 | 26 | .flex-column { 27 | width: 50%; 28 | min-width: 380px; 29 | } 30 | 31 | @media (max-width: 400px) { 32 | .flex-column { 33 | width: 100%; 34 | min-width: inherit; 35 | } 36 | } 37 | 38 | .flex-fullwidth { 39 | width: 100%; 40 | } 41 | 42 | .A { 43 | height: 200px; 44 | } 45 | -------------------------------------------------------------------------------- /config/initializers/utf8_params.rb: -------------------------------------------------------------------------------- 1 | raise "Check if this is still needed on #{Rails.version} (it is not in Rails 3.x)" unless Rails.version == '2.3.17' 2 | 3 | class ActionController::Base 4 | 5 | def force_utf8_params 6 | traverse = lambda do |object, block| 7 | if object.kind_of?(Hash) 8 | object.each_value { |o| traverse.call(o, block) } 9 | elsif object.kind_of?(Array) 10 | object.each { |o| traverse.call(o, block) } 11 | else 12 | block.call(object) 13 | end 14 | object 15 | end 16 | force_encoding = lambda do |o| 17 | o.force_encoding(Encoding::UTF_8) if o.respond_to?(:force_encoding) 18 | end 19 | traverse.call(params, force_encoding) 20 | end 21 | before_filter :force_utf8_params 22 | 23 | end 24 | -------------------------------------------------------------------------------- /test/fixtures/organizations.yml: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: organizations 4 | # 5 | # id :integer(4) not null, primary key 6 | # name :string(255) 7 | # key :string(255) 8 | # timezone :string(255) 9 | # created_at :datetime 10 | # updated_at :datetime 11 | # location :string(255) 12 | # 13 | 14 | sfbk: 15 | name: San Francisco Bike Kitchen 16 | key: sfbk 17 | timezone: Pacific Time (US & Canada) 18 | location: San Francisco, CA 19 | 20 | scbc: 21 | name: Santa Cruz Bike Church 22 | key: scbc 23 | timezone: Pacific Time (US & Canada) 24 | location: Santa Cruz, CA 25 | 26 | cbi: 27 | name: Campus Bike Initiative 28 | key: cbi 29 | timezone: Eastern Time (US & Canada) 30 | location: Calgary, Alberta, Canada 31 | 32 | -------------------------------------------------------------------------------- /app/views/organizations/_form.html.haml: -------------------------------------------------------------------------------- 1 | =labeled_input 'Organization Name', :for => :name do 2 | -capture do 3 | %div= form.text_field(:name) 4 | %p.instruct For example 'San Francisco Bike Kitchen' 5 | =labeled_input 'Key', :for => :key do 6 | -capture do 7 | %div= form.text_field(:key, :autocapitalize => 'none') 8 | %p.instruct For example 'sfbk', used for URL http://freehub.bikekitchen.org/sfbk 9 | =labeled_input 'Location', :for => :location do 10 | -capture do 11 | %div= form.text_field(:location) 12 | %p.instruct For example 'San Francisco, CA' 13 | =labeled_input 'Timezone', :for => :timezone do 14 | -capture do 15 | =form.time_zone_select :timezone, ActiveSupport::TimeZone.us_zones, {:default => "Pacific Time (US & Canada)"}, :class => 'medium css_select' 16 | -------------------------------------------------------------------------------- /vendor/plugins/auto_complete/README: -------------------------------------------------------------------------------- 1 | Example: 2 | 3 | # Controller 4 | class BlogController < ApplicationController 5 | auto_complete_for :post, :title 6 | end 7 | 8 | # View 9 | <%= text_field_with_auto_complete :post, title %> 10 | 11 | By default, auto_complete_for limits the results to 10 entries, 12 | and sorts by the given field. 13 | 14 | auto_complete_for takes a third parameter, an options hash to 15 | the find method used to search for the records: 16 | 17 | auto_complete_for :post, :title, :limit => 15, :order => 'created_at DESC' 18 | 19 | For more examples, see script.aculo.us: 20 | * http://script.aculo.us/demos/ajax/autocompleter 21 | * http://script.aculo.us/demos/ajax/autocompleter_customized 22 | 23 | Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license 24 | -------------------------------------------------------------------------------- /app/views/notes/index.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | 3 | %h1 4 | =link_to @person.full_name, person_path(:id => @person) 5 | = ": Notes" 6 | 7 | =link_to 'New note', new_note_path 8 | 9 | %table 10 | %tr 11 | %th Notable 12 | %th Text 13 | %th Created at 14 | %th Created by 15 | %th{:colspan => 3} 16 | -for note in @notes 17 | %tr{:class => cycle('odd','even')} 18 | %td= notable_link(note.notable) 19 | %td.note= note_text(note) 20 | %td= datetime_long(note.created_at) 21 | %td= user_link(note.created_by) 22 | %td= link_to 'Show', note_path(:id => note) 23 | %td= link_to 'Edit', edit_note_path(:id => note) 24 | %td= link_to 'Remove', note_path(:id => note), :confirm => 'Are you sure?', :method => :delete 25 | -------------------------------------------------------------------------------- /app/views/visits/_person_search.html.haml: -------------------------------------------------------------------------------- 1 | %div.section#sign_in 2 | %h2 Sign a Person In 3 | %div.form 4 | %label.desc{:style => 'float:left;'} Name 5 | =image_tag 'spinner.gif', :id => 'search_status', :style => 'display:none;' 6 | =text_field_with_auto_complete :person, :full_name, { :onfocus => "this.select()", :autocomplete => 'off' }, { :url => auto_complete_for_person_full_name_people_path(:organization_key => @organization.key), :method => :get, :min_chars => 2, :indicator => 'search_status', :after_update_element => "function(element, value) { window.location = $(value).readAttribute('url'); }" } 7 | %p 8 | Start typing to find a person or 9 | = "#{link_to "add a new person", new_person_path(:organization_key => @organization.key)}." 10 | :javascript 11 | $('person_full_name').focus(); 12 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | # Settings specified here will take precedence over those in config/environment.rb 2 | 3 | # In the development environment your application's code is reloaded on 4 | # every request. This slows down response time but is perfect for development 5 | # since you don't have to restart the webserver when you make code changes. 6 | config.cache_classes = false 7 | 8 | # Log error messages when you accidentally call methods on nil. 9 | config.whiny_nils = true 10 | 11 | # Show full error reports and disable caching 12 | config.action_controller.consider_all_requests_local = true 13 | config.action_view.debug_rjs = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send 17 | config.action_mailer.raise_delivery_errors = false -------------------------------------------------------------------------------- /app/views/organizations/new.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | %h1 Register 3 | %p Sign up for a new Freehub account. 4 | %p 5 | After you submit this form you will be able to start using Freehub while your account is pending activation. 6 | You will receive an email shortly with a link to permanently activate your account. 7 | -form_for @organization do |f| 8 | %div.section.organization 9 | %h2 Organization settings 10 | =error_messages_for :organization 11 | %ul 12 | = render :partial => 'organizations/form', :object => f 13 | %div.section.user 14 | %h2 Manager account settings 15 | =error_messages_for :user 16 | %ul 17 | -fields_for :user do |user| 18 | = render :partial => 'users/form', :object => user 19 | %li 20 | = f.submit 'Sign Up' 21 | -------------------------------------------------------------------------------- /public/stylesheets/reset-min.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 2.3.1 6 | */ 7 | body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;} -------------------------------------------------------------------------------- /db/migrate/007_create_notes.rb: -------------------------------------------------------------------------------- 1 | class CreateNotes < ActiveRecord::Migration 2 | def self.up 3 | create_table :notes do |t| 4 | t.text :text 5 | t.references :notable, :polymorphic => true, :nil => false 6 | 7 | t.references :created_by, :updated_by 8 | t.timestamps 9 | end 10 | 11 | add_index :notes, [ :notable_type, :notable_id ] 12 | 13 | execute "ALTER TABLE notes ADD CONSTRAINT fk_notes_created_by FOREIGN KEY (created_by_id) REFERENCES users(id)" 14 | execute "ALTER TABLE notes ADD CONSTRAINT fk_notes_updated_by FOREIGN KEY (updated_by_id) REFERENCES users(id)" 15 | end 16 | 17 | def self.down 18 | execute "ALTER TABLE notes DROP FOREIGN KEY fk_notes_created_by" 19 | execute "ALTER TABLE notes DROP FOREIGN KEY fk_notes_updated_by" 20 | 21 | drop_table :notes 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /test/unit/user_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | require 'user_mailer' 3 | 4 | class UserMailerTest < Test::Unit::TestCase 5 | FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures' 6 | CHARSET = "utf-8" 7 | 8 | include ActionMailer::Quoting 9 | 10 | def setup 11 | ActionMailer::Base.delivery_method = :test 12 | ActionMailer::Base.perform_deliveries = true 13 | ActionMailer::Base.deliveries = [] 14 | 15 | @expected = TMail::Mail.new 16 | @expected.set_content_type "text", "plain", { "charset" => CHARSET } 17 | end 18 | 19 | def test_dummy_test 20 | #do nothing 21 | end 22 | 23 | private 24 | def read_fixture(action) 25 | IO.readlines("#{FIXTURES_PATH}/user_mailer/#{action}") 26 | end 27 | 28 | def encode(subject) 29 | quoted_printable(subject, CHARSET) 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/screw.mocking.js: -------------------------------------------------------------------------------- 1 | // This is a lightweight bridge between Smoke and Screw.Unit. 2 | // It shadows mocking and stubbing onto the matchers to make them available within tests. 3 | 4 | Screw.Matchers.mock = function(m) { 5 | return Smoke.Mock(m); 6 | }; 7 | 8 | Screw.Matchers.mock_function = function(func,name) { 9 | return Smoke.MockFunction(func,name); 10 | }; 11 | 12 | Screw.Matchers.stub = function(obj, attr) { 13 | return new Smoke.Stub(obj,attr); 14 | }; 15 | 16 | (function($) { 17 | $(Screw).bind("before", function(){ 18 | function checkAndResetSmoke() { 19 | Smoke.checkExpectations(); 20 | Smoke.reset(); 21 | } 22 | 23 | $('.it').bind('passed', function(){ checkAndResetSmoke() }); 24 | $('.it').bind('failed', function(){ checkAndResetSmoke() }); 25 | }); 26 | })(jQuery); 27 | -------------------------------------------------------------------------------- /app/controllers/taggings_controller.rb: -------------------------------------------------------------------------------- 1 | class TaggingsController < ApplicationController 2 | permit "admin or (manager of :organization)" 3 | 4 | def create 5 | @person.tag_list << params[:id] 6 | @person.save! 7 | if request.xhr? 8 | @person.taggings.reload 9 | index 10 | else 11 | redirect_to_person_path 12 | end 13 | end 14 | 15 | def destroy 16 | tagging = Tagging.find params[:id] 17 | @person.taggings.delete tagging 18 | if request.xhr? 19 | index 20 | else 21 | redirect_to_person_path 22 | end 23 | end 24 | 25 | def index 26 | render :partial => '/taggings/index', :locals => { :person => @person } 27 | end 28 | 29 | private 30 | 31 | def redirect_to_person_path 32 | redirect_to person_path(:organization_key => @organization.key, :id => @person) 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | RDoc Documentation 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/helpers/notes_helper.rb: -------------------------------------------------------------------------------- 1 | module NotesHelper 2 | 3 | def note_text(note) 4 | h(note.text).gsub(/\n/,'
    ') if note 5 | end 6 | 7 | def notable_link(model) 8 | if model.is_a? Visit 9 | link_to notable_label(model), visit_path(:person_id => @person, :id => model) 10 | elsif model.is_a? Person 11 | link_to notable_label(model), person_path(:id => model) 12 | elsif model.is_a? Service 13 | link_to notable_label(model), service_path(:person_id => @person, :id => model) 14 | end 15 | end 16 | 17 | def notable_label(model) 18 | if model.is_a? Visit 19 | "Visit on #{date_long(model.arrived_at)}" 20 | elsif model.is_a? Person 21 | "Person named #{model.full_name}" 22 | elsif model.is_a? Service 23 | "#{ServiceType[model.service_type_id].name} ending #{date_long(model.end_date)}" 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying cookie session data integrity. 4 | # If you change this key, all old sessions will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | ActionController::Base.session = { 8 | :key => '_freehub_for_all_session', 9 | :secret => '0997aa534656a97a788eb5ade4d382bbbeef876589d38649644a34c8c826c690ce7e218163569bb149b5d36772bafeb7f51aedd37201e6e96455fd6139737dbd' 10 | } 11 | 12 | # Use the database for sessions instead of the cookie-based default, 13 | # which shouldn't be used to store highly confidential information 14 | # (create the session table with "rake db:sessions:create") 15 | # ActionController::Base.session_store = :active_record_store 16 | -------------------------------------------------------------------------------- /config/environments/staging.rb: -------------------------------------------------------------------------------- 1 | # Settings specified here will take precedence over those in config/environment.rb 2 | 3 | # The production environment is meant for finished, "live" apps. 4 | # Code is not reloaded between requests 5 | config.cache_classes = true 6 | 7 | # Use a different logger for distributed setups 8 | # config.logger = SyslogLogger.new 9 | 10 | # Full error reports are disabled and caching is turned on 11 | config.action_controller.consider_all_requests_local = false 12 | config.action_controller.perform_caching = true 13 | config.action_view.cache_template_loading = true 14 | 15 | # Enable serving of images, stylesheets, and javascripts from an asset server 16 | # config.action_controller.asset_host = "http://assets.example.com" 17 | 18 | config.action_mailer.delivery_method = :sendmail 19 | 20 | SITE_URL = 'http://freehub-staging.bikekitchen.org' -------------------------------------------------------------------------------- /db/migrate/20100611221211_acts_as_taggable_on_migration.rb: -------------------------------------------------------------------------------- 1 | class ActsAsTaggableOnMigration < ActiveRecord::Migration 2 | def self.up 3 | create_table :tags do |t| 4 | t.column :name, :string 5 | end 6 | 7 | create_table :taggings do |t| 8 | t.column :tag_id, :integer 9 | t.column :taggable_id, :integer 10 | t.column :tagger_id, :integer 11 | t.column :tagger_type, :string 12 | 13 | # You should make sure that the column created is 14 | # long enough to store the required class names. 15 | t.column :taggable_type, :string 16 | t.column :context, :string 17 | 18 | t.column :created_at, :datetime 19 | end 20 | 21 | add_index :taggings, :tag_id 22 | add_index :taggings, [:taggable_id, :taggable_type, :context] 23 | end 24 | 25 | def self.down 26 | drop_table :taggings 27 | drop_table :tags 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/jquery.fn.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $.fn.fn = function() { 3 | var self = this; 4 | var extension = arguments[0], name = arguments[0]; 5 | if (typeof name == "string") { 6 | return apply(self, name, $.makeArray(arguments).slice(1, arguments.length)); 7 | } else { 8 | $.each(extension, function(key, value) { 9 | define(self, key, value); 10 | }); 11 | return self; 12 | } 13 | } 14 | function define(self, name, fn) { 15 | self.data(namespacedName(name), fn); 16 | }; 17 | function apply(self, name, args) { 18 | var result; 19 | self.each(function(i, item) { 20 | var fn = $(item).data(namespacedName(name)); 21 | if (fn) result = fn.apply(item, args) 22 | else throw(name + " is not defined"); 23 | }); 24 | return result; 25 | }; 26 | function namespacedName(name) { 27 | return 'fn.' + name; 28 | } 29 | })(jQuery); -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000001.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | setup (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 23
    14 |   def setup
    15 |     User.current_user = @first_user
    16 |   end
    17 | 18 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | require '<%= file_name %>_mailer' 3 | 4 | class <%= class_name %>MailerTest < Test::Unit::TestCase 5 | FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures' 6 | CHARSET = "utf-8" 7 | 8 | include ActionMailer::Quoting 9 | 10 | def setup 11 | ActionMailer::Base.delivery_method = :test 12 | ActionMailer::Base.perform_deliveries = true 13 | ActionMailer::Base.deliveries = [] 14 | 15 | @expected = TMail::Mail.new 16 | @expected.set_content_type "text", "plain", { "charset" => CHARSET } 17 | end 18 | 19 | def test_dummy_test 20 | #do nothing 21 | end 22 | 23 | private 24 | def read_fixture(action) 25 | IO.readlines("#{FIXTURES_PATH}/<%= file_name %>_mailer/#{action}") 26 | end 27 | 28 | def encode(subject) 29 | quoted_printable(subject, CHARSET) 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /config/initializers/new_rails_defaults.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # These settings change the behavior of Rails 2 apps and will be defaults 4 | # for Rails 3. You can remove this initializer when Rails 3 is released. 5 | 6 | if defined?(ActiveRecord) 7 | # Include Active Record class name as root for JSON serialized output. 8 | ActiveRecord::Base.include_root_in_json = true 9 | 10 | # Store the full class name (including module namespace) in STI type column. 11 | ActiveRecord::Base.store_full_sti_class = true 12 | end 13 | 14 | ActionController::Routing.generate_best_match = false 15 | 16 | # Use ISO 8601 format for JSON serialized times and dates. 17 | ActiveSupport.use_standard_json_time_format = true 18 | 19 | # Don't escape HTML entities in JSON, leave that for the #json_escape helper. 20 | # if you're including raw json in an HTML page. 21 | ActiveSupport.escape_html_entities_in_json = false -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | # Settings specified here will take precedence over those in config/environment.rb 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | config.cache_classes = true 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.action_controller.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Tell ActionMailer not to deliver emails to the real world. 17 | # The :test delivery method accumulates sent emails in the 18 | # ActionMailer::Base.deliveries array. 19 | config.action_mailer.delivery_method = :test -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/mailer.rb: -------------------------------------------------------------------------------- 1 | class <%= class_name %>Mailer < ActionMailer::Base 2 | def signup_notification(<%= file_name %>) 3 | setup_email(<%= file_name %>) 4 | @subject += 'Please activate your new account' 5 | <% if options[:include_activation] %> 6 | @body[:url] = "http://YOURSITE/activate/#{<%= file_name %>.activation_code}" 7 | <% else %> 8 | @body[:url] = "http://YOURSITE/login/" <% end %> 9 | end 10 | 11 | def activation(<%= file_name %>) 12 | setup_email(<%= file_name %>) 13 | @subject += 'Your account has been activated!' 14 | @body[:url] = "http://YOURSITE/" 15 | end 16 | 17 | protected 18 | def setup_email(<%= file_name %>) 19 | @recipients = "#{<%= file_name %>.email}" 20 | @from = "ADMINEMAIL" 21 | @subject = "[YOURSITE] " 22 | @sent_on = Time.now 23 | @body[:<%= file_name %>] = <%= file_name %> 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/fixtures.yml: -------------------------------------------------------------------------------- 1 | quentin: 2 | id: 1 3 | login: quentin 4 | email: quentin@example.com 5 | salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd 6 | crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test 7 | created_at: <%%= 5.days.ago.to_s :db %> 8 | <% if options[:include_activation] %> activation_code: 8f24789ae988411ccf33ab0c30fe9106fab32e9b <% end %> 9 | <% if options[:include_activation] %> activated_at: <%%= 5.days.ago.to_s :db %> <% end %> 10 | <% if options[:stateful] %> state: active<% end %> 11 | aaron: 12 | id: 2 13 | login: aaron 14 | email: aaron@example.com 15 | salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd 16 | crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test 17 | created_at: <%%= 1.days.ago.to_s :db %> 18 | <% if options[:include_activation] %> activation_code: 8f24789ae988411ccf33ab0c30fe9106fab32e9a <% end %> 19 | <% if options[:stateful] %> state: pending<% end %> 20 | -------------------------------------------------------------------------------- /test/fixtures/visits.yml: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: visits 4 | # 5 | # id :integer(4) not null, primary key 6 | # arrived_at :datetime 7 | # volunteer :boolean(1) default(FALSE) 8 | # created_at :datetime 9 | # updated_at :datetime 10 | # created_by_id :integer(4) 11 | # updated_by_id :integer(4) 12 | # person_id :integer(4) 13 | # staff :boolean(1) 14 | # member :boolean(1) 15 | # 16 | 17 | mary_1: 18 | arrived_at: <%= DateTime.parse('2007-02-01 18:01:00 PST') %> 19 | volunteer: false 20 | staff: false 21 | member: true 22 | person: mary 23 | 24 | mary_2: 25 | arrived_at: <%= DateTime.parse('2007-02-02 18:02:00 PST') %> 26 | volunteer: true 27 | staff: false 28 | member: true 29 | person: mary 30 | 31 | <% (1..100).each do |count| %> 32 | daryl_<%= count %>: 33 | arrived_at: <%= DateTime.parse('2007-02-02 18:02:00 PST').advance(:hours => count * -16) %> 34 | person: daryl 35 | <% end %> 36 | 37 | 38 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/format_italian.js: -------------------------------------------------------------------------------- 1 | // Italian Format: 31/12/2000 23:00 2 | // Thanks, Bigonazzi! 3 | 4 | Date.prototype.toFormattedString = function(include_time){ 5 | str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); 6 | if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } 7 | return str; 8 | } 9 | 10 | Date.parseFormattedString = function (string) { 11 | var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; 12 | var d = string.match(new RegExp(regexp, "i")); 13 | if (d==null) return Date.parse(string); // at least give javascript a crack at it. 14 | var offset = 0; 15 | var date = new Date(d[5], 0, 1); 16 | if (d[3]) { date.setMonth(d[3] - 1); } 17 | if (d[5]) { date.setDate(d[1]); } 18 | if (d[7]) { 19 | date.setHours(parseInt(d[7], 10)); 20 | } 21 | if (d[8]) { date.setMinutes(d[8]); } 22 | if (d[10]) { date.setSeconds(d[10]); } 23 | return date; 24 | } 25 | -------------------------------------------------------------------------------- /app/models/user_mailer.rb: -------------------------------------------------------------------------------- 1 | class UserMailer < ActionMailer::Base 2 | def signup_notification(user) 3 | setup_email(user) 4 | @subject += 'Please activate your new account' 5 | 6 | @body[:url] = "#{SITE_URL}/activate/#{user.activation_code}" 7 | 8 | end 9 | 10 | def activation(user) 11 | setup_email(user) 12 | @subject += 'Your account has been activated!' 13 | @body[:url] = "#{SITE_URL}" 14 | end 15 | 16 | def forgot_password(user) 17 | setup_email(user) 18 | @subject += 'Password reset request' 19 | @body[:url] = "#{SITE_URL}/reset/#{user.reset_code}" 20 | end 21 | 22 | def reset_password(user) 23 | setup_email(user) 24 | @subject += 'Your password has been reset' 25 | end 26 | 27 | protected 28 | def setup_email(user) 29 | @recipients = "#{user.email}" 30 | @from = "freehub@bikekitchen.org" 31 | @subject = "Freehub: " 32 | @sent_on = Time.zone.now 33 | @body[:user] = user 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /app/views/visits/index.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | %h1 3 | =link_to @person.full_name, person_path(:id => @person) 4 | = " : Visits" 5 | 6 | =link_to 'New visit', new_visit_path 7 | 8 | %table 9 | %tr 10 | %th When 11 | %th Datetime 12 | %th Volunteer 13 | %th Note 14 | %th{:colspan => 3} 15 | -for visit in @visits 16 | %tr{:class => cycle('odd','even')} 17 | %td #{time_ago_in_words(visit.arrived_at)} ago 18 | %td= datetime_long(visit.arrived_at) 19 | %td= visit.volunteer? 20 | %td.note{:style => 'width:360px;'}= note_text(visit.note) 21 | %td= link_to 'Show', visit_path(:id => visit) 22 | %td= link_to 'Edit', edit_visit_path(:id => visit) 23 | %td= link_to 'Remove', visit_path(:id => visit), :confirm => 'Are you sure?', :method => :delete 24 | -if @visits.next_page? || @visits.previous_page? 25 | %tr.list_controls 26 | %td{:colspan => 7} 27 | %div.paginating_links More: #{paginating_links(@visits)} 28 | -------------------------------------------------------------------------------- /db/migrate/004_create_visits.rb: -------------------------------------------------------------------------------- 1 | class CreateVisits < ActiveRecord::Migration 2 | def self.up 3 | create_table :visits do |t| 4 | t.datetime :datetime, :nil => false 5 | t.boolean :volunteer, :nil => false, :default => false 6 | 7 | t.timestamps 8 | t.references :created_by, :updated_by 9 | t.references :person, :nil => false 10 | end 11 | 12 | execute "ALTER TABLE visits ADD CONSTRAINT fk_visits_created_by FOREIGN KEY (created_by_id) REFERENCES users(id)" 13 | execute "ALTER TABLE visits ADD CONSTRAINT fk_visits_updated_by FOREIGN KEY (updated_by_id) REFERENCES users(id)" 14 | execute "ALTER TABLE visits ADD CONSTRAINT fk_visits_person FOREIGN KEY (person_id) REFERENCES people(id)" 15 | end 16 | 17 | def self.down 18 | execute "ALTER TABLE visits DROP FOREIGN KEY fk_visits_created_by" 19 | execute "ALTER TABLE visits DROP FOREIGN KEY fk_visits_updated_by" 20 | execute "ALTER TABLE visits DROP FOREIGN KEY fk_visits_person" 21 | 22 | drop_table :visits 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | The change you wanted was rejected (422) 9 | 21 | 22 | 23 | 24 | 25 |
    26 |

    The change you wanted was rejected.

    27 |

    Maybe you tried to change something you didn't have access to.

    28 |
    29 | 30 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/config/routes.rb: -------------------------------------------------------------------------------- 1 | ActionController::Routing::Routes.draw do |map| 2 | # The priority is based upon order of creation: first created -> highest priority. 3 | 4 | # Sample of regular route: 5 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' 6 | # Keep in mind you can assign values other than :controller and :action 7 | 8 | # Sample of named route: 9 | # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' 10 | # This route can be invoked with purchase_url(:id => product.id) 11 | 12 | # You can have the root of your site routed by hooking up '' 13 | # -- just remember to delete public/index.html. 14 | # map.connect '', :controller => "welcome" 15 | 16 | # Allow downloading Web Service WSDL as a file with an extension 17 | # instead of a file named 'wsdl' 18 | map.connect ':controller/service.wsdl', :action => 'wsdl' 19 | 20 | # Install the default route as the lowest priority. 21 | map.connect ':controller/:action/:id' 22 | end 23 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/ActiveRecord/Base.src/M000016.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | relates_to_user_in (ActiveRecord::Base) 9 | 10 | 11 | 12 | 13 |
    # File lib/userstamp.rb, line 60
    14 |     def self.relates_to_user_in(model)
    15 |       self.user_model_name = model
    16 |     end
    17 | 18 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | The page you were looking for doesn't exist (404) 9 | 21 | 22 | 23 | 24 | 25 |
    26 |

    The page you were looking for doesn't exist.

    27 |

    You may have mistyped the address or the page may have moved.

    28 |
    29 | 30 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | We're sorry, but something went wrong (500) 9 | 21 | 22 | 23 | 24 | 25 |
    26 |

    We're sorry, but something went wrong.

    27 |

    We've been notified about this issue and we'll take a look at it shortly.

    28 |
    29 | 30 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/ActiveRecord/Base.src/M000015.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | relates_to_user_in (ActiveRecord::Base) 9 | 10 | 11 | 12 | 13 |
    # File lib/userstamp.rb, line 60
    14 |     def self.relates_to_user_in(model)
    15 |       self.user_model_name = model
    16 |     end
    17 | 18 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | # Settings specified here will take precedence over those in config/environment.rb 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | config.cache_classes = true 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.action_controller.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Disable request forgery protection in test environment 17 | config.action_controller.allow_forgery_protection = false 18 | 19 | # Tell ActionMailer not to deliver emails to the real world. 20 | # The :test delivery method accumulates sent emails in the 21 | # ActionMailer::Base.deliveries array. 22 | config.action_mailer.delivery_method = :test 23 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000002.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | teardown (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 27
    14 |   def teardown
    15 |     User.current_user = nil
    16 |     Entry.user_model_name = :user
    17 |   end
    18 | 19 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/lib/shell.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | this.__defineGetter__("exit", function(){ java.lang.System.exit(0) }); 3 | this.__defineGetter__("quit", function(){ java.lang.System.exit(0) }); 4 | 5 | print("================================================="); 6 | print(" Rhino JavaScript Shell"); 7 | print(" To exit type 'exit', 'quit', or 'quit()'."); 8 | print("================================================="); 9 | 10 | var plugin_prefix = environment["blue.ridge.prefix"] || "vendor/plugins/blue-ridge"; 11 | var fixture_file = plugin_prefix + "/generators/blue_ridge/templates/application.html"; 12 | 13 | load(plugin_prefix + "/vendor/env.rhino.js"); 14 | print(" - loaded env.js"); 15 | 16 | window.location = fixture_file; 17 | print(" - sample DOM loaded"); 18 | 19 | load(plugin_prefix + "/vendor/jquery-1.4.1.js"); 20 | print(" - jQuery-1.3.2 loaded"); 21 | 22 | load(plugin_prefix + "/vendor/jquery.print.js"); 23 | print(" - jQuery print lib loaded"); 24 | 25 | print("================================================="); 26 | })(); 27 | -------------------------------------------------------------------------------- /public/stylesheets/tags.css: -------------------------------------------------------------------------------- 1 | .tags_control { 2 | float: right; 3 | } 4 | 5 | @media (max-width: 800px) { 6 | .tags_control { 7 | float: inherit; 8 | } 9 | } 10 | 11 | .tags_control ul.tags li { 12 | float: left; 13 | font-size: 12px; 14 | padding: 3px 3px 2px 3px; 15 | margin-left: 3px; 16 | } 17 | 18 | .tags_control ul.tags li.form select { 19 | margin: 0; 20 | } 21 | 22 | .tags_control ul.tags li.form { 23 | padding-top: 2px; 24 | } 25 | 26 | .tags_control ul.tags li.tag { 27 | background-color: #EEE; 28 | } 29 | 30 | .tags_control .view { 31 | display:none; 32 | } 33 | 34 | .tags_control .edit { 35 | display:block; 36 | } 37 | 38 | .tags_control .spinner { 39 | display: none; 40 | } 41 | 42 | .tags_control.ajax_loading .spinner { 43 | display: block; 44 | } 45 | 46 | .person_name { 47 | font-size: 14px; 48 | } 49 | 50 | .person_type { 51 | font-size: 14px; 52 | font-weight: bold; 53 | } 54 | 55 | .last_visit { 56 | font-style: italic; 57 | } 58 | 59 | .current { 60 | color: green; 61 | } 62 | 63 | .expired { 64 | color: red; 65 | } 66 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Contributors 2 | ------------ 3 | * Justin Gehtland (jgehtland) 4 | - Original idea. 5 | 6 | * Geof Dagley (gdagley) 7 | - Put into a Rails plugin. 8 | 9 | * Larry Karnowski (karnowski) 10 | - Current maintainer. 11 | - Update to Screw.Unit from js-spec. 12 | 13 | * Chris Thatcher (thatcher) 14 | - For numerous env.js bug fixes! 15 | 16 | * Raimonds Simanovskis (rsim) 17 | - Lots of bug fixes. 18 | 19 | * Jason Rudolph (jasonrudolph) 20 | - Documentation and bug fixes. 21 | 22 | * Matt Wilson (hypomodern) 23 | - Although we didn't use his patch directly, his ideas were a *great* help in 24 | the "deeply-nested test directories" feature. Thanks! 25 | 26 | * Nick Stenning (nickstenning) 27 | - For reminding us to add descriptions to our Rake tasks! 28 | 29 | * Tristan Dunn (tristandunn) 30 | - For fixing the nested-describe command-line output. 31 | 32 | * Chris Redinger (redinger) 33 | - For pairing & refactoring on the nested-describe command-line fix. 34 | 35 | * Corey Haines (coreyhaines) 36 | - For colorizing output. -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/migration.rb: -------------------------------------------------------------------------------- 1 | class <%= migration_name %> < ActiveRecord::Migration 2 | def self.up 3 | create_table "<%= table_name %>", :force => true do |t| 4 | t.column :login, :string 5 | t.column :email, :string 6 | t.column :crypted_password, :string, :limit => 40 7 | t.column :salt, :string, :limit => 40 8 | t.column :created_at, :datetime 9 | t.column :updated_at, :datetime 10 | t.column :remember_token, :string 11 | t.column :remember_token_expires_at, :datetime 12 | <% if options[:include_activation] %>t.column :activation_code, :string, :limit => 40 13 | t.column :activated_at, :datetime<% end %> 14 | <% if options[:stateful] %>t.column :state, :string, :null => :no, :default => 'passive' 15 | t.column :deleted_at, :datetime<% end %> 16 | end 17 | end 18 | 19 | def self.down 20 | drop_table "<%= table_name %>" 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/fr_file_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 12 | 13 | 14 | Files 15 | 16 | 17 | 18 | 19 | 20 |
    21 |

    Files

    22 | 29 |
    30 | 31 | -------------------------------------------------------------------------------- /app/controllers/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | # This controller handles the login/logout function of the site. 2 | class SessionsController < ApplicationController 3 | 4 | skip_before_filter :login_from_cookie, :login_required 5 | 6 | # render new.rhtml 7 | def new 8 | end 9 | 10 | def create 11 | self.current_user = User.authenticate(params[:login], params[:password]) 12 | if logged_in? 13 | if params[:remember_me] == "1" 14 | self.current_user.remember_me 15 | cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } 16 | end 17 | redirect_back_or_default(user_home_path(self.current_user)) 18 | flash[:notice] = "Logged in successfully" 19 | else 20 | flash[:notice] = "Log in failed" 21 | render :action => 'new' 22 | end 23 | end 24 | 25 | def destroy 26 | self.current_user.forget_me if logged_in? 27 | cookies.delete :auth_token 28 | reset_session 29 | flash[:notice] = "You have been logged out." 30 | redirect_back_or_default('/') 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /public/maintenance.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Freehub Undergoing Maintenance 5 | 6 | 15 | 16 | 17 | 18 |
    19 |
    20 |

    Freehub is currently undergoing maintenance.

    21 |

    Please try again in a few minutes. If you believe something is wrong, please contact freehub@bikekitchen.org

    22 |
    23 |
    24 | Hosted by Engine Yard 25 |
    26 |
    27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/views/services/_form.html.haml: -------------------------------------------------------------------------------- 1 | %ul 2 | =labeled_input 'Service type', :for => :service_type_id do 3 | -capture do 4 | -@service_types = ServiceType.find_all.map {|type| [type.name, type.id] } 5 | =form.select(:service_type_id, @service_types) 6 | =labeled_input 'Start date', :for => :start_date do 7 | -capture do 8 | =calendar_date_select_tag "service[start_date]", @service[:start_date], :year_range => 5.years.ago..1.years.from_now 9 | =labeled_input 'End date', :for => :end_date do 10 | -capture do 11 | =calendar_date_select_tag "service[end_date]", @service[:end_date], :year_range => 4.years.ago..2.years.from_now 12 | %li 13 | =form.check_box(:paid, :class => 'checkbox') 14 | %label.choice{:for => 'service_paid'} Paid 15 | =form.check_box(:volunteered, :class => 'checkbox') 16 | %label.choice{:for => 'service_volunteered'} Volunteered 17 | -fields_for :note, @service.note do |note| 18 | =labeled_input 'Note', :for => :visit_note do 19 | -capture do 20 | =note.text_area :text, :rows => 6 21 | %li 22 | =form.submit @service.new_record? ? "Create" : "Update" -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/generators/javascript_spec/javascript_spec_generator.rb: -------------------------------------------------------------------------------- 1 | class JavascriptSpecGenerator < Rails::Generator::NamedBase 2 | def manifest 3 | file_path_with_spec, file_path_without_spec = file_path_with_and_without_spec 4 | 5 | record do |m| 6 | base_dir = BlueRidge.javascript_spec_dir 7 | 8 | m.directory base_dir 9 | m.directory "#{base_dir}/fixtures" 10 | 11 | options = {:class_name_without_spec => class_name_without_spec, :file_path_without_spec => file_path_without_spec} 12 | m.template 'javascript_spec.js.erb', "#{base_dir}/#{file_path_with_spec}.js", :assigns => options 13 | m.template 'fixture.html.erb', "#{base_dir}/fixtures/#{file_path_without_spec}.html", :assigns => options 14 | end 15 | end 16 | 17 | def file_path_with_and_without_spec 18 | if (file_path =~ /_spec$/i) 19 | [file_path, file_path.gsub(/_spec$/, "")] 20 | else 21 | [file_path + "_spec", file_path] 22 | end 23 | end 24 | 25 | def class_name_without_spec 26 | (class_name =~ /Spec$/) ? class_name.gsub(/Spec$/, "") : class_name 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /app/views/services/index.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | 3 | %h1 4 | =link_to @person.full_name, person_path(:id => @person) 5 | = " : Services" 6 | 7 | =link_to 'New service', new_service_path 8 | 9 | %table 10 | %tr 11 | %th Service type 12 | %th Start date 13 | %th End date 14 | %th Paid 15 | %th Volunteered 16 | %th Note 17 | %th{:colspan => 3} 18 | -for service in @services 19 | %tr{:class => cycle('odd','even')} 20 | %td= service.service_type.name 21 | %td= service.start_date 22 | %td= service.end_date 23 | %td= service.paid 24 | %td= service.volunteered 25 | %td.note= note_text(service.note) 26 | %td= link_to 'Show', service_path(:id => service) 27 | %td= link_to 'Edit', edit_service_path(:id => service) 28 | %td= link_to 'Remove', service_path(:id => service), :confirm => 'Are you sure?', :method => :delete 29 | -if @services.next_page? || @services.previous_page? 30 | %tr.list_controls 31 | %td{:colspan => 9} 32 | .paginating_links More: #{paginating_links(@services)} 33 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2009 Relevance, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/LICENSE-Smoke: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008 Andy Kent 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/lib/restful_authentication/rails_commands.rb: -------------------------------------------------------------------------------- 1 | Rails::Generator::Commands::Create.class_eval do 2 | def route_resource(*resources) 3 | resource_list = resources.map { |r| r.to_sym.inspect }.join(', ') 4 | sentinel = 'ActionController::Routing::Routes.draw do |map|' 5 | 6 | logger.route "map.resource #{resource_list}" 7 | unless options[:pretend] 8 | gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match| 9 | "#{match}\n map.resource #{resource_list}\n" 10 | end 11 | end 12 | end 13 | end 14 | 15 | Rails::Generator::Commands::Destroy.class_eval do 16 | def route_resource(*resources) 17 | resource_list = resources.map { |r| r.to_sym.inspect }.join(', ') 18 | look_for = "\n map.resource #{resource_list}\n" 19 | logger.route "map.resource #{resource_list}" 20 | gsub_file 'config/routes.rb', /(#{look_for})/mi, '' 21 | end 22 | end 23 | 24 | Rails::Generator::Commands::List.class_eval do 25 | def route_resource(*resources) 26 | resource_list = resources.map { |r| r.to_sym.inspect }.join(', ') 27 | logger.route "map.resource #{resource_list}" 28 | end 29 | end -------------------------------------------------------------------------------- /vendor/plugins/userstamp/test/fixtures/mysql.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 9.11 2 | -- 3 | -- Host: localhost Database: userstamp_test 4 | -- ------------------------------------------------------ 5 | -- Server version 4.0.24 6 | 7 | -- 8 | -- Table structure for table `entries` 9 | -- 10 | 11 | DROP TABLE IF EXISTS users; 12 | CREATE TABLE users ( 13 | id int(11) NOT NULL auto_increment, 14 | name varchar(255), 15 | PRIMARY KEY (id) 16 | ) TYPE=MyISAM; 17 | 18 | DROP TABLE IF EXISTS customers; 19 | CREATE TABLE customers ( 20 | id int(11) NOT NULL auto_increment, 21 | name varchar(255), 22 | PRIMARY KEY (id) 23 | ) TYPE=MyISAM; 24 | 25 | DROP TABLE IF EXISTS entries; 26 | CREATE TABLE entries ( 27 | id int(11) NOT NULL auto_increment, 28 | name varchar(255), 29 | created_by int(11) default 0, 30 | updated_by int(11) default 0, 31 | PRIMARY KEY (id) 32 | ) TYPE=MyISAM; 33 | 34 | DROP TABLE IF EXISTS posts; 35 | CREATE TABLE posts ( 36 | id int(11) NOT NULL auto_increment, 37 | name varchar(255), 38 | created_by int(11) default 0, 39 | updated_by int(11) default 0, 40 | PRIMARY KEY (id) 41 | ) TYPE=MyISAM; 42 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/LICENSE-Screw.Unit: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008 Nick Kallen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /db/migrate/006_create_services.rb: -------------------------------------------------------------------------------- 1 | class CreateServices < ActiveRecord::Migration 2 | def self.up 3 | create_table :services do |t| 4 | t.date :start_date 5 | t.date :end_date 6 | t.boolean :paid, :nil => false, :default => false 7 | t.boolean :volunteered, :nil => false, :default => false 8 | t.string :service_type_id, :nil => false 9 | t.references :person, :nil => false 10 | 11 | t.timestamps 12 | t.references :created_by, :updated_by 13 | end 14 | 15 | execute "ALTER TABLE services ADD CONSTRAINT fk_services_created_by FOREIGN KEY (created_by_id) REFERENCES users(id)" 16 | execute "ALTER TABLE services ADD CONSTRAINT fk_services_updated_by FOREIGN KEY (updated_by_id) REFERENCES users(id)" 17 | execute "ALTER TABLE services ADD CONSTRAINT fk_services_person FOREIGN KEY (person_id) REFERENCES people(id)" 18 | end 19 | 20 | def self.down 21 | execute "ALTER TABLE services DROP FOREIGN KEY fk_services_created_by" 22 | execute "ALTER TABLE services DROP FOREIGN KEY fk_services_updated_by" 23 | execute "ALTER TABLE services DROP FOREIGN KEY fk_services_person" 24 | 25 | drop_table :services 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ########### 2 | # FreeHub # 3 | ########### 4 | # Password is test for greeter, sfbk, mechanic, scbc, cbi, admin 5 | 6 | # Docker config details at 7 | # https://blog.codeship.com/running-rails-development-environment-docker/ 8 | FROM ruby:1.9.3 9 | MAINTAINER Alon Salant 10 | 11 | RUN apt-get update && apt-get install -y mysql-client 12 | 13 | # Configure the main working directory. This is the base 14 | # directory used in any further RUN, COPY, and ENTRYPOINT 15 | # commands. 16 | RUN mkdir -p /app 17 | WORKDIR /app 18 | 19 | # Copy the Gemfile as well as the Gemfile.lock and install 20 | # the RubyGems. This is a separate step so the dependencies 21 | # will be cached unless changes to one of those two files 22 | # are made. 23 | COPY Gemfile Gemfile.lock ./ 24 | RUN gem install bundler -v 1.15.4 25 | RUN bundle install --jobs 20 --retry 5 26 | 27 | # Copy the main application. 28 | COPY . ./ 29 | 30 | # Expose port 3000 to the Docker host, so we can access it 31 | # from the outside. 32 | EXPOSE 3000 33 | 34 | # The main command to run when the container starts. Also 35 | # tell the Rails dev server to bind to all interfaces by 36 | # default. 37 | CMD ["./script/server -b 0.0.0.0"] 38 | -------------------------------------------------------------------------------- /app/views/reports/index.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-fullwidth 2 | %h1 Listing reports 3 | 4 | %div.flex-column 5 | %div.section 6 | %h2 People 7 | %p 8 | The #{link_to 'People Report', report_path(:action => 'people', :organization_key => @organization.key)} 9 | lists all people, members and non members, and can be exported as CSV for use in a spreadsheet program. 10 | %div.section 11 | %h2 Services 12 | %p 13 | The #{link_to 'Services Report', report_path(:action => 'services', :organization_key => @organization.key)} 14 | lists services by type (Membership, Class, Digging Rights) in a date range and can be exported as CSV for use in a spreadsheet program. 15 | 16 | %div.flex-column 17 | %div.section 18 | %h2 Visits 19 | %p 20 | The #{link_to 'Visits Report', report_path(:action => 'visits', :organization_key => @organization.key)} 21 | lists visits in a date range and can be exported as CSV for use in a spreadsheet program. 22 | %div.section 23 | %h2 Summary 24 | %p 25 | The #{link_to 'Summary Report', report_path(:action => 'summary', :organization_key => @organization.key)} 26 | provides a high level view of who is visiting the shop when. 27 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/generators/authenticated/templates/controller.rb: -------------------------------------------------------------------------------- 1 | # This controller handles the login/logout function of the site. 2 | class <%= controller_class_name %>Controller < ApplicationController 3 | # Be sure to include AuthenticationSystem in Application Controller instead 4 | include AuthenticatedSystem 5 | 6 | # render new.rhtml 7 | def new 8 | end 9 | 10 | def create 11 | self.current_<%= file_name %> = <%= class_name %>.authenticate(params[:login], params[:password]) 12 | if logged_in? 13 | if params[:remember_me] == "1" 14 | self.current_<%= file_name %>.remember_me 15 | cookies[:auth_token] = { :value => self.current_<%= file_name %>.remember_token , :expires => self.current_<%= file_name %>.remember_token_expires_at } 16 | end 17 | redirect_back_or_default('/') 18 | flash[:notice] = "Logged in successfully" 19 | else 20 | render :action => 'new' 21 | end 22 | end 23 | 24 | def destroy 25 | self.current_<%= file_name %>.forget_me if logged_in? 26 | cookies.delete :auth_token 27 | reset_session 28 | flash[:notice] = "You have been logged out." 29 | redirect_back_or_default('/') 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /app/views/taggings/_index.html.haml: -------------------------------------------------------------------------------- 1 | .tags_control 2 | .view 3 | %ul.tags 4 | %li=image_tag 'tag_yellow.png' 5 | -for tag in person.tags.sort_by {|tag| tag.name.downcase } 6 | %li.tag 7 | =link_to tag, tag_path(:organization_key => @organization.key, :id => tag.id) 8 | %li 9 | %a{:href => '#', :class => 'show_edit'} Edit tags 10 | .edit 11 | %ul.tags 12 | %li=image_tag 'spinner.gif', :class => 'spinner' 13 | -for tagging in person.taggings.sort_by {|tagging| tagging.tag.name.downcase } 14 | %li.tag 15 | = tagging.tag.name 16 | =link_to 'x', tagging_path(:organization_key => @organization.key, :person_id => person, :id => tagging.id), :class => 'delete' 17 | %li.form 18 | -form_for :taggings, :url => taggings_path(:organization_key => @organization.key, :person_id => person) do |f| 19 | %select.css_select 20 | %option{:value => ''} Choose tag 21 | -for tag in @organization.tags - person.tags 22 | %option{:value => tag.name}= tag.name 23 | %option{:value => ''}= '------' 24 | %option{:value => ''} New tag 25 | %li 26 | %a{:href => '#', :class => 'show_view'} Done 27 | -------------------------------------------------------------------------------- /app/helpers/url_helper.rb: -------------------------------------------------------------------------------- 1 | module UrlHelper 2 | 3 | def organization_path(*args) 4 | if Organization === args[0] 5 | options = args.extract_options! 6 | organization_key_path(options.merge(:organization_key => args[0].key)) 7 | else 8 | super 9 | end 10 | end 11 | 12 | def organization_url(*args) 13 | if Organization === args[0] 14 | options = args.extract_options! 15 | organization_key_url(options.merge(:organization_key => args[0].key)) 16 | else 17 | super 18 | end 19 | end 20 | 21 | def edit_organization_path(*args) 22 | if Organization === args[0] 23 | options = args.extract_options! 24 | edit_organization_key_path(options.merge(:organization_key => args[0].key)) 25 | else 26 | super 27 | end 28 | end 29 | 30 | def user_home_path(user) 31 | if user.organization 32 | organization_path user.organization 33 | else 34 | user_path :id => user.id 35 | end 36 | end 37 | 38 | def day_visits_path(*args) 39 | if args[0].respond_to? :to_date 40 | super(:year => args[0].to_date.year, :month => args[0].to_date.month, :day => args[0].to_date.day) 41 | else 42 | super 43 | end 44 | end 45 | 46 | end 47 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/format_american.js: -------------------------------------------------------------------------------- 1 | // American Format: 12/31/2000 5:00 pm 2 | // Thanks, Wes Hays 3 | Date.prototype.toFormattedString = function(include_time){ 4 | str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); 5 | 6 | if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } 7 | return str; 8 | } 9 | 10 | Date.parseFormattedString = function (string) { 11 | // Test these with and without the time 12 | // 11/11/1111 12pm 13 | // 11/11/1111 1pm 14 | // 1/11/1111 10:10pm 15 | // 11/1/1111 01pm 16 | // 1/1/1111 01:11pm 17 | // 1/1/1111 1:11pm 18 | var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; 19 | var d = string.match(new RegExp(regexp, "i")); 20 | if (d==null) { 21 | return Date.parse(string); // Give javascript a chance to parse it. 22 | } 23 | 24 | mdy = d[1].split('/'); 25 | hrs = 0; 26 | mts = 0; 27 | if(d[3] != null) { 28 | hrs = parseInt(d[3].split('')[0], 10); 29 | if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs 30 | mts = d[4].split(':')[1]; 31 | } 32 | 33 | return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); 34 | } 35 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/format_finnish.js: -------------------------------------------------------------------------------- 1 | Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } 2 | Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } 3 | Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } 4 | 5 | Date.prototype.toFormattedString = function(include_time){ 6 | str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); 7 | if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } 8 | return str; 9 | } 10 | Date.parseFormattedString = function (string) { 11 | var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; 12 | var d = string.match(new RegExp(regexp, "i")); 13 | if (d==null) return Date.parse(string); // at least give javascript a crack at it. 14 | var offset = 0; 15 | var date = new Date(d[5], 0, 1); 16 | if (d[3]) { date.setMonth(d[3] - 1); } 17 | if (d[5]) { date.setDate(d[1]); } 18 | if (d[7]) { 19 | date.setHours(parseInt(d[7], 10)); 20 | } 21 | if (d[8]) { date.setMinutes(d[8]); } 22 | if (d[10]) { date.setSeconds(d[10]); } 23 | return date; 24 | } 25 | -------------------------------------------------------------------------------- /public/stylesheets/people.css: -------------------------------------------------------------------------------- 1 | #summary { 2 | text-align: right; 3 | font-size: 13px; 4 | padding: 10px; 5 | } 6 | 7 | @media (max-width: 800px) { 8 | #summary { 9 | text-align: inherit; 10 | } 11 | } 12 | 13 | #summary .person_type { 14 | font-size: 16px; 15 | font-weight: bold; 16 | } 17 | 18 | #summary .current { 19 | color: green; 20 | } 21 | 22 | #summary .expired { 23 | color: red; 24 | } 25 | 26 | .section h2 { 27 | float:left; 28 | } 29 | 30 | .section ul, .section .list_status { 31 | clear: both; 32 | } 33 | 34 | .section .add_link { 35 | float: left; 36 | padding-top: 2px; 37 | } 38 | 39 | #sign_in { 40 | width: 360px; 41 | padding: 10px; 42 | } 43 | 44 | #sign_in form { 45 | background: lightyellow; 46 | border: 1px solid tan; 47 | padding: 14px 14px 10px 14px; 48 | } 49 | 50 | #note_text { 51 | height: 60px; 52 | width: 100%; 53 | } 54 | 55 | #visits li, #services li, #notes li { 56 | vertical-align: top; 57 | border-bottom: 1px solid tan; 58 | padding: 6px 8px; 59 | } 60 | 61 | li .what { 62 | float:left; 63 | display:block; 64 | width: 200px; 65 | clear:both; 66 | } 67 | 68 | li .when { 69 | } 70 | 71 | li .note { 72 | font-style: italic; 73 | display: block; 74 | clear:both; 75 | padding: 3px 0; 76 | } 77 | 78 | form li { 79 | padding: 0 0 6px 0; 80 | } 81 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/lib/consoleReportForRake.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | var colors = {'pass': '32', 'fail': '31'}; 3 | 4 | function colorize(text, status){ 5 | return "\u001B[" + colors[status] + "m" + text + "\u001B[0m"; 6 | } 7 | 8 | $(Screw).bind("before", function(){ 9 | $('.it') 10 | .bind('passed', function(){ 11 | java.lang.System.out.print(colorize('.', 'pass')); 12 | }) 13 | .bind('failed', function(e, reason){ 14 | print(colorize("\nFAILED: " + BlueRidge.CommandLine.exampleName(this), 'fail')); 15 | print(colorize(" " + reason + "\n", 'fail')); 16 | }); 17 | }); 18 | 19 | $(Screw).bind("after", function(){ 20 | var testCount = $('.passed').length + $('.failed').length; 21 | var failures = $('.failed').length; 22 | var elapsedTime = ((new Date() - Screw.suite_start_time)/1000.0); 23 | var status_to_colorize; 24 | 25 | if(failures > 0){ 26 | status_to_colorize = 'fail'; 27 | }else{ 28 | status_to_colorize = 'pass'; 29 | }; 30 | 31 | print("\n") 32 | print(colorize(testCount + ' test(s), ' + failures + ' failure(s)', status_to_colorize)); 33 | print(colorize(elapsedTime.toString() + " seconds elapsed",status_to_colorize)); 34 | 35 | if(failures > 0) { java.lang.System.exit(1) }; 36 | }); 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | # Settings specified here will take precedence over those in config/environment.rb 2 | 3 | # The production environment is meant for finished, "live" apps. 4 | # Code is not reloaded between requests 5 | config.cache_classes = true 6 | 7 | # Full error reports are disabled and caching is turned on 8 | config.action_controller.consider_all_requests_local = false 9 | config.action_controller.perform_caching = true 10 | config.action_view.cache_template_loading = true 11 | 12 | # See everything in the log (default is :info) 13 | # config.log_level = :debug 14 | 15 | # Use a different logger for distributed setups 16 | # config.logger = SyslogLogger.new 17 | 18 | # Use a different cache store in production 19 | # config.cache_store = :mem_cache_store 20 | 21 | # Enable serving of images, stylesheets, and javascripts from an asset server 22 | # config.action_controller.asset_host = "http://assets.example.com" 23 | 24 | # Disable delivery errors, bad email addresses will be ignored 25 | # config.action_mailer.raise_delivery_errors = false 26 | 27 | # Enable threaded mode 28 | # config.threadsafe! 29 | 30 | # Set up with SendGrid for Engine Yard per 31 | # https://github.com/engineyard/ey-cloud-recipes/tree/master/cookbooks/ssmtp 32 | config.action_mailer.delivery_method = :sendmail 33 | 34 | SITE_URL = 'http://freehub.bikekitchen.org' -------------------------------------------------------------------------------- /db/migrate/003_create_people.rb: -------------------------------------------------------------------------------- 1 | class CreatePeople < ActiveRecord::Migration 2 | def self.up 3 | create_table :people do |t| 4 | t.string :first_name 5 | t.string :last_name 6 | t.string :full_name 7 | t.string :street1 8 | t.string :street2 9 | t.string :city 10 | t.string :state 11 | t.string :postal_code 12 | t.string :country 13 | t.string :email 14 | t.boolean :email_opt_out, :nil => false, :default => false 15 | t.string :phone 16 | t.boolean :staff, :nil => false, :default => false 17 | 18 | t.timestamps 19 | t.references :created_by, :updated_by 20 | t.references :organization, :nil => false 21 | end 22 | 23 | execute "ALTER TABLE people ADD CONSTRAINT fk_people_created_by FOREIGN KEY (created_by_id) REFERENCES users(id)" 24 | execute "ALTER TABLE people ADD CONSTRAINT fk_people_updated_by FOREIGN KEY (updated_by_id) REFERENCES users(id)" 25 | execute "ALTER TABLE people ADD CONSTRAINT fk_people_organization FOREIGN KEY (organization_id) REFERENCES organizations(id)" 26 | end 27 | 28 | def self.down 29 | execute "ALTER TABLE people DROP FOREIGN KEY fk_people_created_by" 30 | execute "ALTER TABLE people DROP FOREIGN KEY fk_people_updated_by" 31 | execute "ALTER TABLE people DROP FOREIGN KEY fk_people_organization" 32 | 33 | drop_table :people 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/format_db.js: -------------------------------------------------------------------------------- 1 | // DB No Seconds Format: 2007-12-05 12:00 2 | 3 | Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } 4 | Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } 5 | Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } 6 | 7 | Date.prototype.toFormattedString = function(include_time){ 8 | str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); 9 | if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } 10 | return str; 11 | } 12 | 13 | Date.parseFormattedString = function (string) { 14 | var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; 15 | var d = string.match(new RegExp(regexp, "i")); 16 | if (d==null) return Date.parse(string); // at least give javascript a crack at it. 17 | var offset = 0; 18 | var date = new Date(d[1], 0, 1); 19 | if (d[3]) { date.setMonth(d[3] - 1); } 20 | if (d[5]) { date.setDate(d[5]); } 21 | if (d[7]) { 22 | date.setHours(parseInt(d[7], 10)); 23 | } 24 | if (d[8]) { date.setMinutes(d[8]); } 25 | if (d[10]) { date.setSeconds(d[10]); } 26 | return date; 27 | } 28 | -------------------------------------------------------------------------------- /test/fixtures/notes.yml: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: notes 4 | # 5 | # id :integer(4) not null, primary key 6 | # text :text 7 | # notable_id :integer(4) 8 | # notable_type :string(255) 9 | # created_by_id :integer(4) 10 | # updated_by_id :integer(4) 11 | # created_at :datetime 12 | # updated_at :datetime 13 | # 14 | 15 | mary_1: 16 | text: Mary is a fine patron. Do what you can to keep her coming back. 17 | created_at: 2008-02-04 18:45:00 18 | created_by: sfbk 19 | notable: mary (Person) 20 | 21 | mary_visit_1: 22 | text: Mary came in with a total beater and wanted to trade it for the new XTR wheels than someone dropped off yesterday. 23 | I told her she could fix her bike or leave. 24 | created_at: 2008-02-01 18:01:00 25 | created_by: sfbk 26 | notable: mary_1 (Visit) 27 | 28 | mary_visit_2: 29 | text: Mary did two hours volunteering toward a membership today. 30 | created_at: 2008-02-02 18:02:00 31 | created_by: sfbk 32 | notable: mary_2 (Visit) 33 | 34 | mary_membership_expired: 35 | text: Membership earned with 12 volunteer hours. 36 | created_at: 2006-03-05 18:34:00 37 | created_by: sfbk 38 | notable: mary_membership_expired (Service) 39 | 40 | carrie_membership_expired: 41 | text: Carrie volunteered 6 hours for her membership. 42 | created_at: 2008-02-02 18:54:00 43 | created_by: sfbk 44 | notable: carrie_membership_expired (Service) 45 | 46 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/fr_class_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 12 | 13 | 14 | Classes 15 | 16 | 17 | 18 | 19 | 20 |
    21 |

    Classes

    22 | 35 |
    36 | 37 | -------------------------------------------------------------------------------- /public/javascripts/calendar_date_select/format_hyphen_ampm.js: -------------------------------------------------------------------------------- 1 | Date.prototype.toFormattedString = function(include_time){ 2 | str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); 3 | 4 | if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } 5 | return str; 6 | } 7 | 8 | Date.parseFormattedString = function (string) { 9 | var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + 10 | "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + 11 | "?)?)?)?"; 12 | var d = string.match(new RegExp(regexp, "i")); 13 | if (d==null) return Date.parse(string); // at least give javascript a crack at it. 14 | var offset = 0; 15 | var date = new Date(d[1], 0, 1); 16 | if (d[3]) { date.setMonth(d[3] - 1); } 17 | if (d[5]) { date.setDate(d[5]); } 18 | if (d[7]) { 19 | hours = parseInt(d[7], 10); 20 | offset=0; 21 | is_pm = (d[9].toLowerCase()=="pm") 22 | if (is_pm && hours <= 11) hours+=12; 23 | if (!is_pm && hours == 12) hours=0; 24 | date.setHours(hours); 25 | 26 | } 27 | if (d[8]) { date.setMinutes(d[8]); } 28 | if (d[10]) { date.setSeconds(d[10]); } 29 | if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } 30 | if (d[14]) { 31 | offset = (Number(d[16]) * 60) + Number(d[17]); 32 | offset *= ((d[15] == '-') ? 1 : -1); 33 | } 34 | 35 | return date; 36 | } -------------------------------------------------------------------------------- /public/stylesheets/scaffold.css: -------------------------------------------------------------------------------- 1 | body { background-color: #fff; color: #333; } 2 | 3 | body, p, ol, ul, td { 4 | font-family: verdana, arial, helvetica, sans-serif; 5 | font-size: 13px; 6 | line-height: 18px; 7 | } 8 | 9 | pre { 10 | background-color: #eee; 11 | padding: 10px; 12 | font-size: 11px; 13 | } 14 | 15 | a { color: #000; } 16 | a:visited { color: #666; } 17 | a:hover { color: #fff; background-color:#000; } 18 | 19 | .fieldWithErrors { 20 | padding: 2px; 21 | background-color: red; 22 | display: table; 23 | } 24 | 25 | #errorExplanation { 26 | width: 400px; 27 | border: 2px solid red; 28 | padding: 7px; 29 | padding-bottom: 12px; 30 | margin-bottom: 20px; 31 | background-color: #f0f0f0; 32 | } 33 | 34 | #errorExplanation h2 { 35 | text-align: left; 36 | font-weight: bold; 37 | padding: 5px 5px 5px 15px; 38 | font-size: 12px; 39 | margin: -7px; 40 | background-color: #c00; 41 | color: #fff; 42 | } 43 | 44 | #errorExplanation p { 45 | color: #333; 46 | margin-bottom: 0; 47 | padding: 5px; 48 | } 49 | 50 | #errorExplanation ul li { 51 | font-size: 12px; 52 | list-style: square; 53 | } 54 | 55 | div.uploadStatus { 56 | margin: 5px; 57 | } 58 | 59 | div.progressBar { 60 | margin: 5px; 61 | } 62 | 63 | div.progressBar div.border { 64 | background-color: #fff; 65 | border: 1px solid gray; 66 | width: 100%; 67 | } 68 | 69 | div.progressBar div.background { 70 | background-color: #333; 71 | height: 18px; 72 | width: 0%; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/screw.events.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(Screw) 3 | .bind('loaded', function() { 4 | $('.describe, .it') 5 | .click(function() { 6 | document.location = location.href.split('?')[0] + '?' + $(this).fn('selector'); 7 | return false; 8 | }) 9 | .focus(function() { 10 | return $(this).addClass('focused'); 11 | }) 12 | .bind('scroll', function() { 13 | document.body.scrollTop = $(this).offset().top; 14 | }); 15 | 16 | $('.it') 17 | .bind('enqueued', function() { 18 | $(this).addClass('enqueued'); 19 | }) 20 | .bind('running', function() { 21 | $(this).addClass('running'); 22 | }) 23 | .bind('passed', function() { 24 | $(this).addClass('passed'); 25 | }) 26 | .bind('failed', function(e, reason) { 27 | $(this) 28 | .addClass('failed') 29 | .append($('

    ').text(reason.toString())); 30 | 31 | var file = reason.fileName || reason.sourceURL; 32 | var line = reason.lineNumber || reason.line; 33 | if (file || line) { 34 | $(this).append($('

    ').text('line ' + line + ', ' + file)); 35 | } 36 | }) 37 | }) 38 | .bind('before', function() { 39 | Screw.suite_start_time = new Date(); 40 | $('.status').text('Running...'); 41 | }) 42 | .bind('after', function() { 43 | $('.status').fn('display') 44 | }) 45 | })(jQuery); -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path(File.dirname(__FILE__) + "/../config/environment") 3 | require 'test_help' 4 | 5 | class Test::Unit::TestCase 6 | # Transactional fixtures accelerate your tests by wrapping each test method 7 | # in a transaction that's rolled back on completion. This ensures that the 8 | # test database remains unchanged so your fixtures don't have to be reloaded 9 | # between every test method. Fewer database queries means faster tests. 10 | # 11 | # Read Mike Clark's excellent walkthrough at 12 | # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting 13 | # 14 | # Every Active Record database supports transactions except MyISAM tables 15 | # in MySQL. Turn off transactional fixtures in this case; however, if you 16 | # don't care one way or the other, switching from MyISAM to InnoDB tables 17 | # is recommended. 18 | self.use_transactional_fixtures = true 19 | 20 | # Instantiated fixtures are slow, but give you @david where otherwise you 21 | # would need people(:david). If you don't want to migrate your existing 22 | # test cases which use the @david style and don't mind the speed hit (each 23 | # instantiated fixtures translates to a database query per test method), 24 | # then set this back to true. 25 | self.use_instantiated_fixtures = false 26 | 27 | # Add more helper methods to be used by all tests here... 28 | 29 | def setup 30 | RAILS_DEFAULT_LOGGER.debug "\n\e[0;31mRUNNING TEST CASE: #{name}\e[m\n" 31 | end 32 | 33 | end 34 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb 2 | 3 | unless defined?(RAILS_ROOT) 4 | root_path = File.join(File.dirname(__FILE__), '..') 5 | 6 | unless RUBY_PLATFORM =~ /mswin32/ 7 | require 'pathname' 8 | root_path = Pathname.new(root_path).cleanpath(true).to_s 9 | end 10 | 11 | RAILS_ROOT = root_path 12 | end 13 | 14 | unless defined?(Rails::Initializer) 15 | if File.directory?("#{RAILS_ROOT}/vendor/rails") 16 | require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" 17 | else 18 | require 'rubygems' 19 | 20 | environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join 21 | environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/ 22 | rails_gem_version = $1 23 | 24 | if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version 25 | rails_gem = Gem.cache.search('rails', "=#{version}").first 26 | 27 | if rails_gem 28 | gem "rails", "=#{version}" 29 | require rails_gem.full_gem_path + '/lib/initializer' 30 | else 31 | STDERR.puts %(Cannot find gem for Rails =#{version}: 32 | Install the missing gem with 'gem install -v=#{version} rails', or 33 | change environment.rb to define RAILS_GEM_VERSION with your desired version. 34 | ) 35 | exit 1 36 | end 37 | else 38 | gem "rails" 39 | require 'initializer' 40 | end 41 | end 42 | 43 | Rails::Initializer.run(:set_load_path) 44 | end -------------------------------------------------------------------------------- /test/fixtures/services.yml: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: services 4 | # 5 | # id :integer(4) not null, primary key 6 | # start_date :date 7 | # end_date :date 8 | # paid :boolean(1) default(FALSE) 9 | # volunteered :boolean(1) default(FALSE) 10 | # service_type_id :string(255) 11 | # person_id :integer(4) 12 | # created_at :datetime 13 | # updated_at :datetime 14 | # created_by_id :integer(4) 15 | # updated_by_id :integer(4) 16 | # 17 | 18 | mary_membership: 19 | start_date: <%= 1.month.ago.to_date %> 20 | end_date: <%= 11.months.from_now.to_date %> 21 | paid: true 22 | volunteered: false 23 | person: mary 24 | service_type_id: MEMBERSHIP 25 | 26 | mary_membership_expired: 27 | start_date: 2006-03-05 28 | end_date: 2007-03-05 29 | paid: true 30 | volunteered: true 31 | person: mary 32 | service_type_id: MEMBERSHIP 33 | 34 | mary_class: 35 | start_date: 2008-03-05 36 | end_date: 2008-03-05 37 | paid: false 38 | volunteered: false 39 | person: mary 40 | service_type_id: CLASS 41 | 42 | carrie_membership_expired: 43 | start_date: 2006-03-05 44 | end_date: 2007-03-05 45 | paid: false 46 | volunteered: true 47 | person: carrie 48 | service_type_id: MEMBERSHIP 49 | 50 | <% (1..60).each do |count| %> 51 | carrie_class<%= count %>: 52 | start_date: <%= Date.new(2008,3,2).advance(:months => count * -1) %> 53 | end_date: <%= Date.new(2009,3,2).advance(:months => count * -1) %> 54 | paid: true 55 | volunteered: false 56 | person: carrie 57 | service_type_id: CLASS 58 | <% end %> 59 | 60 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/lib/blue_ridge.rb: -------------------------------------------------------------------------------- 1 | module BlueRidge 2 | JavaScriptSpecDirs = ["examples/javascripts", "spec/javascripts", "test/javascript"] 3 | 4 | def self.plugin_prefix 5 | ENV["BLUE_RIDGE_PREFIX"] || "#{RAILS_ROOT}/vendor/plugins/blue-ridge" 6 | end 7 | 8 | def self.rhino_command 9 | "java -Dblue.ridge.prefix=\"#{plugin_prefix}\" -jar #{plugin_prefix}/vendor/js.jar -w -debug -opt -1" 10 | end 11 | 12 | def self.test_runner_command 13 | "#{rhino_command} #{plugin_prefix}/lib/test_runner.js" 14 | end 15 | 16 | def self.find_base_spec_dir 17 | return "examples" if File.exist?("examples") 18 | return "spec" if File.exist?("spec") 19 | "test" 20 | end 21 | 22 | def self.javascript_spec_dir 23 | base_spec_dir = find_base_spec_dir 24 | return "test/javascript" if base_spec_dir == "test" 25 | base_spec_dir + "/javascripts" 26 | end 27 | 28 | def self.find_javascript_spec_dir 29 | JavaScriptSpecDirs.find {|d| File.exist?(d) } 30 | end 31 | 32 | def self.find_specs_under_current_dir 33 | Dir.glob("**/*_spec.js") 34 | end 35 | 36 | def self.run_spec(spec_filename) 37 | system("#{test_runner_command} #{spec_filename}") 38 | end 39 | 40 | def self.run_specs_in_dir(spec_dir, spec_name = nil) 41 | result = nil 42 | Dir.chdir(spec_dir) { result = run_specs(spec_name) } 43 | result 44 | end 45 | 46 | def self.run_specs(spec_name = nil) 47 | specs = spec_name.nil? ? find_specs_under_current_dir : ["#{spec_name}_spec.js"] 48 | all_fine = specs.inject(true) {|result, spec| result &= run_spec(spec) } 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/vendor/smoke.core.js: -------------------------------------------------------------------------------- 1 | Smoke = { 2 | print: function(v) { 3 | // use the jquery print plugin if it is available or fall back to toString(); 4 | return (jQuery && jQuery.print) ? jQuery.print(v) : v.toString(); 5 | }, 6 | 7 | printArguments: function(args) { 8 | var a = []; 9 | if (args === undefined) args = ''; 10 | if ((args && args.callee) || (args instanceof Array)) { 11 | for(var i = 0; i < args.length; i++) { 12 | a.push(Smoke.print(args[i])); 13 | } 14 | } else { 15 | // Workaround for jQuery.print returning "null" when called with an empty string. 16 | if (!args && (typeof args == 'string')) { 17 | a.push(''); 18 | } else { 19 | a.push(Smoke.print(args)); 20 | } 21 | } 22 | return '(' + a.join(', ') + ')'; 23 | }, 24 | 25 | argumentsToArray: function(args) { 26 | return Array.prototype.slice.call(args); 27 | }, 28 | 29 | compare: function(a, b) { 30 | if (a === b) return true; 31 | if (a instanceof Array) { 32 | if (b.length != a.length) return false; 33 | for (var i = 0; i < b.length; i++) 34 | if (!this.compare(a[i], b[i])) return false; 35 | } else if (a instanceof Object) { 36 | for (var key in a) 37 | if (!this.compare(a[key], b[key])) return false; 38 | for (var key in b) 39 | if (!this.compare(b[key], a[key])) return false; 40 | } else { 41 | return false; 42 | } 43 | return true; 44 | }, 45 | 46 | compareArguments: function(a, b) { 47 | return this.compare(Smoke.argumentsToArray(a), Smoke.argumentsToArray(b)); 48 | } 49 | }; -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000011.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | test_update_with_nil_current_user (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 111
    14 |   def test_update_with_nil_current_user
    15 |     assert_equal @first_user, User.current_user
    16 | 
    17 |     @first_entry.update_attribute("name", "Updated by Nil")
    18 | 
    19 |     assert_equal @first_user, @first_entry.created_by
    20 |     assert_equal @first_user, @first_entry.updated_by
    21 |   end
    22 | 23 | -------------------------------------------------------------------------------- /vendor/plugins/auto_complete/lib/auto_complete.rb: -------------------------------------------------------------------------------- 1 | module AutoComplete 2 | 3 | def self.included(base) 4 | base.extend(ClassMethods) 5 | end 6 | 7 | # 8 | # Example: 9 | # 10 | # # Controller 11 | # class BlogController < ApplicationController 12 | # auto_complete_for :post, :title 13 | # end 14 | # 15 | # # View 16 | # <%= text_field_with_auto_complete :post, title %> 17 | # 18 | # By default, auto_complete_for limits the results to 10 entries, 19 | # and sorts by the given field. 20 | # 21 | # auto_complete_for takes a third parameter, an options hash to 22 | # the find method used to search for the records: 23 | # 24 | # auto_complete_for :post, :title, :limit => 15, :order => 'created_at DESC' 25 | # 26 | # For help on defining text input fields with autocompletion, 27 | # see ActionView::Helpers::JavaScriptHelper. 28 | # 29 | # For more examples, see script.aculo.us: 30 | # * http://script.aculo.us/demos/ajax/autocompleter 31 | # * http://script.aculo.us/demos/ajax/autocompleter_customized 32 | module ClassMethods 33 | def auto_complete_for(object, method, options = {}) 34 | define_method("auto_complete_for_#{object}_#{method}") do 35 | find_options = { 36 | :conditions => [ "LOWER(#{method}) LIKE ?", '%' + params[object][method].downcase + '%' ], 37 | :order => "#{method} ASC", 38 | :limit => 10 }.merge!(options) 39 | 40 | @items = object.to_s.camelize.constantize.find(:all, find_options) 41 | 42 | render :inline => "<%= auto_complete_result @items, '#{method}' %>" 43 | end 44 | end 45 | end 46 | 47 | end -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000006.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | test_created_by (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 56
    14 |   def test_created_by
    15 |     assert_equal @first_user, User.current_user
    16 |     assert_equal @first_user, @first_entry.created_by
    17 |     assert_equal @second_user, @second_entry.created_by
    18 | 
    19 |     assert_nil @first_post.created_by
    20 |     assert_nil @second_post.created_by
    21 |   end
    22 | 23 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000007.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | test_updated_by (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 65
    14 |   def test_updated_by
    15 |     assert_equal @first_user, User.current_user
    16 |     assert_equal @first_user, @first_entry.updated_by
    17 |     assert_equal @second_user, @second_entry.updated_by
    18 | 
    19 |     assert_nil @first_post.updated_by
    20 |     assert_nil @second_post.updated_by
    21 |   end
    22 | 23 | -------------------------------------------------------------------------------- /app/models/note.rb: -------------------------------------------------------------------------------- 1 | # == Schema Information 2 | # 3 | # Table name: notes 4 | # 5 | # id :integer(4) not null, primary key 6 | # text :text 7 | # notable_id :integer(4) 8 | # notable_type :string(255) 9 | # created_by_id :integer(4) 10 | # updated_by_id :integer(4) 11 | # created_at :datetime 12 | # updated_at :datetime 13 | # 14 | 15 | class Note < ActiveRecord::Base 16 | 17 | belongs_to :notable, :polymorphic => true 18 | has_userstamps 19 | 20 | validates_presence_of :notable_type, :notable_id 21 | 22 | def self.for_person(person, options={}) 23 | options[:order] ||= 'notes.created_at DESC' 24 | find_by_sql for_person_sql(person, options) 25 | end 26 | 27 | def self.count_for_person(person, options={}) 28 | count_by_sql for_person_sql(person, options.merge(:select => 'COUNT(*)')) 29 | end 30 | 31 | def empty? 32 | self.text.nil? || self.text.empty? 33 | end 34 | 35 | private 36 | 37 | def self.for_person_sql(person, options={}) 38 | options[:select] ||= '*' 39 | options[:offset] ||= 0 40 | sql = "SELECT #{options[:select]} FROM notes 41 | WHERE (notes.notable_type = 'Person' AND notes.notable_id = #{person.id}) 42 | OR (notes.notable_type = 'Service' AND notes.notable_id IN (SELECT services.id FROM services WHERE services.person_id = #{person.id})) 43 | OR (notes.notable_type = 'Visit' AND notes.notable_id IN (SELECT visits.id FROM visits WHERE visits.person_id = #{person.id}))" 44 | 45 | sql += " ORDER BY #{options[:order]}" if options[:order] 46 | sql += " LIMIT #{options[:offset]},#{options[:limit]}" if options[:limit] 47 | sql 48 | end 49 | 50 | end 51 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/lib/paging_helper.rb: -------------------------------------------------------------------------------- 1 | module PaginatingFind 2 | module Helpers 3 | DEFAULT_OPTIONS = { :name => :page, :window_size => 2, 4 | :always_show_anchors => true, :link_to_current_page => false, 5 | :params => {} } 6 | 7 | def paginating_links(paginator, options = {}, html_options = {}) 8 | name = options[:name] || DEFAULT_OPTIONS[:name] 9 | params = (options[:params] || DEFAULT_OPTIONS[:params]).clone 10 | 11 | paginating_links_each(paginator, options) do |n| 12 | params[name] = n 13 | link_to(n, params, html_options) 14 | end 15 | end 16 | 17 | def paginating_links_each(paginator, options = {}) 18 | options = DEFAULT_OPTIONS.merge(options) 19 | 20 | window = ((paginator.page - options[:window_size] + 1)..(paginator.page + options[:window_size] - 1)).select {|w| w >= paginator.first_page && w <= paginator.last_page } 21 | 22 | html = '' 23 | 24 | if options[:always_show_anchors] && !window.include?(paginator.first_page) 25 | html << yield(paginator.first_page) 26 | html << ' ... ' unless window.first - 1 == paginator.first_page 27 | html << ' ' 28 | end 29 | 30 | window.each do |p| 31 | if paginator.page == p && !options[:link_to_current_page] 32 | html << p.to_s 33 | else 34 | html << yield(p) 35 | end 36 | html << ' ' 37 | end 38 | 39 | if options[:always_show_anchors] && !window.include?(paginator.last_page) 40 | html << ' ... ' unless window.last + 1 == paginator.last_page 41 | html << yield(paginator.last_page) 42 | end 43 | 44 | html 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000003.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | test_ar_userstamp_loaded (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 32
    14 |   def test_ar_userstamp_loaded
    15 |     assert ActiveRecord::Base.include?(ActiveRecord::Userstamp)
    16 |     assert_equal @first_user, User.current_user
    17 |     assert_equal User, @first_entry.user_model
    18 |     assert_equal User, @second_entry.user_model
    19 |   end
    20 | 21 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/ActiveRecord/Userstamp.src/M000013.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | included (ActiveRecord::Userstamp) 9 | 10 | 11 | 12 | 13 |
    # File lib/userstamp.rb, line 13
    14 |     def self.included(base)
    15 |       super
    16 | 
    17 |       base.class_eval do
    18 |         alias_method :create_without_user, :create
    19 |         alias_method :create, :create_with_user
    20 | 
    21 |         alias_method :update_without_user, :update
    22 |         alias_method :update, :update_with_user
    23 |       end
    24 |     end
    25 | 26 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/ActiveRecord/Userstamp.src/M000012.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | included (ActiveRecord::Userstamp) 9 | 10 | 11 | 12 | 13 |
    # File lib/userstamp.rb, line 13
    14 |     def self.included(base)
    15 |       super
    16 | 
    17 |       base.class_eval do
    18 |         alias_method :create_without_user, :create
    19 |         alias_method :create, :create_with_user
    20 | 
    21 |         alias_method :update_without_user, :update
    22 |         alias_method :update, :update_with_user
    23 |       end
    24 |     end
    25 | 26 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | # Filters added to this controller apply to all controllers in the application. 2 | # Likewise, all the methods added will be available for all controllers. 3 | 4 | class ApplicationController < ActionController::Base 5 | helper :all # include all helpers, all the time 6 | include ApplicationHelper 7 | 8 | # See ActionController::RequestForgeryProtection for details 9 | # Uncomment the :secret if you're not using the cookie session store 10 | protect_from_forgery # :secret => '4053cfc52c7349828c17880e0b762667' 11 | 12 | # Include restful_authentication support 13 | include AuthenticatedSystem 14 | include UrlHelper 15 | 16 | # Authenticate 17 | before_filter :login_from_cookie, :login_required, :store_current_user 18 | 19 | # Root object for nested resources 20 | before_filter :resolve_organization, :resolve_person 21 | 22 | # Timezone of the organization or default 23 | before_filter :set_timezone 24 | 25 | # Default character set 26 | before_filter :set_charset 27 | 28 | private 29 | 30 | def resolve_organization 31 | @organization = Organization.find_by_key(params[:organization_key]) 32 | end 33 | 34 | def resolve_person 35 | @person = Person.find(params[:person_id]) if params[:person_id] 36 | end 37 | 38 | def store_current_user 39 | User.current_user = current_user 40 | end 41 | 42 | def set_timezone 43 | Time.zone = @organization ? @organization.timezone : ENV['TIMEZONE_DEFAULT'] 44 | end 45 | 46 | # year, month, day 47 | def date_from_params(params) 48 | return nil unless params[:year] && params[:month] && params[:day] 49 | Date.new params[:year].to_i, params[:month].to_i, params[:day].to_i 50 | end 51 | 52 | def set_charset 53 | response.headers["Content-Type"] = "text/html; charset=utf-8" 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /vendor/plugins/blue-ridge/tasks/javascript_testing_tasks.rake: -------------------------------------------------------------------------------- 1 | require File.expand_path(File.dirname(__FILE__) + '/../lib/blue_ridge') 2 | 3 | def error_message_for_missing_spec_dir 4 | %Q{Could not find JavaScript test directory. 5 | None of the following directories existed: #{BlueRidge::JavaScriptSpecDirs.join(", ")}. 6 | Maybe you need to call './script/generate blue_ridge'? 7 | } 8 | end 9 | 10 | # Support Test::Unit & Test/Spec style 11 | namespace :test do 12 | desc "Runs all the JavaScript tests and outputs the results." 13 | task :javascripts do 14 | js_spec_dir = BlueRidge.find_javascript_spec_dir || (raise error_message_for_missing_spec_dir) 15 | raise "JavaScript test failures" unless BlueRidge.run_specs_in_dir(js_spec_dir, ENV["TEST"]) 16 | end 17 | 18 | task :javascript => :javascripts 19 | end 20 | 21 | # Support RSpec style 22 | namespace :spec do 23 | task :javascripts => "test:javascripts" 24 | task :javascript => "test:javascripts" 25 | end 26 | 27 | # Support Micronaut style 28 | namespace :examples do 29 | task :javascripts => "test:javascripts" 30 | task :javascript => "test:javascripts" 31 | end 32 | 33 | 34 | namespace :js do 35 | desc "Open the JavaScript fixtures to ease running in-browser tests." 36 | task :fixtures do 37 | js_spec_dir = BlueRidge.find_javascript_spec_dir || (raise error_message_for_missing_spec_dir) 38 | fixture_dir = "#{js_spec_dir}/fixtures" 39 | 40 | if PLATFORM[/darwin/] 41 | system("open #{fixture_dir}") 42 | elsif PLATFORM[/linux/] 43 | system("firefox #{fixture_dir}") 44 | else 45 | puts "You can run your in-browser fixtures from #{fixture_dir}." 46 | end 47 | end 48 | 49 | desc "Runs the Rhino JavaScript shell." 50 | task :shell do 51 | rlwrap = `which rlwrap`.chomp 52 | system("#{rlwrap} #{BlueRidge.rhino_command} -f #{BlueRidge.plugin_prefix}/lib/shell.js -f -") 53 | end 54 | end -------------------------------------------------------------------------------- /test/functional/notes_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NotesControllerTest < ActionController::TestCase 4 | 5 | def setup 6 | super 7 | login_as 'sfbk' 8 | end 9 | 10 | def test_should_get_index 11 | get :index, :organization_key => 'sfbk', :person_id => people(:mary) 12 | assert_response :success 13 | assert_not_nil assigns(:notes) 14 | assert_equal 4, assigns(:notes).size 15 | end 16 | 17 | def test_should_get_new 18 | get :new, :organization_key => 'sfbk', :person_id => people(:mary) 19 | assert_response :success 20 | end 21 | 22 | def test_should_create_note 23 | assert_difference('Note.count') do 24 | post :create, :organization_key => 'sfbk', :person_id => people(:mary), :note => { :text => 'New note'} 25 | end 26 | 27 | assert_redirected_to notes_path 28 | end 29 | 30 | def test_should_show_note 31 | get :show, :organization_key => 'sfbk', :person_id => people(:mary), :id => notes(:mary_visit_1) 32 | assert_response :success 33 | 34 | assert_select 'body ul.note' do 35 | assert_select 'li:nth-child(1)' do 36 | assert_select 'div.label', 'Notable' 37 | assert_select 'div.value', /Visit/ 38 | end 39 | end 40 | end 41 | 42 | def test_should_get_edit 43 | get :edit, :organization_key => 'sfbk', :person_id => people(:mary), :id => notes(:mary_visit_1) 44 | assert_response :success 45 | end 46 | 47 | def test_should_update_note 48 | put :update, :organization_key => 'sfbk', :person_id => people(:mary), :id => notes(:mary_visit_1), :note => { } 49 | assert_redirected_to note_path(:id => assigns(:note)) 50 | end 51 | 52 | def test_should_destroy_note 53 | assert_difference('Note.count', -1) do 54 | delete :destroy, :organization_key => 'sfbk', :person_id => people(:mary), :id => notes(:mary_visit_1) 55 | end 56 | 57 | assert_redirected_to notes_path 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /vendor/plugins/paginating_find/test_app/test/unit/group_test.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/abstract_test.rb' 2 | 3 | class GroupTest < Test::Unit::TestCase 4 | def test_should_paginate_with_group 5 | one = Article.create(:name => "one", :author_id => 1) 6 | two = Article.create(:name => "two", :author_id => 1) 7 | three = Article.create(:name => "three", :author_id => 1) 8 | four = Article.create(:name => "four", :author_id => 2) 9 | results = Article.find(:all, :group => "author_id", :page => {:size => 2}) 10 | assert_equal 2, results.size 11 | assert results.to_a.include?(one) 12 | assert !results.to_a.include?(two) 13 | assert !results.to_a.include?(three) 14 | assert results.to_a.include?(four) 15 | assert_equal 1, results.page_count 16 | assert_equal 2, results.page_size 17 | end 18 | 19 | def test_should_paginate_with_group_and_order 20 | one = Article.create(:name => "one", :author_id => 1) 21 | two = Article.create(:name => "two", :author_id => 1) 22 | three = Article.create(:name => "three", :author_id => 1) 23 | four = Article.create(:name => "four", :author_id => 2) 24 | results = Article.find(:all, :group => "author_id", :order => "name DESC", :page => {:size => 2}) 25 | assert_equal 2, results.size 26 | assert_equal 1, results.page_count 27 | assert_equal 2, results.page_size 28 | end 29 | 30 | def test_should_work_with_having_tacked_onto_group 31 | one = Article.create(:name => "one", :author_id => 1) 32 | two = Article.create(:name => "two", :author_id => 1) 33 | three = Article.create(:name => "three", :author_id => 1) 34 | four = Article.create(:name => "four", :author_id => 2) 35 | results = Article.find(:all, :group => "author_id HAVING author_id=1", :order => "name DESC", :page => {:size => 2}) 36 | assert_equal 1, results.size 37 | assert_equal 1, results.page_count 38 | assert_equal 2, results.page_size 39 | end 40 | end -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000005.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | test_column_read_method (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 48
    14 |   def test_column_read_method
    15 |     assert_equal @first_user, User.current_user
    16 |     assert Entry.new.respond_to?("created_by")
    17 |     assert Entry.new.respond_to?("updated_by")
    18 |     assert Post.new.respond_to?("created_by")
    19 |     assert Post.new.respond_to?("updated_by")
    20 |   end
    21 | 22 | -------------------------------------------------------------------------------- /app/views/tags/show.html.haml: -------------------------------------------------------------------------------- 1 | -content_for :head do 2 | =stylesheet_link_tag 'tags' 3 | =javascript_include_tag 'tags.jquery.js' 4 | :javascript 5 | (function($) 6 | { 7 | $(function() 8 | { 9 | $('.tags_control').tags_control(); 10 | }); 11 | })(jQuery); 12 | 13 | %div{:style => 'width: 650px; margin-right: 40px;'} 14 | 15 | %h1 Tag : #{@tag} 16 | 17 | %div.section 18 | %div.list_status #{@people.to_a.size} of #{@people.size} people shown. 19 | %table{:width => '100%'} 20 | -for person in @people 21 | %tr 22 | %td 23 | %ul 24 | %li.person_name 25 | =link_to(person.full_name, person_path(:id => person)) 26 | %li= person.email 27 | %li.last_visit 28 | -if person.visits.first 29 | Last visit #{date_long person.visits.first.arrived_at} 30 | -else 31 | No visits 32 | %td{:style => 'text-align: right;'} 33 | %ul 34 | %li.person_type 35 | =person.person_type 36 | -if !person.membership 37 | %li Not a member 38 | -elsif person.membership.current? 39 | %li.current Membership expires #{date_short person.membership.end_date} 40 | -else 41 | %li.expired Membership expired #{date_short person.membership.end_date} 42 | %li   43 | %li=render :partial => '/taggings/index', :locals => { :person => person } 44 | %tr.list_controls 45 | %td{:colspan => 2} 46 | -if @people.next_page? || @people.previous_page? 47 | %div.paginating_links 48 | More: #{paginating_links(@people)} 49 | 50 | %div{:style => 'width: 200px;'} 51 | %h2 All Tags 52 | %ul 53 | -for tag in @organization.tags 54 | %li=link_to tag, tag_path(:organization_key => @organization.key, :id => tag.id) 55 | -------------------------------------------------------------------------------- /vendor/plugins/userstamp/doc/classes/UserstampTest.src/M000004.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | test_column_write_method (UserstampTest) 9 | 10 | 11 | 12 | 13 |
    # File test/userstamp_test.rb, line 39
    14 |   def test_column_write_method
    15 |     assert_equal @first_user, User.current_user
    16 |     assert Entry.new.respond_to?("created_by=")
    17 |     assert Entry.new.respond_to?("updated_by=")
    18 | 
    19 |     assert Post.new.respond_to?("created_by=")
    20 |     assert Post.new.respond_to?("updated_by=")
    21 |   end
    22 | 23 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/asalant/rails-authorization-plugin 3 | revision: 505bd47addf2ef5e3b5d98a7ea8d1352c2aa4ee6 4 | specs: 5 | authorization (1.0.12) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | actionmailer (2.3.17) 11 | actionpack (= 2.3.17) 12 | actionpack (2.3.17) 13 | activesupport (= 2.3.17) 14 | rack (~> 1.1.0) 15 | activerecord (2.3.17) 16 | activesupport (= 2.3.17) 17 | activeresource (2.3.17) 18 | activesupport (= 2.3.17) 19 | activesupport (2.3.17) 20 | acts-as-taggable-on (2.0.6) 21 | annotate (2.6.2) 22 | activerecord (>= 2.3.0) 23 | rake (>= 0.8.7) 24 | builder (3.2.2) 25 | calendar_date_select (1.16.1) 26 | googlecharts (1.6.0) 27 | haml (3.0.25) 28 | hoptoad_notifier (2.4.11) 29 | activesupport 30 | builder 31 | json (1.7.7) 32 | kgio (2.11.2) 33 | mysql (2.9.1) 34 | newrelic_rpm (3.7.3.204) 35 | power_assert (0.3.0) 36 | rack (1.1.6) 37 | rails (2.3.17) 38 | actionmailer (= 2.3.17) 39 | actionpack (= 2.3.17) 40 | activerecord (= 2.3.17) 41 | activeresource (= 2.3.17) 42 | activesupport (= 2.3.17) 43 | rake (>= 0.8.3) 44 | raindrops (0.19.0) 45 | rake (10.1.1) 46 | rdoc (4.1.1) 47 | json (~> 1.4) 48 | test-unit (3.1.9) 49 | power_assert 50 | thoughtbot-shoulda (2.11.1) 51 | tzinfo (0.3.61) 52 | unicorn (5.5.1) 53 | kgio (~> 2.6) 54 | raindrops (~> 0.7) 55 | validates_email_format_of (1.5.3) 56 | 57 | PLATFORMS 58 | ruby 59 | 60 | DEPENDENCIES 61 | acts-as-taggable-on (= 2.0.6) 62 | annotate 63 | authorization! 64 | calendar_date_select (= 1.16.1) 65 | googlecharts (= 1.6.0) 66 | haml (= 3.0.25) 67 | hoptoad_notifier 68 | json (= 1.7.7) 69 | mysql 70 | newrelic_rpm 71 | rails (= 2.3.17) 72 | rdoc 73 | test-unit 74 | thoughtbot-shoulda 75 | tzinfo (~> 0.3.61) 76 | unicorn 77 | validates_email_format_of 78 | 79 | BUNDLED WITH 80 | 1.15.4 81 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | # Methods added to this helper will be available to all templates in the application. 2 | module ApplicationHelper 3 | 4 | def breadcrumb(*items) 5 | items.join ' : ' 6 | end 7 | 8 | def time_short(datetime) 9 | datetime.strftime("%I:%M %p").gsub(/^0/,'').downcase if datetime 10 | end 11 | 12 | def datetime_short(datetime) 13 | datetime.strftime("%Y-%m-%d %H:%M") if datetime 14 | end 15 | 16 | def datetime_long(datetime) 17 | "#{date_long(datetime)} #{time_short(datetime)}" if datetime 18 | end 19 | 20 | def date_long(date) 21 | date.strftime("%a %b %d %Y") if date 22 | end 23 | 24 | def date_short(date) 25 | date.strftime("%d-%b-%y") if date 26 | end 27 | 28 | # Override ActionView::Helpers::DateHelper#time_ago_in_words to handle timezone conversions 29 | def time_ago_in_words(from_time, include_seconds=false) 30 | distance_of_time_in_words(from_time, Time.zone.now, include_seconds) 31 | end 32 | 33 | def tab_item(label, path) 34 | "
  • #{label}
  • " 35 | end 36 | 37 | def today_visits_path(params={}) 38 | today = Time.zone.today 39 | day_visits_path params.merge(:year => today.year, :month => today.month, :day => today.day) 40 | end 41 | 42 | 43 | # View helpers migrated from Markaby 44 | #TODO: figure out a cleaner way to do this with HAML 45 | def labeled_input(label_value, attributes={}, &block) 46 | Haml::Engine.new(< label_value, :attributes => attributes, :block => block) 56 | end 57 | 58 | def labeled_value(label_value, value) 59 | Haml::Engine.new(< label_value, :value => value) 65 | end 66 | 67 | end 68 | -------------------------------------------------------------------------------- /vendor/plugins/restful_authentication/README: -------------------------------------------------------------------------------- 1 | Restful Authentication Generator 2 | ==== 3 | 4 | This is a basic restful authentication generator for rails, taken 5 | from acts as authenticated. Currently it requires Rails 1.2.6 or above. 6 | 7 | To use: 8 | 9 | ./script/generate authenticated user sessions \ 10 | --include-activation \ 11 | --stateful 12 | 13 | The first parameter specifies the model that gets created in signup 14 | (typically a user or account model). A model with migration is 15 | created, as well as a basic controller with the create method. 16 | 17 | The second parameter specifies the sessions controller name. This is 18 | the controller that handles the actual login/logout function on the 19 | site. 20 | 21 | The third parameter (--include-activation) generates the code for a 22 | ActionMailer and its respective Activation Code through email. 23 | 24 | The fourth (--stateful) builds in support for acts_as_state_machine 25 | and generates activation code. This was taken from: 26 | 27 | http://www.vaporbase.com/postings/stateful_authentication 28 | 29 | You can pass --skip-migration to skip the user migration. 30 | 31 | If you're using acts_as_state_machine, define your users resource like this: 32 | 33 | map.resources :users, :member => { :suspend => :put, 34 | :unsuspend => :put, 35 | :purge => :delete } 36 | 37 | Also, add an observer to config/environment.rb if you chose the 38 | --include-activation option 39 | 40 | config.active_record.observers = :user_observer # or whatever you 41 | # named your model 42 | 43 | Security Alert 44 | ==== 45 | 46 | I introduced a change to the model controller that's been tripping 47 | folks up on Rails 2.0. The change was added as a suggestion to help 48 | combat session fixation attacks. However, this resets the Form 49 | Authentication token used by Request Forgery Protection. I've left 50 | it out now, since Rails 1.2.6 and Rails 2.0 will both stop session 51 | fixation attacks anyway. -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path(File.dirname(__FILE__) + "/../config/environment") 3 | require 'test_help' 4 | 5 | class ActiveSupport::TestCase 6 | 7 | include AuthenticatedTestHelper 8 | include ApplicationHelper 9 | 10 | # Transactional fixtures accelerate your tests by wrapping each test method 11 | # in a transaction that's rolled back on completion. This ensures that the 12 | # test database remains unchanged so your fixtures don't have to be reloaded 13 | # between every test method. Fewer database queries means faster tests. 14 | # 15 | # Read Mike Clark's excellent walkthrough at 16 | # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting 17 | # 18 | # Every Active Record database supports transactions except MyISAM tables 19 | # in MySQL. Turn off transactional fixtures in this case; however, if you 20 | # don't care one way or the other, switching from MyISAM to InnoDB tables 21 | # is recommended. 22 | # 23 | # The only drawback to using transactional fixtures is when you actually 24 | # need to test transactions. Since your test is bracketed by a transaction, 25 | # any transactions started in your code will be automatically rolled back. 26 | self.use_transactional_fixtures = true 27 | 28 | # Instantiated fixtures are slow, but give you @david where otherwise you 29 | # would need people(:david). If you don't want to migrate your existing 30 | # test cases which use the @david style and don't mind the speed hit (each 31 | # instantiated fixtures translates to a database query per test method), 32 | # then set this back to true. 33 | self.use_instantiated_fixtures = false 34 | 35 | # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. 36 | # 37 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 38 | # -- they do not yet inherit this setting 39 | fixtures :all 40 | 41 | # Add more helper methods to be used by all tests here... 42 | 43 | Time.zone = ENV['TIMEZONE_DEFAULT'] 44 | end 45 | -------------------------------------------------------------------------------- /app/views/visits/day.html.haml: -------------------------------------------------------------------------------- 1 | -if @day == Time.zone.today 2 | %div.flex-column 3 | = render :partial => 'visits/person_search' 4 | 5 | %div.flex-fullwidth 6 | %div.section.visits! 7 | -if @day == Time.zone.today 8 | %h2 In the Shop Today! 9 | -else 10 | %h2 In the Shop on #{date_long(@day)} 11 | -if @visits.empty? 12 | %p.list_status No visits for #{@day.to_s(:db)}. 13 | -else 14 | %p.list_status #{@visits.size} visitors. 15 | -[{:key => :patrons, :label => 'Visiting'}, {:key => :volunteers, :label => 'Volunteering'}].each do |group| 16 | -if @groups[group[:key]].empty? 17 | -next 18 | %h3 #{@groups[group[:key]].size} #{group[:label]} 19 | %table.visits 20 | -reset_cycle 21 | -for visit in @groups[group[:key]] 22 | - cycle_class = cycle('odd','even') 23 | - note_class = nil 24 | - if visit.note and visit.note.text 25 | - note_class = 'followed_by_note' 26 | %tr{:class => [cycle_class, note_class]} 27 | %td.full_name 28 | =link_to(visit.person.full_name, person_path(:id => visit.person)) 29 | %td.person_type 30 | = visit.person.person_type 31 | %td.time 32 | = time_short(visit.arrived_at) 33 | %td.action.edit 34 | =link_to 'Edit', edit_visit_path(:person_id => visit.person, :id => visit, :destination => day_visits_path) 35 | %td.action.remove 36 | =link_to 'Remove', visit_path(:person_id => visit.person, :id => visit, :destination => day_visits_path), :method => :delete 37 | - if visit.note 38 | %tr{:class => cycle_class} 39 | %td 40 | %td.note{:colspan => 4} 41 | = note_text(visit.note) 42 | 43 | %div.section 44 | %p 45 | See #{link_to "previous", day_visits_path(@day.yesterday)} 46 | -unless @day == Time.zone.today 47 | or #{link_to "next", day_visits_path(@day.tomorrow)} 48 | day. 49 | -------------------------------------------------------------------------------- /app/views/reports/visits.html.haml: -------------------------------------------------------------------------------- 1 | %div.flex-column 2 | %h1 3 | =link_to 'Reports', reports_path 4 | = ' : Visits' 5 | 6 | -form_tag report_path(:action => 'visits'), :method => :get do 7 | %ul 8 | =labeled_input 'Date Range', :for => 'date_from' do 9 | -capture do 10 | %span 11 | =calendar_date_select_tag "report[after]", @report[:after], :year_range => 10.years.ago..1.years.from_now 12 | %label{:for => 'report[after]'} Date From 13 | %span 14 | =calendar_date_select_tag "report[before]", @report[:before], :year_range => 10.years.ago..1.years.from_now 15 | %label{:for => 'report[before]'} Date To 16 | %p.instruct Leave one or both blank to search without date constraints. 17 | %li 18 | =submit_tag "Update" 19 | 20 | %div.flex-fullwidth 21 | %div.section 22 | -if @visits.empty? 23 | %div.list_status No visits for date range. 24 | -else 25 | %div.list_status #{@visits.to_a.size} of #{@visits.size} visits shown. 26 | %table 27 | %tr 28 | %th Name 29 | %th Type 30 | %th Volunteer 31 | %th Datetime 32 | %th Note 33 | -for visit in @visits 34 | %tr{:class => cycle('odd','even')} 35 | %td{:style => 'width:200px;'} 36 | =link_to(visit.person.full_name, person_path(:id => visit.person)) 37 | %td 38 | = visit.person.staff? ? 'Staff' : 'Patron' 39 | %td 40 | = visit.volunteer? 41 | %td 42 | = datetime_long(visit.arrived_at) 43 | %td.note{:style => 'width:360px;'} 44 | = note_text(visit.note) 45 | %tr.list_controls 46 | %td{:colspan => 5} 47 | -if @visits.next_page? || @visits.previous_page? 48 | %div.paginating_links 49 | More: #{paginating_links(@visits, :params => { :report => params[:report] } )} 50 | %div.export 51 | =link_to 'Export all', report_path(:action => 'visits', :params => { :report => params[:report], :format => 'csv' }) 52 | -------------------------------------------------------------------------------- /test/unit/organization_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class OrganizationTest < ActiveSupport::TestCase 4 | 5 | def test_key_validation 6 | assert !Organization.new.valid? 7 | assert Organization.new(:name => 'Name', :key => 'key').valid? 8 | assert Organization.new(:name => 'Name', :key => 'a_key').valid? 9 | assert !Organization.new(:name => 'Name', :key => 'a key').valid? 10 | assert !Organization.new(:name => 'Name', :key => 'a').valid? 11 | assert !Organization.new(:name => 'Name', :key => 'a_very_long_key_is_invalid').valid? 12 | assert !Organization.new(:name => 'Name', :key => 'sfbk').valid? # unique 13 | end 14 | 15 | def test_find_by_key 16 | assert_equal organizations(:sfbk), Organization.find_by_key('sfbk') 17 | end 18 | 19 | def test_timezone 20 | assert_equal "Pacific Time (US & Canada)", Organization.new(:name => 'Name', :key => 'key').timezone 21 | assert_equal "Eastern Time (US & Canada)", Organization.new(:name => 'Name', :key => 'key', :timezone => 'Eastern Time (US & Canada)').timezone 22 | 23 | assert !Organization.new(:name => 'Name', :key => 'key', :timezone => 'invalid').valid? 24 | assert Organization.new(:name => 'Name', :key => 'key', :timezone => 'London').valid? 25 | end 26 | 27 | def test_last_visit 28 | assert_equal organizations(:sfbk).last_visit.arrived_at, Time.zone.parse('2007-02-02 18:02') 29 | assert_nil organizations(:cbi).last_visit 30 | end 31 | 32 | def test_active? 33 | assert organizations(:sfbk).active?(Time.zone.parse '2007-02-28') 34 | assert !organizations(:sfbk).active?(Time.zone.parse '2007-04-01') 35 | assert !organizations(:cbi).active?(Time.zone.parse '2007-02-02') 36 | end 37 | 38 | def test_visits_count 39 | assert organizations(:sfbk).visits_count > 100 40 | end 41 | 42 | context 'Organization with tags' do 43 | should 'find all tag names in use' do 44 | assert_equal ['key holder', 'mechanic', 'mom'], organizations(:sfbk).tag_list 45 | end 46 | 47 | should 'find all tags in use' do 48 | assert_equal 3, organizations(:sfbk).tags.length 49 | end 50 | end 51 | end 52 | 53 | -------------------------------------------------------------------------------- /lib/named_scope_extensions.rb: -------------------------------------------------------------------------------- 1 | module NamedScope 2 | # Provides Model.paginate(options={}) to allow 3 | # the paginating_find plugin to be used with named_scopes. 4 | # 5 | # Usage: 6 | # acts_as_paginated 7 | # acts_as_paginated :page => 2, size => 10 8 | module PaginatingFind #:nodoc: 9 | 10 | def self.included(mod) 11 | mod.extend(ClassMethods) 12 | end 13 | 14 | module ClassMethods 15 | def acts_as_paginated(options={ :page => 1, :size => 20}) 16 | cattr_accessor :paginate_defaults 17 | self.paginate_defaults = options 18 | 19 | self.class_eval do 20 | extend NamedScope::PaginatingFind::SingletonMethods 21 | end 22 | end 23 | end 24 | 25 | module SingletonMethods 26 | def paginate(args={}) 27 | options = self.paginate_defaults.clone 28 | options[:page] = args[:page].to_i if args[:page] 29 | options[:size] = args[:size].to_i if args[:size] 30 | find(:all, :page => { :size => options[:size], :current => options[:page], :first => 1 }) 31 | end 32 | end 33 | end 34 | 35 | # Provides Model.chain_finders(finders={}) to enable dynamic chaining of 36 | # named_scope finders. 37 | # 38 | # Usage: 39 | # chains_finders 40 | # 41 | # Model.chain_finders(:after => Date.today, :belonging_to => User.current_user) 42 | module ChainsFinders #:nodoc: 43 | 44 | def self.included(mod) 45 | mod.extend(ClassMethods) 46 | end 47 | 48 | module ClassMethods 49 | def chains_finders(options={}) 50 | self.class_eval do 51 | extend NamedScope::ChainsFinders::SingletonMethods 52 | end 53 | end 54 | end 55 | 56 | module SingletonMethods 57 | def chain_finders(finders={}) 58 | target = self 59 | finders.each do |name, args| 60 | target = target.send name, args 61 | end 62 | target 63 | end 64 | end 65 | end 66 | end 67 | 68 | ActiveRecord::Base.send(:include, NamedScope::PaginatingFind) 69 | ActiveRecord::Base.send(:include, NamedScope::ChainsFinders) --------------------------------------------------------------------------------