aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-09 13:03:04 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-10 11:18:07 +0200
commitd70b433c2d639c3e373dbb8a148b8f494d84a10e (patch)
treef75423aea32a2daeab561823be5938e60ad742ba /site/config
parent.gitignore file (diff)
downloadcouncil-webapp-d70b433c2d639c3e373dbb8a148b8f494d84a10e.tar.gz
council-webapp-d70b433c2d639c3e373dbb8a148b8f494d84a10e.tar.bz2
council-webapp-d70b433c2d639c3e373dbb8a148b8f494d84a10e.zip
A plain hobo application
Diffstat (limited to 'site/config')
-rw-r--r--site/config/application.rb45
-rw-r--r--site/config/boot.rb13
-rw-r--r--site/config/environment.rb5
-rw-r--r--site/config/environments/development.rb26
-rw-r--r--site/config/environments/production.rb49
-rw-r--r--site/config/environments/test.rb35
-rw-r--r--site/config/hobo_routes.rb29
-rw-r--r--site/config/initializers/backtrace_silencers.rb7
-rw-r--r--site/config/initializers/dryml_taglibs.rb1
-rw-r--r--site/config/initializers/inflections.rb10
-rw-r--r--site/config/initializers/mime_types.rb5
-rw-r--r--site/config/initializers/secret_token.rb7
-rw-r--r--site/config/initializers/session_store.rb8
-rw-r--r--site/config/locales/app.en.yml25
-rw-r--r--site/config/locales/hobo.en.yml194
-rw-r--r--site/config/routes.rb62
16 files changed, 521 insertions, 0 deletions
diff --git a/site/config/application.rb b/site/config/application.rb
new file mode 100644
index 0000000..2b15039
--- /dev/null
+++ b/site/config/application.rb
@@ -0,0 +1,45 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Council
+ class Application < Rails::Application
+
+ config.hobo.dryml_only_templates = true
+
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
diff --git a/site/config/boot.rb b/site/config/boot.rb
new file mode 100644
index 0000000..ab6cb37
--- /dev/null
+++ b/site/config/boot.rb
@@ -0,0 +1,13 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
diff --git a/site/config/environment.rb b/site/config/environment.rb
new file mode 100644
index 0000000..4bc0d55
--- /dev/null
+++ b/site/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Council::Application.initialize!
diff --git a/site/config/environments/development.rb b/site/config/environments/development.rb
new file mode 100644
index 0000000..691e1b5
--- /dev/null
+++ b/site/config/environments/development.rb
@@ -0,0 +1,26 @@
+Council::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the webserver when you make code changes.
+ config.cache_classes = false
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+end
+
diff --git a/site/config/environments/production.rb b/site/config/environments/production.rb
new file mode 100644
index 0000000..68f5e85
--- /dev/null
+++ b/site/config/environments/production.rb
@@ -0,0 +1,49 @@
+Council::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The production environment is meant for finished, "live" apps.
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Specifies the header that your server uses for sending files
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
+
+ # For nginx:
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
+
+ # If you have no front-end server that supports something like X-Sendfile,
+ # just comment this out and Rails will serve the files
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Disable Rails's static asset server
+ # In production, Apache or nginx will already do this
+ config.serve_static_assets = false
+
+ # Enable serving of images, stylesheets, and javascripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
diff --git a/site/config/environments/test.rb b/site/config/environments/test.rb
new file mode 100644
index 0000000..c2fc237
--- /dev/null
+++ b/site/config/environments/test.rb
@@ -0,0 +1,35 @@
+Council::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+end
diff --git a/site/config/hobo_routes.rb b/site/config/hobo_routes.rb
new file mode 100644
index 0000000..dde7225
--- /dev/null
+++ b/site/config/hobo_routes.rb
@@ -0,0 +1,29 @@
+# This is an auto-generated file: don't edit!
+# You can add your own routes in the config/routes.rb file
+# which will override the routes in this file.
+
+Council::Application.routes.draw do
+
+
+ # Lifecycle routes for controller "users"
+ post 'users/signup(.:format)' => 'users#do_signup', :as => 'do_user_signup'
+ get 'users/signup(.:format)' => 'users#signup', :as => 'user_signup'
+ put 'users/:id/reset_password(.:format)' => 'users#do_reset_password', :as => 'do_user_reset_password'
+ get 'users/:id/reset_password(.:format)' => 'users#reset_password', :as => 'user_reset_password'
+
+ # Resource routes for controller "users"
+ get 'users/:id/edit(.:format)' => 'users#edit', :as => 'edit_user'
+ get 'users/:id(.:format)' => 'users#show', :as => 'user', :constraints => { :id => %r([^/.?]+) }
+ post 'users(.:format)' => 'users#create', :as => 'create_user'
+ put 'users/:id(.:format)' => 'users#update', :as => 'update_user', :constraints => { :id => %r([^/.?]+) }
+ delete 'users/:id(.:format)' => 'users#destroy', :as => 'destroy_user', :constraints => { :id => %r([^/.?]+) }
+
+ # Show action routes for controller "users"
+ get 'users/:id/account(.:format)' => 'users#account', :as => 'user_account'
+
+ # User routes for controller "users"
+ match 'login(.:format)' => 'users#login', :as => 'user_login'
+ get 'logout(.:format)' => 'users#logout', :as => 'user_logout'
+ match 'forgot_password(.:format)' => 'users#forgot_password', :as => 'user_forgot_password'
+
+end
diff --git a/site/config/initializers/backtrace_silencers.rb b/site/config/initializers/backtrace_silencers.rb
new file mode 100644
index 0000000..59385cd
--- /dev/null
+++ b/site/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/site/config/initializers/dryml_taglibs.rb b/site/config/initializers/dryml_taglibs.rb
new file mode 100644
index 0000000..89b2d39
--- /dev/null
+++ b/site/config/initializers/dryml_taglibs.rb
@@ -0,0 +1 @@
+Dryml.precompile_taglibs if File.basename($0) != "rake" && Rails.env.production?
diff --git a/site/config/initializers/inflections.rb b/site/config/initializers/inflections.rb
new file mode 100644
index 0000000..9e8b013
--- /dev/null
+++ b/site/config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
diff --git a/site/config/initializers/mime_types.rb b/site/config/initializers/mime_types.rb
new file mode 100644
index 0000000..72aca7e
--- /dev/null
+++ b/site/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
diff --git a/site/config/initializers/secret_token.rb b/site/config/initializers/secret_token.rb
new file mode 100644
index 0000000..79ea814
--- /dev/null
+++ b/site/config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Council::Application.config.secret_token = 'c1d15e022f0587a728fa354816d19fcfe7781092dbde9e19e7da9cee986f09e3a4f067d1692fa05bb7ca1e1cf90fc2e8f9a2c4a74c8f3efcac6f3170978dfd20'
diff --git a/site/config/initializers/session_store.rb b/site/config/initializers/session_store.rb
new file mode 100644
index 0000000..3485dec
--- /dev/null
+++ b/site/config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Council::Application.config.session_store :cookie_store, :key => '_Council_session'
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rails generate session_migration")
+# Council::Application.config.session_store :active_record_store
diff --git a/site/config/locales/app.en.yml b/site/config/locales/app.en.yml
new file mode 100644
index 0000000..26256ec
--- /dev/null
+++ b/site/config/locales/app.en.yml
@@ -0,0 +1,25 @@
+# Even if you only support one language, you can use this file to customise the names that appear in the UI
+# e.g.
+
+en:
+ hello: "Hello world"
+
+# attributes:
+# created_at: Created at
+# updated_at: Updated at
+#
+# activerecord:
+# models:
+# user:
+# one: User
+# other: Users
+# attributes:
+# user:
+# name: Name
+# password: Password
+# current_password: Current Password
+# password_confirmation: Password Confirmation
+# email_address: Email Address
+# attribute_help:
+# user:
+# email_address: We will never share your address with third parties
diff --git a/site/config/locales/hobo.en.yml b/site/config/locales/hobo.en.yml
new file mode 100644
index 0000000..bff123f
--- /dev/null
+++ b/site/config/locales/hobo.en.yml
@@ -0,0 +1,194 @@
+# Hobo internals translation file for English
+en:
+ hobo:
+ # default hobo pages translations
+ index:
+ # if you uncomment the following you will loose the automatic selection of dinamically pluralized nav-tabs
+ # if you need a different title you should implement a different way to select the tab on your own
+ #title: "%{model} Index"
+ heading: "%{model} Index"
+
+ new:
+ title: "New %{model}"
+ heading: "New %{model}"
+
+ show:
+ title: "%{model}"
+ heading: "%{model} %{name}"
+ back_link: "Back"
+ edit_link: "Edit %{model}"
+ new_link: "New %{model}"
+ add_form_heading: "Add %{model}"
+
+ edit:
+ title: "Edit %{model}"
+ heading: "Edit %{model}"
+
+ index_for_owner:
+ title: "%{model} for"
+ # be aware that you will loose the automatic Your <collection> / Jom's <collection>
+ # default output for User models
+ # you better define the heading.* in the specific collection namespace
+ #heading:
+ subheading: "For:"
+
+ new_for_owner:
+ title: "New %{model} for"
+ heading: "New %{model}"
+ subheading: "For:"
+
+ login:
+ title: "Login"
+ heading: "Login"
+ email_address: &email_address "E-mail"
+ name: "Name"
+ password: "Password"
+ remember_me: "Remember me"
+ login: "Login"
+ signup: "Signup"
+ forgot_password: &forgot_password "Forgotten password?"
+
+ signup:
+ title: "Signup"
+ heading: "Signup new user"
+
+ forgot_password:
+ title: *forgot_password
+ heading: *forgot_password
+ text: "Enter the e-mail address you used when you signed up for this site.
+ We will then send you an e-mail that you can use to generate a new password."
+ email_address: *email_address
+ send: "Send"
+
+ forgot_password_sent:
+ title: "Forgotten password - E-mail sent"
+ heading: "Forgotten password - E-mail sent"
+ text: "An e-mail with instructions on how you generate a new password has been sent to %{email_address}. If you don't receive this e-mail please check your spamfilter."
+
+ account_disabled_page:
+ title: "Account disabled"
+ heading: "Account disabled"
+ text: "Your account is disabled at this time."
+
+ account_page:
+ title: "Your Account"
+ heading: "Your Account"
+ new_password: "New Password"
+ confirm_new_password: "Confirm New Password"
+
+ # default hobo action translation
+ # The action with added model variable are new, create, delete, save,
+ # edit and back_to_parent
+ actions:
+ new: "New %{model}"
+ create: "Create %{model}"
+ previous: "Previous"
+ next: "Next"
+ add: "Add"
+ show_all: "Show all %{model}..."
+ delete: "Delete %{model}"
+ save: "Save %{model}"
+ cancel: "Cancel"
+ edit: "Edit %{model}"
+ back: "Back to"
+ back_to_parent: "Back to %{parent} %{name}"
+ send: "Send"
+ remove: "Remove"
+ signup: "Signup"
+ login: "Login"
+ logout: "Log out"
+ logged_in_as: "Logged in as %{name}"
+ account: "Account"
+ save_account: "Save Your Data"
+
+ # default hobo message translation
+ messages:
+ create:
+ success: "The %{model} was created successfully"
+ error: "Couldn't create the %{model}.\n%{errors}"
+ creator:
+ error: "Couldn't do creator %{name}.\n%{errors}"
+ transition:
+ error: "Couldn't do transition %{name}.\n%{errors}"
+ update:
+ no_attribute_error: "No update specified in params"
+ success: "Changes to the %{model} were saved"
+ error: "There was a problem with that change.\n%{errors}"
+ destroy:
+ success: "The %{model} was deleted"
+ signup:
+ success: "Thanks for signing up!"
+ must_activate: "You must activate your account before you can log in. Please check your email."
+ login:
+ success: "You have logged in."
+ error: "You did not provide a valid %{login} and Password!"
+ logout: "You have logged out."
+ reset_password: "Your password has been reset."
+ permission_denied: "Permission Denied"
+ not_found: "The page you requested cannot be found."
+ unauthenticated: "Couldn't authenticate you"
+ validate_password: "must be at least 6 characters long and must not consist solely of lowercase letters"
+ current_password_is_not_correct: "is not correct"
+ you_are_site_admin: "You are now the site administrator"
+ you_signed_up: "You have signed up"
+ no: "No %{model} available."
+ confirm: "Are you sure?"
+
+ # default hobo collection translation
+ collection:
+ count: &collection_count
+ zero: &no_model "No %{model}"
+ one: "There is only one %{model} at the moment"
+ other: "There are already %{count} %{model}"
+ # you can use the following to completely override the collection heading
+ # be aware that you will loose the automatic Your <collection> / Jom's <collection>
+ # default output for User models
+ # you better define the heading.* in the specific collection namespace
+ #heading:
+ add_form_heading: "Add %{model}"
+ empty_message: "No records to display"
+
+ # default hobo form translation
+ form:
+ new:
+ heading: "New %{model}"
+ error:
+ heading: "The following error occured:"
+ select_many:
+ prompt: "Add %{model}"
+
+ # hobo support
+ support:
+ or: "or"
+ a: "a"
+ an: "an"
+
+ table_plus:
+ search: "Search"
+ submit_label: "Go"
+
+ live_search:
+ label: "Search"
+ results_label: "Search Results"
+ close_button: "close"
+ no_results: "Your search returned no matches."
+
+ dev_user_changer:
+ guest: "Guest"
+
+ admin:
+ subsite_name: "Admin"
+ invite_new_user: "Invite a new user"
+
+ subsite:
+ back_link: "View Site"
+
+ boolean_yes: "Yes"
+ boolean_no: "No"
+ password_hidden: "[password hidden]"
+
+ in_place_editor:
+ click_to_edit: "(click to edit)"
+
+ select_one_editor:
+ blank_message: *no_model
diff --git a/site/config/routes.rb b/site/config/routes.rb
new file mode 100644
index 0000000..e36d680
--- /dev/null
+++ b/site/config/routes.rb
@@ -0,0 +1,62 @@
+Council::Application.routes.draw do
+ root :to => 'front#index'
+
+ match 'search' => 'front#search', :as => 'site_search'
+
+ # The priority is based upon order of creation:
+ # first created -> highest priority.
+
+ # Sample of regular route:
+ # match 'products/:id' => 'catalog#view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Sample resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Sample resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Sample resource route with more complex sub-resources
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', :on => :collection
+ # end
+ # end
+
+ # Sample resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+
+ # You can have the root of your site routed with "root"
+ # just remember to delete public/index.html.
+ # root :to => "welcome#index"
+
+ # See how all your routes lay out with "rake routes"
+
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
+ # Note: This route will make all actions in every controller accessible via GET requests.
+ # match ':controller(/:action(/:id(.:format)))'
+end