Skip to content
Browse files

Converted tolk to mountable engine

2 tests still fail and integration tests must be run with selenium
because of bug in capybara.
  • Loading branch information...
1 parent 863399b commit 7e06bea0d791d8a184da3e526a850081c9bed9bb @drogus drogus committed Sep 12, 2010
Showing with 66,881 additions and 283 deletions.
  1. +4 −1 .gitignore
  2. +16 −0 Gemfile
  3. +36 −7 Rakefile
  4. +1 −1 app/controllers/tolk/application_controller.rb
  5. +1 −1 app/models/tolk/locale.rb
  6. +1 −1 app/views/layouts/tolk/application.html.erb
  7. +1 −1 app/views/tolk/locales/all.html.erb
  8. +0 −1 app/views/tolk/locales/index.html.erb
  9. +3 −3 app/views/tolk/locales/show.html.erb
  10. +1 −1 app/views/tolk/searches/show.html.erb
  11. +0 −109 config/boot.rb
  12. +0 −16 config/environment.rb
  13. +0 −17 config/environments/development.rb
  14. +0 −24 config/environments/production.rb
  15. +0 −22 config/environments/test.rb
  16. +0 −1 config/initializers/mime_types.rb
  17. +0 −17 config/initializers/new_rails_defaults.rb
  18. +8 −5 config/routes.rb
  19. +2 −0 lib/tolk.rb
  20. +1 −1 lib/tolk/engine.rb
  21. +7 −0 test/dummy/Rakefile
  22. +3 −0 test/dummy/app/controllers/application_controller.rb
  23. +2 −0 test/dummy/app/helpers/application_helper.rb
  24. +14 −0 test/dummy/app/views/layouts/application.html.erb
  25. +4 −0 test/dummy/config.ru
  26. +45 −0 test/dummy/config/application.rb
  27. +10 −0 test/dummy/config/boot.rb
  28. 0 { → test/dummy}/config/database.yml
  29. +5 −0 test/dummy/config/environment.rb
  30. +26 −0 test/dummy/config/environments/development.rb
  31. +49 −0 test/dummy/config/environments/production.rb
  32. +35 −0 test/dummy/config/environments/test.rb
  33. +7 −0 test/dummy/config/initializers/backtrace_silencers.rb
  34. +1 −1 { → test/dummy}/config/initializers/inflections.rb
  35. +5 −0 test/dummy/config/initializers/mime_types.rb
  36. +7 −0 test/dummy/config/initializers/secret_token.rb
  37. +8 −0 test/dummy/config/initializers/session_store.rb
  38. 0 test/dummy/config/locales/sync/.gitkeep
  39. +3 −0 test/dummy/config/routes.rb
  40. BIN test/dummy/db/development.sqlite3
  41. 0 test/dummy/db/migrate/.gitkeep
  42. +13 −0 test/dummy/db/migrate/20100912123407_create_phrases.blog.rb
  43. +13 −0 test/dummy/db/migrate/20100912123408_create_locales.blog.rb
  44. +15 −0 test/dummy/db/migrate/20100912123409_create_translations.blog.rb
  45. +14 −0 test/dummy/db/migrate/20100912123410_create_systems.blog.rb
  46. +9 −0 test/dummy/db/migrate/20100912123411_add_system_to_locale.blog.rb
  47. +11 −0 test/dummy/db/migrate/20100912123412_rename_systems_to_applications.blog.rb
  48. +9 −0 test/dummy/db/migrate/20100912123413_add_application_id_to_phrases.blog.rb
  49. +19 −0 test/dummy/db/migrate/20100912123414_drop_applications.blog.rb
  50. +11 −0 test/dummy/db/migrate/20100912123415_add_updated_stuff.blog.rb
  51. +13 −0 test/dummy/db/migrate/20100912123416_rename_tables.blog.rb
  52. +11 −0 test/dummy/db/migrate/20100912123417_add_missing_indices.blog.rb
  53. +41 −0 test/dummy/db/schema.rb
  54. BIN test/dummy/db/test.sqlite3
  55. +618 −0 test/dummy/log/development.log
  56. 0 test/dummy/log/production.log
  57. 0 test/dummy/log/server.log
  58. +56,357 −0 test/dummy/log/test.log
  59. +26 −0 test/dummy/public/404.html
  60. +26 −0 test/dummy/public/422.html
  61. +26 −0 test/dummy/public/500.html
  62. 0 test/dummy/public/favicon.ico
  63. +2 −0 test/dummy/public/javascripts/application.js
  64. +965 −0 test/dummy/public/javascripts/controls.js
  65. +974 −0 test/dummy/public/javascripts/dragdrop.js
  66. +1,123 −0 test/dummy/public/javascripts/effects.js
  67. +6,001 −0 test/dummy/public/javascripts/prototype.js
  68. +175 −0 test/dummy/public/javascripts/rails.js
  69. 0 test/dummy/public/stylesheets/.gitkeep
  70. +6 −0 test/dummy/script/rails
  71. +3 −0 test/integration/authentication_test.rb
  72. +9 −9 test/integration/translation_process_test.rb
  73. +2 −2 test/locales/basic/da.yml
  74. +1 −1 test/locales/basic/se.yml
  75. +12 −0 test/support/active_record_shared_connections.rb
  76. +6 −0 test/support/integration_case.rb
  77. +8 −0 test/support/test_case.rb
  78. +21 −15 test/test_helper.rb
  79. +3 −3 test/unit/format_test.rb
  80. +9 −7 test/unit/locale_test.rb
  81. +20 −14 test/unit/sync_test.rb
  82. +3 −2 test/unit/translation_test.rb
View
5 .gitignore
@@ -1 +1,4 @@
-tmp/**/*
+tmp/**/*
+test/dummy/db/migrate/*.tolk.rb
+Gemfile.lock
+.bundle
View
16 Gemfile
@@ -1 +1,17 @@
+source "http://rubygems.org"
+
+gem "rails", :git => "http://github.com/rails/rails.git"
+gem "arel", :git => "http://github.com/rails/arel.git"
+
gem 'will_paginate', :git => 'http://github.com/mislav/will_paginate.git', :branch => 'rails3'
+gem "ya2yaml"
+
+gem "factory_girl_rails"
+gem "capybara", ">= 0.3.9"
+gem "sqlite3-ruby", :require => "sqlite3"
+gem "mocha"
+
+if RUBY_VERSION < '1.9'
+ gem "ruby-debug", ">= 0.10.3"
+end
+
View
43 Rakefile
@@ -1,10 +1,39 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
+# encoding: UTF-8
require 'rake'
-require 'rake/testtask'
require 'rake/rdoctask'
+require 'rake/gempackagetask'
+
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+task :default => :test
+
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Tolk'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+spec = Gem::Specification.new do |s|
+ s.name = "tolk"
+ s.summary = "Rails engine providing web interface for managing i18n yaml files"
+ s.description = "Tolk is a web interface for doing i18n translations packaged as an engine for Rails applications."
+ s.files = FileList["[A-Z]*", "lib/**/*"]
+ s.version = "2.0.0.beta"
+end
+
+Rake::GemPackageTask.new(spec) do |pkg|
+end
-require 'tasks/rails'
+desc "Install the gem #{spec.name}-#{spec.version}.gem"
+task :install do
+ system("gem install pkg/#{spec.name}-#{spec.version}.gem --no-ri --no-rdoc")
+end
View
2 app/controllers/tolk/application_controller.rb
@@ -11,7 +11,7 @@ def authenticate
end
def ensure_no_primary_locale
- redirect_to tolk_locales_path if @locale.primary?
+ redirect_to tolk.locales_path if @locale.primary?
end
end
end
View
2 app/models/tolk/locale.rb
@@ -133,7 +133,7 @@ def phrases_without_translation(page = nil, options = {})
existing_ids = self.translations.all(:select => 'tolk_translations.phrase_id').map(&:phrase_id).uniq
phrases = phrases.scoped(:conditions => ['tolk_phrases.id NOT IN (?)', existing_ids]) if existing_ids.present?
- result = phrases.paginate({:page => page}.merge(options))
+ result = phrases.paginate({:page => page, :per_page => Phrase.per_page}.merge(options))
Tolk::Phrase.send :preload_associations, result, :translations
result
end
View
2 app/views/layouts/tolk/application.html.erb
@@ -19,7 +19,7 @@
<body>
<div id="container">
<div id="head">
- <h1><span class="home"><%= link_to "Tolk", tolk_root_path %></span><%= yield :locale %></h1>
+ <h1><span class="home"><%= link_to "Tolk", tolk.root_path %></span><%= yield :locale %></h1>
</div>
<%= yield %>
</div>
View
2 app/views/tolk/locales/all.html.erb
@@ -4,7 +4,7 @@
<h3 class="switch">Completed translations <span>(<%= link_to 'See phrases missing translation', @locale %>)</span></h3>
<% if @locale.has_updated_translations? && action_name != 'updated' %>
- <span class="notice">Some phrases have changed. <%= link_to "Update translations", updated_tolk_locale_path(@locale) %>.</span>
+ <span class="notice">Some phrases have changed. <%= link_to "Update translations", tolk.updated_locale_path(@locale) %>.</span>
<% end %>
<div class="search">
View
1 app/views/tolk/locales/index.html.erb
@@ -21,7 +21,6 @@
<% end %>
<%= form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
- <%= f.error_messages %>
<p>
<%= f.label "Add a new Locale" %>
<select id="select_tolk_locale_name" name="tolk_locale[name]">
View
6 app/views/tolk/locales/show.html.erb
@@ -3,13 +3,13 @@
<% end %>
<% content_for :head do %>
- <link rel="alternate" type="application/rss+xml" title="RSS" href="<%= tolk_locale_path(@locale, :format => 'atom') -%>" />
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="<%= tolk.locale_path(@locale, :format => 'atom') -%>" />
<% end %>
-<h3 class="switch">Phrases missing translation (<%= @locale.count_phrases_without_translation %>) <span>(<%= link_to 'See completed translations', all_tolk_locale_path(@locale) %>)</span></h3>
+<h3 class="switch">Phrases missing translation (<%= @locale.count_phrases_without_translation %>) <span>(<%= link_to 'See completed translations', tolk.all_locale_path(@locale) %>)</span></h3>
<% if @locale.has_updated_translations? && action_name != 'updated' %>
- <span class="notice">Some phrases have changed. <%= link_to "Update translations", updated_tolk_locale_path(@locale) %>.</span>
+ <span class="notice">Some phrases have changed. <%= link_to "Update translations", tolk.updated_locale_path(@locale) %>.</span>
<% end %>
<div class="search">
View
2 app/views/tolk/searches/show.html.erb
@@ -9,7 +9,7 @@
<div class="search_exits">
<%= link_to "Phrases missing translation", @locale %>
&nbsp;
- <%= link_to "Completed translations", all_tolk_locale_path(@locale) %>
+ <%= link_to "Completed translations", tolk.all_locale_path(@locale) %>
</div>
<div class="translations">
View
109 config/boot.rb
@@ -1,109 +0,0 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.1.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
View
16 config/environment.rb
@@ -1,16 +0,0 @@
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- config.time_zone = 'UTC'
-
- config.action_controller.session = {
- :session_key => '_tolk_session',
- :secret => 'f2d72b63242db79df080031c60159a419981cc6c066e961405c1a86c5c38ba56c960d6de171dc4cf985f1544c00466400abf0aac2ce1cbdb726f6127d304fb07'
- }
-end
-
-$KCODE = 'UTF8'
-require 'ya2yaml'
View
17 config/environments/development.rb
@@ -1,17 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.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.action_controller.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
View
24 config/environments/production.rb
@@ -1,24 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The production environment is meant for finished, "live" apps.
-# Code is not reloaded between requests
-config.cache_classes = true
-
-# Enable threaded mode
-# config.threadsafe!
-
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
-
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-
-# Use a different cache store in production
-# config.cache_store = :mem_cache_store
-
-# 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
View
22 config/environments/test.rb
@@ -1,22 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.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.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = 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
View
1 config/initializers/mime_types.rb
@@ -1 +0,0 @@
-Mime::Type.register_alias "text/yaml", :yml
View
17 config/initializers/new_rails_defaults.rb
@@ -1,17 +0,0 @@
-# These settings change the behavior of Rails 2 apps and will be defaults
-# for Rails 3. You can remove this initializer when Rails 3 is released.
-
-if defined?(ActiveRecord)
- # Include Active Record class name as root for JSON serialized output.
- ActiveRecord::Base.include_root_in_json = true
-
- # Store the full class name (including module namespace) in STI type column.
- ActiveRecord::Base.store_full_sti_class = true
-end
-
-# Use ISO 8601 format for JSON serialized times and dates.
-ActiveSupport.use_standard_json_time_format = true
-
-# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
-# if you're including raw json in an HTML page.
-ActiveSupport.escape_html_entities_in_json = false
View
13 config/routes.rb
@@ -1,7 +1,10 @@
-Rails.application.routes.draw do |map|
- map.namespace('tolk') do |tolk|
- tolk.root :controller => 'locales'
- tolk.resources :locales, :member => {:all => :get, :updated => :get}
- tolk.resource :search
+Tolk::Engine.routes.draw do
+ root :to => 'locales#index'
+ resources :locales do
+ member do
+ get :all
+ get :updated
+ end
end
+ resource :search
end
View
2 lib/tolk.rb
@@ -1,6 +1,8 @@
require 'will_paginate'
require 'ya2yaml'
require 'tolk/engine'
+require 'tolk/sync'
+require 'tolk/import'
module Tolk
end
View
2 lib/tolk/engine.rb
@@ -2,6 +2,6 @@
module Tolk
class Engine < Rails::Engine
- engine_name :tolk
+ namespace Tolk
end
end
View
7 test/dummy/Rakefile
@@ -0,0 +1,7 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+require 'rake'
+
+Dummy::Application.load_tasks
View
3 test/dummy/app/controllers/application_controller.rb
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
View
2 test/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
View
14 test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Dummy</title>
+ <%= stylesheet_link_tag :all %>
+ <%= javascript_include_tag :defaults %>
+ <%= csrf_meta_tag %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
View
4 test/dummy/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Dummy::Application
View
45 test/dummy/config/application.rb
@@ -0,0 +1,45 @@
+require File.expand_path('../boot', __FILE__)
+
+require "active_model/railtie"
+require "active_record/railtie"
+require "action_controller/railtie"
+require "action_view/railtie"
+require "action_mailer/railtie"
+
+Bundler.require
+require "tolk"
+
+module Dummy
+ class Application < Rails::Application
+ # 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
View
10 test/dummy/config/boot.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+gemfile = File.expand_path('../../../../Gemfile', __FILE__)
+
+if File.exist?(gemfile)
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+end
+
+$:.unshift File.expand_path('../../../../lib', __FILE__)
View
0 config/database.yml → test/dummy/config/database.yml
File renamed without changes.
View
5 test/dummy/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Dummy::Application.initialize!
View
26 test/dummy/config/environments/development.rb
@@ -0,0 +1,26 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.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
+
View
49 test/dummy/config/environments/production.rb
@@ -0,0 +1,49 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.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
View
35 test/dummy/config/environments/test.rb
@@ -0,0 +1,35 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.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
View
7 test/dummy/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!
View
2 config/initializers/inflections.rb → .../dummy/config/initializers/inflections.rb
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
+# 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'
View
5 test/dummy/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
View
7 test/dummy/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.
+Dummy::Application.config.secret_token = '15bf55619161ab494a0d716093754246f33c4ee07881afbf4d96b65d81075184aa798ce676d3a0b1b662ef8407e274e2a7b892721165cbac3ca72de3e9d882b1'
View
8 test/dummy/config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Dummy::Application.config.session_store :cookie_store, :key => '_dummy_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 "rake db:sessions:create")
+# Dummy::Application.config.session_store :active_record_store
View
0 test/dummy/config/locales/sync/.gitkeep
No changes.
View
3 test/dummy/config/routes.rb
@@ -0,0 +1,3 @@
+Dummy::Application.routes.draw do
+ mount Tolk::Engine => "/tolk"
+end
View
BIN test/dummy/db/development.sqlite3
Binary file not shown.
View
0 test/dummy/db/migrate/.gitkeep
No changes.
View
13 test/dummy/db/migrate/20100912123407_create_phrases.blog.rb
@@ -0,0 +1,13 @@
+class CreatePhrases < ActiveRecord::Migration
+ def self.up
+ create_table :phrases do |t|
+ t.text :key
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :phrases
+ end
+end
View
13 test/dummy/db/migrate/20100912123408_create_locales.blog.rb
@@ -0,0 +1,13 @@
+class CreateLocales < ActiveRecord::Migration
+ def self.up
+ create_table :locales do |t|
+ t.string :name
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :locales
+ end
+end
View
15 test/dummy/db/migrate/20100912123409_create_translations.blog.rb
@@ -0,0 +1,15 @@
+class CreateTranslations < ActiveRecord::Migration
+ def self.up
+ create_table :translations do |t|
+ t.references :phrase
+ t.references :locale
+ t.text :text
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :translations
+ end
+end
View
14 test/dummy/db/migrate/20100912123410_create_systems.blog.rb
@@ -0,0 +1,14 @@
+class CreateSystems < ActiveRecord::Migration
+ def self.up
+ create_table :systems do |t|
+ t.string :name
+ t.text :location
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :systems
+ end
+end
View
9 test/dummy/db/migrate/20100912123411_add_system_to_locale.blog.rb
@@ -0,0 +1,9 @@
+class AddSystemToLocale < ActiveRecord::Migration
+ def self.up
+ add_column :locales, :system_id, :integer
+ end
+
+ def self.down
+ remove_column :locales, :system
+ end
+end
View
11 test/dummy/db/migrate/20100912123412_rename_systems_to_applications.blog.rb
@@ -0,0 +1,11 @@
+class RenameSystemsToApplications < ActiveRecord::Migration
+ def self.up
+ rename_table :systems, :applications
+ rename_column :locales, :system_id, :application_id
+ end
+
+ def self.down
+ rename_table :applications, :systems
+ rename_column :locales, :application_id, :system_id
+ end
+end
View
9 test/dummy/db/migrate/20100912123413_add_application_id_to_phrases.blog.rb
@@ -0,0 +1,9 @@
+class AddApplicationIdToPhrases < ActiveRecord::Migration
+ def self.up
+ add_column :phrases, :application_id, :integer
+ end
+
+ def self.down
+ remove_column :phrases, :application_id
+ end
+end
View
19 test/dummy/db/migrate/20100912123414_drop_applications.blog.rb
@@ -0,0 +1,19 @@
+class DropApplications < ActiveRecord::Migration
+ def self.up
+ drop_table :applications
+ remove_column :locales, :application_id
+ remove_column :phrases, :application_id
+ end
+
+ def self.down
+ create_table :applications do |t|
+ t.string :name
+ t.text :location
+
+ t.timestamps
+ end
+
+ add_column :locales, :application_id, :integer
+ add_column :phrases, :application_id, :integer
+ end
+end
View
11 test/dummy/db/migrate/20100912123415_add_updated_stuff.blog.rb
@@ -0,0 +1,11 @@
+class AddUpdatedStuff < ActiveRecord::Migration
+ def self.up
+ add_column :translations, :primary_updated, :boolean, :default => false
+ add_column :translations, :previous_text, :text
+ end
+
+ def self.down
+ remove_column :translations, :previous_text
+ remove_column :translations, :primary_updated
+ end
+end
View
13 test/dummy/db/migrate/20100912123416_rename_tables.blog.rb
@@ -0,0 +1,13 @@
+class RenameTables < ActiveRecord::Migration
+ def self.up
+ rename_table :locales, :tolk_locales
+ rename_table :phrases, :tolk_phrases
+ rename_table :translations, :tolk_translations
+ end
+
+ def self.down
+ rename_table :tolk_locales, :locales
+ rename_table :tolk_phrases, :phrases
+ rename_table :tolk_translations, :translations
+ end
+end
View
11 test/dummy/db/migrate/20100912123417_add_missing_indices.blog.rb
@@ -0,0 +1,11 @@
+class AddMissingIndices < ActiveRecord::Migration
+ def self.up
+ add_index :tolk_locales, :name, :unique => true
+ add_index :tolk_translations, [:phrase_id, :locale_id], :unique => true
+ end
+
+ def self.down
+ remove_index :tolk_translations, :column => [:phrase_id, :locale_id]
+ remove_index :tolk_locales, :column => :name
+ end
+end
View
41 test/dummy/db/schema.rb
@@ -0,0 +1,41 @@
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20100910193132) do
+
+ create_table "tolk_locales", :force => true do |t|
+ t.string "name"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "tolk_locales", ["name"], :name => "index_tolk_locales_on_name", :unique => true
+
+ create_table "tolk_phrases", :force => true do |t|
+ t.text "key"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "tolk_translations", :force => true do |t|
+ t.integer "phrase_id"
+ t.integer "locale_id"
+ t.text "text"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "primary_updated", :default => false
+ t.text "previous_text"
+ end
+
+ add_index "tolk_translations", ["phrase_id", "locale_id"], :name => "index_tolk_translations_on_phrase_id_and_locale_id", :unique => true
+
+end
View
BIN test/dummy/db/test.sqlite3
Binary file not shown.
View
618 test/dummy/log/development.log
@@ -0,0 +1,618 @@
+ SQL (0.3ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) select sqlite_version(*)
+ SQL (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
+ SQL (0.1ms) PRAGMA index_list("schema_migrations")
+ SQL (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
+ SQL (0.3ms) SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
+Migrating to CreatePhrases (20100910190300)
+ SQL (0.5ms) CREATE TABLE "phrases" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190300')
+Migrating to CreateLocales (20100910190301)
+ SQL (0.4ms) CREATE TABLE "locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) 
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190301')
+Migrating to CreateTranslations (20100910190302)
+ SQL (0.4ms) CREATE TABLE "translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "phrase_id" integer, "locale_id" integer, "text" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190302')
+Migrating to CreateSystems (20100910190303)
+ SQL (0.4ms) CREATE TABLE "systems" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "location" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190303')
+Migrating to AddSystemToLocale (20100910190304)
+ SQL (0.7ms) ALTER TABLE "locales" ADD "system_id" integer
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190304')
+Migrating to RenameSystemsToApplications (20100910190305)
+ SQL (0.5ms) ALTER TABLE "systems" RENAME TO "applications"
+ SQL (0.5ms) CREATE TEMPORARY TABLE "altered_locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "application_id" integer)
+ SQL (0.0ms) PRAGMA index_list("locales")
+ SQL (0.4ms) DROP TABLE "locales"
+ SQL (0.2ms) CREATE TABLE "locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "application_id" integer) 
+ SQL (0.0ms) PRAGMA index_list("altered_locales")
+ SQL (0.4ms) DROP TABLE "altered_locales"
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190305')
+Migrating to AddApplicationIdToPhrases (20100910190306)
+ SQL (0.5ms) ALTER TABLE "phrases" ADD "application_id" integer
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190306')
+Migrating to DropApplications (20100910190307)
+ SQL (0.6ms) DROP TABLE "applications"
+ SQL (0.3ms) CREATE TEMPORARY TABLE "altered_locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "application_id" integer)
+ SQL (0.0ms) PRAGMA index_list("locales")
+ SQL (0.2ms) DROP TABLE "locales"
+ SQL (0.5ms) CREATE TABLE "locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) 
+ SQL (0.1ms) PRAGMA index_list("altered_locales")
+ SQL (0.2ms) DROP TABLE "altered_locales"
+ SQL (0.2ms) CREATE TEMPORARY TABLE "altered_phrases" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" text, "created_at" datetime, "updated_at" datetime, "application_id" integer)
+ SQL (0.0ms) PRAGMA index_list("phrases")
+ SQL (20.8ms) DROP TABLE "phrases"
+ SQL (0.2ms) CREATE TABLE "phrases" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.0ms) PRAGMA index_list("altered_phrases")
+ SQL (0.2ms) DROP TABLE "altered_phrases"
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190307')
+Migrating to AddUpdatedStuff (20100910190308)
+ SQL (0.5ms) ALTER TABLE "translations" ADD "primary_updated" boolean DEFAULT 'f'
+ SQL (0.2ms) ALTER TABLE "translations" ADD "previous_text" text
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190308')
+Migrating to RenameTables (20100910190309)
+ SQL (0.5ms) ALTER TABLE "locales" RENAME TO "tolk_locales"
+ SQL (0.6ms) ALTER TABLE "phrases" RENAME TO "tolk_phrases"
+ SQL (0.3ms) ALTER TABLE "translations" RENAME TO "tolk_translations"
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190309')
+Migrating to AddMissingIndices (20100910190310)
+ SQL (0.1ms) PRAGMA index_list("tolk_locales")
+ SQL (0.6ms) CREATE UNIQUE INDEX "index_tolk_locales_on_name" ON "tolk_locales" ("name")
+ SQL (0.0ms) PRAGMA index_list("tolk_translations")
+ SQL (0.2ms) CREATE UNIQUE INDEX "index_tolk_translations_on_phrase_id_and_locale_id" ON "tolk_translations" ("phrase_id", "locale_id")
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910190310')
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
+ SQL (0.1ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) PRAGMA index_list("tolk_locales")
+ SQL (0.0ms) PRAGMA index_info('index_tolk_locales_on_name')
+ SQL (0.0ms) PRAGMA index_list("tolk_phrases")
+ SQL (0.1ms) PRAGMA index_list("tolk_translations")
+ SQL (0.1ms) PRAGMA index_info('index_tolk_translations_on_phrase_id_and_locale_id')
+
+
+Started GET "/tolk" for 127.0.0.1 at 2010-09-10 21:08:11 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ SQL (0.5ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ Tolk::Locale Load (0.1ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales"."id" FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ SQL (0.4ms) INSERT INTO "tolk_locales" ("created_at", "name", "updated_at") VALUES ('2010-09-10 19:08:12.045409', 'en', '2010-09-10 19:08:12.045409')
+ Tolk::Locale Load (0.3ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (165.6ms)
+Completed 200 OK in 257ms (Views: 170.9ms | ActiveRecord: 1.6ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:08:12 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (3.9ms)
+
+
+Started GET "/tolk" for 127.0.0.1 at 2010-09-10 21:14:47 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ SQL (0.5ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ Tolk::Locale Load (0.1ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ CACHE (0.0ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (14.0ms)
+Completed 200 OK in 94ms (Views: 18.5ms | ActiveRecord: 0.9ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:14:47 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.6ms)
+
+
+Started POST "/tolk/locales" for 127.0.0.1 at 2010-09-10 21:14:54 +0200
+ Processing by Tolk::LocalesController#create as HTML
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"LF1DxmFmTR31jiKveTaeVuyH2jpcwdc21chjLXC3+gE=", "tolk_locale"=>{"name"=>"pl"}, "commit"=>"Add"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales"."id" FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ SQL (0.4ms) INSERT INTO "tolk_locales" ("created_at", "name", "updated_at") VALUES ('2010-09-10 19:14:54.661203', 'pl', '2010-09-10 19:14:54.661203')
+Redirected to http://localhost:3000/tolk/
+Completed 302 Found in 90ms
+
+
+Started GET "/tolk/" for 127.0.0.1 at 2010-09-10 21:14:54 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ Tolk::Locale Load (0.7ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ CACHE (0.0ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (204.5ms)
+Completed 200 OK in 235ms (Views: 209.0ms | ActiveRecord: 1.3ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:14:54 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
+
+
+Started GET "/tolk/locales/pl" for 127.0.0.1 at 2010-09-10 21:15:18 +0200
+ Processing by Tolk::LocalesController#show as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ Tolk::Phrase Load (0.1ms) SELECT "tolk_phrases".* FROM "tolk_phrases" ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ CACHE (0.0ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/show.html.erb within layouts/tolk/application (25.6ms)
+Completed 200 OK in 119ms (Views: 29.6ms | ActiveRecord: 1.1ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:15:18 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
+
+
+Started GET "/tolk/" for 127.0.0.1 at 2010-09-10 21:16:25 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ Tolk::Locale Load (0.5ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ CACHE (0.0ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (44.2ms)
+Completed 200 OK in 71ms (Views: 48.2ms | ActiveRecord: 1.0ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:16:25 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
+
+
+Started GET "/tolk/locales/pl" for 127.0.0.1 at 2010-09-10 21:16:29 +0200
+ Processing by Tolk::LocalesController#show as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ Tolk::Phrase Load (0.1ms) SELECT "tolk_phrases".* FROM "tolk_phrases" ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ CACHE (0.0ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (2.0ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/show.html.erb within layouts/tolk/application (59.6ms)
+Completed 200 OK in 119ms (Views: 63.3ms | ActiveRecord: 1.1ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:16:29 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (10.0ms)
+
+
+Started GET "/tolk/search?utf8=%E2%9C%93&locale=pl&scope=target&q=" for 127.0.0.1 at 2010-09-10 21:16:39 +0200
+ Processing by Tolk::SearchesController#show as HTML
+ Parameters: {"utf8"=>"✓", "locale"=>"pl", "scope"=>"target", "q"=>""}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/show.html.erb within layouts/tolk/application (7.9ms)
+Completed 200 OK in 35ms (Views: 12.6ms | ActiveRecord: 0.4ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:16:39 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.9ms)
+
+
+Started GET "/tolk/locales/pl/all" for 127.0.0.1 at 2010-09-10 21:16:42 +0200
+ Processing by Tolk::LocalesController#all as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Phrase Load (0.3ms) SELECT "tolk_phrases".* FROM "tolk_phrases" INNER JOIN "tolk_translations" ON "tolk_translations"."phrase_id" = "tolk_phrases"."id" WHERE ("tolk_translations"."locale_id" = 2) AND ("tolk_translations"."primary_updated" = 'f') ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/all.html.erb within layouts/tolk/application (33.4ms)
+Completed 200 OK in 190ms (Views: 37.5ms | ActiveRecord: 0.9ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:16:42 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.4ms)
+
+
+Started GET "/tolk" for 127.0.0.1 at 2010-09-10 21:33:03 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ SQL (0.4ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales"
+SQLite3::SQLException: no such table: tolk_locales: SELECT "tolk_locales".* FROM "tolk_locales"
+Completed in 77ms
+
+ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: tolk_locales: SELECT "tolk_locales".* FROM "tolk_locales"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms)
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (57.2ms)
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (63.6ms)
+ SQL (0.3ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) select sqlite_version(*)
+ SQL (638.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
+ SQL (0.2ms) PRAGMA index_list("schema_migrations")
+ SQL (37.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
+ SQL (0.2ms) SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
+Migrating to CreatePhrases (20100910193122)
+ SQL (0.5ms) CREATE TABLE "phrases" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193122')
+Migrating to CreateLocales (20100910193123)
+ SQL (0.4ms) CREATE TABLE "locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) 
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193123')
+Migrating to CreateTranslations (20100910193124)
+ SQL (0.8ms) CREATE TABLE "translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "phrase_id" integer, "locale_id" integer, "text" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193124')
+Migrating to CreateSystems (20100910193125)
+ SQL (0.6ms) CREATE TABLE "systems" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "location" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193125')
+Migrating to AddSystemToLocale (20100910193126)
+ SQL (0.5ms) ALTER TABLE "locales" ADD "system_id" integer
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193126')
+Migrating to RenameSystemsToApplications (20100910193127)
+ SQL (1.4ms) ALTER TABLE "systems" RENAME TO "applications"
+ SQL (0.6ms) CREATE TEMPORARY TABLE "altered_locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "application_id" integer)
+ SQL (0.0ms) PRAGMA index_list("locales")
+ SQL (0.4ms) DROP TABLE "locales"
+ SQL (0.2ms) CREATE TABLE "locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "application_id" integer) 
+ SQL (0.0ms) PRAGMA index_list("altered_locales")
+ SQL (0.4ms) DROP TABLE "altered_locales"
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193127')
+Migrating to AddApplicationIdToPhrases (20100910193128)
+ SQL (0.5ms) ALTER TABLE "phrases" ADD "application_id" integer
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193128')
+Migrating to DropApplications (20100910193129)
+ SQL (0.6ms) DROP TABLE "applications"
+ SQL (0.3ms) CREATE TEMPORARY TABLE "altered_locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "application_id" integer)
+ SQL (0.0ms) PRAGMA index_list("locales")
+ SQL (0.3ms) DROP TABLE "locales"
+ SQL (0.2ms) CREATE TABLE "locales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) 
+ SQL (0.0ms) PRAGMA index_list("altered_locales")
+ SQL (0.2ms) DROP TABLE "altered_locales"
+ SQL (0.6ms) CREATE TEMPORARY TABLE "altered_phrases" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" text, "created_at" datetime, "updated_at" datetime, "application_id" integer)
+ SQL (0.0ms) PRAGMA index_list("phrases")
+ SQL (0.2ms) DROP TABLE "phrases"
+ SQL (0.3ms) CREATE TABLE "phrases" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" text, "created_at" datetime, "updated_at" datetime) 
+ SQL (0.1ms) PRAGMA index_list("altered_phrases")
+ SQL (0.2ms) DROP TABLE "altered_phrases"
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193129')
+Migrating to AddUpdatedStuff (20100910193130)
+ SQL (0.5ms) ALTER TABLE "translations" ADD "primary_updated" boolean DEFAULT 'f'
+ SQL (0.2ms) ALTER TABLE "translations" ADD "previous_text" text
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193130')
+Migrating to RenameTables (20100910193131)
+ SQL (0.5ms) ALTER TABLE "locales" RENAME TO "tolk_locales"
+ SQL (0.2ms) ALTER TABLE "phrases" RENAME TO "tolk_phrases"
+ SQL (0.2ms) ALTER TABLE "translations" RENAME TO "tolk_translations"
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193131')
+Migrating to AddMissingIndices (20100910193132)
+ SQL (0.1ms) PRAGMA index_list("tolk_locales")
+ SQL (0.6ms) CREATE UNIQUE INDEX "index_tolk_locales_on_name" ON "tolk_locales" ("name")
+ SQL (0.0ms) PRAGMA index_list("tolk_translations")
+ SQL (0.2ms) CREATE UNIQUE INDEX "index_tolk_translations_on_phrase_id_and_locale_id" ON "tolk_translations" ("phrase_id", "locale_id")
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100910193132')
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) PRAGMA index_list("tolk_locales")
+ SQL (0.0ms) PRAGMA index_info('index_tolk_locales_on_name')
+ SQL (0.0ms) PRAGMA index_list("tolk_phrases")
+ SQL (0.1ms) PRAGMA index_list("tolk_translations")
+ SQL (0.2ms) PRAGMA index_info('index_tolk_translations_on_phrase_id_and_locale_id')
+
+
+Started GET "/tolk" for 127.0.0.1 at 2010-09-10 21:33:53 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ SQL (0.5ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ Tolk::Locale Load (0.1ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales"."id" FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ SQL (0.5ms) INSERT INTO "tolk_locales" ("created_at", "name", "updated_at") VALUES ('2010-09-10 19:33:53.751276', 'en', '2010-09-10 19:33:53.751276')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (43.5ms)
+Completed 200 OK in 139ms (Views: 48.3ms | ActiveRecord: 1.7ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:33:53 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
+
+
+Started POST "/tolk/locales" for 127.0.0.1 at 2010-09-10 21:33:59 +0200
+ Processing by Tolk::LocalesController#create as HTML
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"LF1DxmFmTR31jiKveTaeVuyH2jpcwdc21chjLXC3+gE=", "tolk_locale"=>{"name"=>"pl"}, "commit"=>"Add"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales"."id" FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ SQL (0.4ms) INSERT INTO "tolk_locales" ("created_at", "name", "updated_at") VALUES ('2010-09-10 19:33:59.595766', 'pl', '2010-09-10 19:33:59.595766')
+Redirected to http://localhost:3000/tolk/
+Completed 302 Found in 52ms
+
+
+Started GET "/tolk/" for 127.0.0.1 at 2010-09-10 21:33:59 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ Tolk::Locale Load (0.5ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ CACHE (0.0ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (172.4ms)
+Completed 200 OK in 233ms (Views: 176.5ms | ActiveRecord: 1.1ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:33:59 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.3ms)
+
+
+Started GET "/tolk/locales/pl" for 127.0.0.1 at 2010-09-10 21:34:01 +0200
+ Processing by Tolk::LocalesController#show as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.3ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ Tolk::Phrase Load (0.1ms) SELECT "tolk_phrases".* FROM "tolk_phrases" ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ CACHE (0.0ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/show.html.erb within layouts/tolk/application (60.2ms)
+Completed 200 OK in 156ms (Views: 64.1ms | ActiveRecord: 1.1ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:34:01 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
+
+
+Started GET "/tolk/locales/pl/all" for 127.0.0.1 at 2010-09-10 21:34:06 +0200
+ Processing by Tolk::LocalesController#all as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Phrase Load (0.3ms) SELECT "tolk_phrases".* FROM "tolk_phrases" INNER JOIN "tolk_translations" ON "tolk_translations"."phrase_id" = "tolk_phrases"."id" WHERE ("tolk_translations"."locale_id" = 2) AND ("tolk_translations"."primary_updated" = 'f') ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/all.html.erb within layouts/tolk/application (71.1ms)
+Completed 200 OK in 196ms (Views: 75.3ms | ActiveRecord: 0.9ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:34:06 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms)
+
+
+Started GET "/tolk/locales/pl/all" for 127.0.0.1 at 2010-09-10 21:35:14 +0200
+ Processing by Tolk::LocalesController#all as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Phrase Load (0.3ms) SELECT "tolk_phrases".* FROM "tolk_phrases" INNER JOIN "tolk_translations" ON "tolk_translations"."phrase_id" = "tolk_phrases"."id" WHERE ("tolk_translations"."locale_id" = 2) AND ("tolk_translations"."primary_updated" = 'f') ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (2.1ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/all.html.erb within layouts/tolk/application (90.1ms)
+Completed 200 OK in 223ms (Views: 94.4ms | ActiveRecord: 0.9ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:15 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.0ms)
+
+
+Started GET "/tolk/locales/pl/all" for 127.0.0.1 at 2010-09-10 21:35:42 +0200
+ Processing by Tolk::LocalesController#all as HTML
+ Parameters: {"id"=>"pl"}
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Phrase Load (0.3ms) SELECT "tolk_phrases".* FROM "tolk_phrases" INNER JOIN "tolk_translations" ON "tolk_translations"."phrase_id" = "tolk_phrases"."id" WHERE ("tolk_translations"."locale_id" = 2) AND ("tolk_translations"."primary_updated" = 'f') ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (2.1ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/all.html.erb within layouts/tolk/application (213.8ms)
+Completed 200 OK in 391ms (Views: 217.8ms | ActiveRecord: 1.2ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:43 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.6ms)
+
+
+Started GET "/tolk/locales/pl/all" for 127.0.0.1 at 2010-09-10 21:35:46 +0200
+ Processing by Tolk::LocalesController#all as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Phrase Load (0.3ms) SELECT "tolk_phrases".* FROM "tolk_phrases" INNER JOIN "tolk_translations" ON "tolk_translations"."phrase_id" = "tolk_phrases"."id" WHERE ("tolk_translations"."locale_id" = 2) AND ("tolk_translations"."primary_updated" = 'f') ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/all.html.erb within layouts/tolk/application (70.4ms)
+Completed 200 OK in 201ms (Views: 74.4ms | ActiveRecord: 0.9ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:46 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.6ms)
+
+
+Started GET "/tolk/" for 127.0.0.1 at 2010-09-10 21:35:49 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ Tolk::Locale Load (0.4ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ CACHE (0.1ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (86.3ms)
+Completed 200 OK in 117ms (Views: 90.2ms | ActiveRecord: 1.2ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:49 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.9ms)
+
+
+Started GET "/tolk/" for 127.0.0.1 at 2010-09-10 21:35:50 +0200
+ Processing by Tolk::LocalesController#index as HTML
+ Tolk::Locale Load (0.4ms) SELECT "tolk_locales".* FROM "tolk_locales"
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ CACHE (0.0ms) SELECT "tolk_locales".* FROM "tolk_locales"
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/index.html.erb within layouts/tolk/application (84.7ms)
+Completed 200 OK in 112ms (Views: 88.9ms | ActiveRecord: 1.0ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:50 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.0ms)
+
+
+Started GET "/tolk/locales/pl" for 127.0.0.1 at 2010-09-10 21:35:51 +0200
+ Processing by Tolk::LocalesController#show as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ Tolk::Phrase Load (0.1ms) SELECT "tolk_phrases".* FROM "tolk_phrases" ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ CACHE (0.0ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.1ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/show.html.erb within layouts/tolk/application (24.3ms)
+Completed 200 OK in 128ms (Views: 28.7ms | ActiveRecord: 1.1ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:51 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.0ms)
+
+
+Started GET "/tolk/locales/pl" for 127.0.0.1 at 2010-09-10 21:35:52 +0200
+ Processing by Tolk::LocalesController#show as HTML
+ Parameters: {"id"=>"pl"}
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'pl') LIMIT 1
+ Tolk::Translation Load (0.2ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ Tolk::Phrase Load (0.1ms) SELECT "tolk_phrases".* FROM "tolk_phrases" ORDER BY tolk_phrases.key ASC LIMIT 30 OFFSET 0
+ CACHE (0.0ms) SELECT tolk_translations.phrase_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2)
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_phrases"
+ SQL (0.2ms) SELECT COUNT(*) AS count_id FROM "tolk_translations" WHERE ("tolk_translations".locale_id = 2) AND ("tolk_translations"."primary_updated" = 't')
+ Tolk::Locale Load (0.2ms) SELECT "tolk_locales".* FROM "tolk_locales" WHERE ("tolk_locales"."name" = 'en') LIMIT 1
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/searches/_form.html.erb (1.9ms)
+Rendered /Users/drogus/projekty/tolk/app/views/tolk/locales/show.html.erb within layouts/tolk/application (62.1ms)
+Completed 200 OK in 119ms (Views: 65.8ms | ActiveRecord: 1.1ms)
+
+
+Started GET "/tolk/javascripts/rails.js" for 127.0.0.1 at 2010-09-10 21:35:52 +0200
+
+ActionController::RoutingError (No route matches "/tolk/javascripts/rails.js"):
+
+
+Rendered /Users/drogus/.rvm/gems/ruby-1.9.2-p0@rails/bundler/gems/rails-7e4852f81d66/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (9.1ms)
+ SQL (0.6ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.3ms) SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+ Tolk::Translation Load (0.4ms) SELECT "tolk_translations"."id" FROM "tolk_translations" WHERE ("tolk_translations"."phrase_id" IS NULL) AND ("tolk_translations"."locale_id" IS NULL) LIMIT 1
+ Tolk::Translation Load (0.3ms) SELECT "tolk_translations"."id" FROM "tolk_translations" WHERE ("tolk_translations"."phrase_id" IS NULL) AND ("tolk_translations"."locale_id" IS NULL) LIMIT 1
View
0 test/dummy/log/production.log
No changes.
View
0 test/dummy/log/server.log
No changes.
View
56,357 test/dummy/log/test.log
56,357 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
26 test/dummy/public/404.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
View
26 test/dummy/public/422.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
26 test/dummy/public/500.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>We're sorry, but something went wrong (500)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
+ </div>
+</body>
+</html>
View
0 test/dummy/public/favicon.ico
No changes.
View
2 test/dummy/public/javascripts/application.js
@@ -0,0 +1,2 @@
+// Place your application-specific JavaScript functions and classes here
+// This file is automatically included by javascript_include_tag :defaults
View
965 test/dummy/public/javascripts/controls.js
@@ -0,0 +1,965 @@
+// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
+
+// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
+// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
+// Contributors:
+// Richard Livsey
+// Rahul Bhargava
+// Rob Wills
+//
+// script.aculo.us is freely distributable under the terms of an MIT-style license.
+// For details, see the script.aculo.us web site: http://script.aculo.us/
+
+// Autocompleter.Base handles all the autocompletion functionality
+// that's independent of the data source for autocompletion. This
+// includes drawing the autocompletion menu, observing keyboard
+// and mouse events, and similar.
+//
+// Specific autocompleters need to provide, at the very least,
+// a getUpdatedChoices function that will be invoked every time
+// the text inside the monitored textbox changes. This method
+// should get the text for which to provide autocompletion by
+// invoking this.getToken(), NOT by directly accessing
+// this.element.value. This is to allow incremental tokenized
+// autocompletion. Specific auto-completion logic (AJAX, etc)
+// belongs in getUpdatedChoices.
+//
+// Tokenized incremental autocompletion is enabled automatically
+// when an autocompleter is instantiated with the 'tokens' option
+// in the options parameter, e.g.:
+// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
+// will incrementally autocomplete with a comma as the token.
+// Additionally, ',' in the above example can be replaced with
+// a token array, e.g. { tokens: [',', '\n'] } which
+// enables autocompletion on multiple tokens. This is most
+// useful when one of the tokens is \n (a newline), as it
+// allows smart autocompletion after linebreaks.
+
+if(typeof Effect == 'undefined')
+ throw("controls.js requires including script.aculo.us' effects.js library");
+
+var Autocompleter = { };
+Autocompleter.Base = Class.create({
+ baseInitialize: function(element, update, options) {
+ element = $(element);
+ this.element = element;
+ this.update = $(update);
+ this.hasFocus = false;
+ this.changed = false;
+ this.active = false;
+ this.index = 0;
+ this.entryCount = 0;
+ this.oldElementValue = this.element.value;
+
+ if(this.setOptions)
+ this.setOptions(options);
+ else
+ this.options = options || { };
+
+ this.options.paramName = this.options.paramName || this.element.name;
+ this.options.tokens = this.options.tokens || [];
+ this.options.frequency = this.options.frequency || 0.4;
+ this.options.minChars = this.options.minChars || 1;
+ this.options.onShow = this.options.onShow ||
+ function(element, update){
+ if(!update.style.position || update.style.position=='absolute') {
+ update.style.position = 'absolute';
+ Position.clone(element, update, {
+ setHeight: false,
+ offsetTop: element.offsetHeight
+ });
+ }
+ Effect.Appear(update,{duration:0.15});
+ };
+ this.options.onHide = this.options.onHide ||
+ function(element, update){ new Effect.Fade(update,{duration:0.15}) };
+
+ if(typeof(this.options.tokens) == 'string')
+ this.options.tokens = new Array(this.options.tokens);
+ // Force carriage returns as token delimiters anyway
+ if (!this.options.tokens.include('\n'))
+ this.options.tokens.push('\n');
+
+ this.observer = null;
+
+ this.element.setAttribute('autocomplete','off');
+
+ Element.hide(this.update);
+
+ Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
+ Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
+ },
+
+ show: function() {
+ if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
+ if(!this.iefix &&
+ (Prototype.Browser.IE) &&
+ (Element.getStyle(this.update, 'position')=='absolute')) {
+ new Insertion.After(this.update,
+ '<iframe id="' + this.update.id + '_iefix" '+
+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
+ 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+ this.iefix = $(this.update.id+'_iefix');
+ }
+ if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
+ },
+
+ fixIEOverlapping: function() {
+ Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
+ this.iefix.style.zIndex = 1;
+ this.update.style.zIndex = 2;
+ Element.show(this.iefix);
+ },
+
+ hide: function() {
+ this.stopIndicator();
+ if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
+ if(this.iefix) Element.hide(this.iefix);
+ },
+
+ startIndicator: function() {
+ if(this.options.indicator) Element.show(this.options.indicator);
+ },
+
+ stopIndicator: function() {
+ if(this.options.indicator) Element.hide(this.options.indicator);
+ },
+
+ onKeyPress: function(event) {
+ if(this.active)
+ switch(event.keyCode) {
+ case Event.KEY_TAB:
+ case Event.KEY_RETURN:
+ this.selectEntry();
+ Event.stop(event);
+ case Event.KEY_ESC:
+ this.hide();
+ this.active = false;
+ Event.stop(event);
+ return;
+ case Event.KEY_LEFT:
+ case Event.KEY_RIGHT:
+ return;
+ case Event.KEY_UP:
+ this.markPrevious();
+ this.render();
+ Event.stop(event);
+ return;
+ case Event.KEY_DOWN:
+ this.markNext();
+ this.render();
+ Event.stop(event);
+ return;
+ }
+ else
+ if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
+ (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
+
+ this.changed = true;
+ this.hasFocus = true;
+
+ if(this.observer) clearTimeout(this.observer);
+ this.observer =
+ setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
+ },
+
+ activate: function() {
+ this.changed = false;
+ this.hasFocus = true;
+ this.getUpdatedChoices();
+ },
+
+ onHover: function(event) {
+ var element = Event.findElement(event, 'LI');
+ if(this.index != element.autocompleteIndex)
+ {
+ this.index = element.autocompleteIndex;
+ this.render();
+ }
+ Event.stop(event);
+ },
+
+ onClick: function(event) {
+ var element = Event.findElement(event, 'LI');
+ this.index = element.autocompleteIndex;
+ this.selectEntry();
+ this.hide();
+ },
+
+ onBlur: function(event) {
+ // needed to make click events working
+ setTimeout(this.hide.bind(this), 250);
+ this.hasFocus = false;
+ this.active = false;
+ },
+
+ render: function() {
+ if(this.entryCount > 0) {
+ for (var i = 0; i < this.entryCount; i++)
+ this.index==i ?
+ Element.addClassName(this.getEntry(i),"selected") :
+ Element.removeClassName(this.getEntry(i),"selected");
+ if(this.hasFocus) {
+ this.show();
+ this.active = true;
+ }
+ } else {
+ this.active = false;
+ this.hide();
+ }
+ },
+
+ markPrevious: function() {
+ if(this.index > 0) this.index--;
+ else this.index = this.entryCount-1;
+ this.getEntry(this.index).scrollIntoView(true);
+ },
+
+ markNext: function() {
+ if(this.index < this.entryCount-1) this.index++;
+ else this.index = 0;
+ this.getEntry(this.index).scrollIntoView(false);
+ },
+
+ getEntry: function(index) {
+ return this.update.firstChild.childNodes[index];
+ },
+
+ getCurrentEntry: function() {
+ return this.getEntry(this.index);
+ },
+
+ selectEntry: function() {
+ this.active = false;
+ this.updateElement(this.getCurrentEntry());
+ },
+
+ updateElement: function(selectedElement) {
+ if (this.options.updateElement) {
+ this.options.updateElement(selectedElement);
+ return;
+ }
+ var value = '';
+ if (this.options.select) {
+ var nodes = $(selectedElement).select('.' + this.options.select) || [];
+ if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
+ } else
+ value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
+
+ var bounds = this.getTokenBounds();
+ if (bounds[0] != -1) {
+ var newValue = this.element.value.substr(0, bounds[0]);
+ var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
+ if (whitespace)
+ newValue += whitespace[0];
+ this.element.value = newValue + value + this.element.value.substr(bounds[1]);
+ } else {
+ this.element.value = value;
+ }
+ this.oldElementValue = this.element.value;
+ this.element.focus();
+
+ if (this.options.afterUpdateElement)
+ this.options.afterUpdateElement(this.element, selectedElement);
+ },
+
+ updateChoices: function(choices) {
+ if(!this.changed && this.hasFocus) {
+ this.update.innerHTML = choices;
+ Element.cleanWhitespace(this.update);
+ Element.cleanWhitespace(this.update.down());
+
+ if(this.update.firstChild && this.update.down().childNodes) {
+ this.entryCount =
+ this.update.down().childNodes.length;
+ for (var i = 0; i < this.entryCount; i++) {
+ var entry = this.getEntry(i);
+ entry.autocompleteIndex = i;
+ this.addObservers(entry);
+ }
+ } else {
+ this.entryCount = 0;
+ }
+
+ this.stopIndicator();
+ this.index = 0;
+
+ if(this.entryCount==1 && this.options.autoSelect) {
+ this.selectEntry();
+ this.hide();
+ } else {
+ this.render();
+ }
+ }
+ },
+
+ addObservers: function(element) {
+ Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
+ Event.observe(element, "click", this.onClick.bindAsEventListener(this));
+ },
+
+ onObserverEvent: function() {
+ this.changed = false;
+ this.tokenBounds = null;
+ if(this.getToken().length>=this.options.minChars) {
+ this.getUpdatedChoices();
+ } else {
+ this.active = false;
+ this.hide();
+ }
+ this.oldElementValue = this.element.value;
+ },
+
+ getToken: function() {
+ var bounds = this.getTokenBounds();
+ return this.element.value.substring(bounds[0], bounds[1]).strip();
+ },
+
+ getTokenBounds: function() {
+ if (null != this.tokenBounds) return this.tokenBounds;
+ var value = this.element.value;
+ if (value.strip().empty()) return [-1, 0];
+ var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
+ var offset = (diff == this.oldElementValue.length ? 1 : 0);
+ var prevTokenPos = -1, nextTokenPos = value.length;
+ var tp;
+ for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
+ tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
+ if (tp > prevTokenPos) prevTokenPos = tp;
+ tp = value.indexOf(this.options.tokens[index], diff + offset);
+ if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
+ }
+ return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
+ }
+});
+
+Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
+ var boundary = Math.min(newS.length, oldS.length);
+ for (var index = 0; index < boundary; ++index)
+ if (newS[index] != oldS[index])
+ return index;
+ return boundary;
+};
+
+Ajax.Autocompleter = Class.create(Autocompleter.Base, {
+ initialize: function(element, update, url, options) {
+ this.baseInitialize(element, update, options);
+ this.options.asynchronous = true;
+ this.options.onComplete = this.onComplete.bind(this);
+ this.options.defaultParams = this.options.parameters || null;
+ this.url = url;
+ },
+
+ getUpdatedChoices: function() {
+ this.startIndicator();
+
+ var entry = encodeURIComponent(this.options.paramName) + '=' +
+ encodeURIComponent(this.getToken());
+
+ this.options.parameters = this.options.callback ?
+ this.options.callback(this.element, entry) : entry;
+
+ if(this.options.defaultParams)
+ this.options.parameters += '&' + this.options.defaultParams;
+
+ new Ajax.Request(this.url, this.options);
+ },
+
+ onComplete: function(request) {
+ this.updateChoices(request.responseText);
+ }
+});
+
+// The local array autocompleter. Used when you'd prefer to
+// inject an array of autocompletion options into the page, rather
+// than sending out Ajax queries, which can be quite slow sometimes.
+//
+// The constructor takes four parameters. The first two are, as usual,
+// the id of the monitored textbox, and id of the autocompletion menu.
+// The third is the array you want to autocomplete from, and the fourth
+// is the options block.
+//
+// Extra local autocompletion options:
+// - choices - How many autocompletion choices to offer
+//
+// - partialSearch - If false, the autocompleter will match entered
+// text only at the beginning of strings in the
+// autocomplete array. Defaults to true, which will
+// match text at the beginning of any *word* in the
+// strings in the autocomplete array. If you want to
+// search anywhere in the string, additionally set
+// the option fullSearch to true (default: off).
+//
+// - fullSsearch - Search anywhere in autocomplete array strings.
+//
+// - partialChars - How many characters to enter before triggering
+// a partial match (unlike minChars, which defines
+// how many characters are required to do any match
+// at all). Defaults to 2.
+//
+// - ignoreCase - Whether to ignore case when autocompleting.
+// Defaults to true.
+//
+// It's possible to pass in a custom function as the 'selector'
+// option, if you prefer to write your own autocompletion logic.
+// In that case, the other options above will not apply unless
+// you support them.
+
+Autocompleter.Local = Class.create(Autocompleter.Base, {
+ initialize: function(element, update, array, options) {
+ this.baseInitialize(element, update, options);
+ this.options.array = array;
+ },
+