afalkear_translation_center 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +293 -0
- data/Rakefile +40 -0
- data/app/assets/images/translation_center/badr_it.png +0 -0
- data/app/assets/images/translation_center/loading.gif +0 -0
- data/app/assets/images/translation_center/translation_center_logo.png +0 -0
- data/app/assets/javascripts/translation_center/application.js +75 -0
- data/app/assets/javascripts/translation_center/bootstrap.js +2025 -0
- data/app/assets/javascripts/translation_center/categories.js +18 -0
- data/app/assets/javascripts/translation_center/center.js +55 -0
- data/app/assets/javascripts/translation_center/inspector.js.erb +59 -0
- data/app/assets/javascripts/translation_center/jquery-ui.js +14912 -0
- data/app/assets/javascripts/translation_center/jquery.jeditable.mini.js +38 -0
- data/app/assets/javascripts/translation_center/routes.js +15 -0
- data/app/assets/javascripts/translation_center/spin.min.js +1 -0
- data/app/assets/javascripts/translation_center/translation_keys.js +31 -0
- data/app/assets/javascripts/translation_center/translations.js +245 -0
- data/app/assets/stylesheets/translation_center/application.css +49 -0
- data/app/assets/stylesheets/translation_center/bootstrap.css +5894 -0
- data/app/assets/stylesheets/translation_center/categories.css +29 -0
- data/app/assets/stylesheets/translation_center/center.css +28 -0
- data/app/assets/stylesheets/translation_center/inspector.css +110 -0
- data/app/assets/stylesheets/translation_center/translation_keys.css +48 -0
- data/app/assets/stylesheets/translation_center/translations.css +32 -0
- data/app/controllers/translation_center/application_controller.rb +42 -0
- data/app/controllers/translation_center/categories_controller.rb +61 -0
- data/app/controllers/translation_center/center_controller.rb +67 -0
- data/app/controllers/translation_center/translation_keys_controller.rb +93 -0
- data/app/controllers/translation_center/translations_controller.rb +78 -0
- data/app/helpers/translation_center/application_helper.rb +58 -0
- data/app/helpers/translation_center/categories_helper.rb +4 -0
- data/app/helpers/translation_center/center_helper.rb +19 -0
- data/app/helpers/translation_center/translation_keys_helper.rb +4 -0
- data/app/helpers/translation_center/translations_helper.rb +4 -0
- data/app/models/translation_center/activity_query.rb +46 -0
- data/app/models/translation_center/category.rb +46 -0
- data/app/models/translation_center/translation.rb +94 -0
- data/app/models/translation_center/translation_key.rb +188 -0
- data/app/views/layouts/translation_center/application.html.haml +82 -0
- data/app/views/translation_center/categories/_category.html.haml +11 -0
- data/app/views/translation_center/categories/index.html.haml +7 -0
- data/app/views/translation_center/categories/keys.js.haml +10 -0
- data/app/views/translation_center/categories/show.html.haml +32 -0
- data/app/views/translation_center/categories/show.js.haml +7 -0
- data/app/views/translation_center/center/_activity.html.haml +49 -0
- data/app/views/translation_center/center/dashboard.html.haml +102 -0
- data/app/views/translation_center/center/manage.js.haml +3 -0
- data/app/views/translation_center/center/search_activity.js.haml +1 -0
- data/app/views/translation_center/errors/exception.html.haml +50 -0
- data/app/views/translation_center/translation_keys/_form.html.haml +18 -0
- data/app/views/translation_center/translation_keys/_show.html.haml +27 -0
- data/app/views/translation_center/translation_keys/_show_keys.html.haml +25 -0
- data/app/views/translation_center/translation_keys/_translation_keys.html.haml +16 -0
- data/app/views/translation_center/translation_keys/destroy.js.haml +4 -0
- data/app/views/translation_center/translation_keys/show.html.haml +8 -0
- data/app/views/translation_center/translation_keys/translations.js.haml +3 -0
- data/app/views/translation_center/translations/_accept_translation.html.haml +6 -0
- data/app/views/translation_center/translations/_index.html.haml +9 -0
- data/app/views/translation_center/translations/_search_results.html.haml +30 -0
- data/app/views/translation_center/translations/_show.html.haml +35 -0
- data/app/views/translation_center/translations/accept.js.haml +18 -0
- data/app/views/translation_center/translations/destroy.js.haml +11 -0
- data/app/views/translation_center/translations/search.html.haml +2 -0
- data/app/views/translation_center/translations/search.js.haml +1 -0
- data/app/views/translation_center/translations/unaccept.js.haml +9 -0
- data/app/views/translation_center/translations/unvote.js.haml +1 -0
- data/app/views/translation_center/translations/vote.js.haml +1 -0
- data/config/routes.rb +34 -0
- data/lib/afalkear_translation_center.rb +12 -0
- data/lib/generators/translation_center/USAGE +6 -0
- data/lib/generators/translation_center/add_lang/add_lang_generator.rb +31 -0
- data/lib/generators/translation_center/add_lang/templates/migrations/add_lang_status_translation_keys.rb +5 -0
- data/lib/generators/translation_center/install/install_generator.rb +38 -0
- data/lib/generators/translation_center/install/templates/assets/translation_center_logo.png +0 -0
- data/lib/generators/translation_center/install/templates/config/translation_center.yml +55 -0
- data/lib/generators/translation_center/install/templates/migrations/create_translation_center_categories.rb +9 -0
- data/lib/generators/translation_center/install/templates/migrations/create_translation_center_translation_keys.rb +16 -0
- data/lib/generators/translation_center/install/templates/migrations/create_translation_center_translations.rb +32 -0
- data/lib/tasks/translation_center.rake +56 -0
- data/lib/translation_center/acts_as_translator.rb +22 -0
- data/lib/translation_center/engine.rb +15 -0
- data/lib/translation_center/locale/en.yml +75 -0
- data/lib/translation_center/translation_helpers.rb +133 -0
- data/lib/translation_center/translations_transfer.rb +131 -0
- data/lib/translation_center/version.rb +3 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/images/translation_center_logo.png +0 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/javascripts/articles.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +14 -0
- data/test/dummy/app/assets/stylesheets/articles.css +4 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/controllers/application_controller.rb +6 -0
- data/test/dummy/app/controllers/articles_controller.rb +85 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/articles_helper.rb +2 -0
- data/test/dummy/app/models/article.rb +7 -0
- data/test/dummy/app/models/user.rb +16 -0
- data/test/dummy/app/views/articles/_form.html.haml +16 -0
- data/test/dummy/app/views/articles/edit.html.haml +7 -0
- data/test/dummy/app/views/articles/index.html.haml +32 -0
- data/test/dummy/app/views/articles/new.html.haml +5 -0
- data/test/dummy/app/views/articles/show.html.haml +14 -0
- data/test/dummy/app/views/layouts/application.html.erb +15 -0
- data/test/dummy/config/application.rb +60 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +42 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +240 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/ar.yml +6 -0
- data/test/dummy/config/locales/de.yml +2 -0
- data/test/dummy/config/locales/devise.en.yml +59 -0
- data/test/dummy/config/locales/en.yml +361 -0
- data/test/dummy/config/routes.rb +10 -0
- data/test/dummy/config/translation_center.yml +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/migrate/20130410082611_devise_create_users.rb +46 -0
- data/test/dummy/db/migrate/20130410082701_create_articles.rb +10 -0
- data/test/dummy/db/migrate/20130410084711234392_create_translation_center_categories.rb +9 -0
- data/test/dummy/db/migrate/20130410084711235054_create_translation_center_translation_keys.rb +14 -0
- data/test/dummy/db/migrate/20130410084711235601_create_translation_center_translations.rb +13 -0
- data/test/dummy/db/migrate/20130410084711235602_install_audited.rb +28 -0
- data/test/dummy/db/migrate/20130410084711_acts_as_votable_migration.rb +23 -0
- data/test/dummy/db/migrate/20130410113111070575_add_de_status_translation_center_translation_keys.rb +5 -0
- data/test/dummy/db/migrate/20130417134539377014_add_ar_status_translation_center_translation_keys.rb +5 -0
- data/test/dummy/db/migrate/20130506103956_fix_translation_user_relation.rb +12 -0
- data/test/dummy/db/migrate/20130801102022_add_indicies.rb +8 -0
- data/test/dummy/db/schema.rb +110 -0
- data/test/dummy/log/test.log +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/spec/spec_helper.rb +38 -0
- data/test/dummy/test/fixtures/articles.yml +9 -0
- data/test/dummy/test/fixtures/posts.yml +9 -0
- data/test/dummy/test/fixtures/users.yml +11 -0
- data/test/dummy/test/functional/articles_controller_test.rb +49 -0
- data/test/dummy/test/functional/posts_controller_test.rb +49 -0
- data/test/dummy/test/unit/article_test.rb +7 -0
- data/test/dummy/test/unit/helpers/articles_helper_test.rb +4 -0
- data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/dummy/test/unit/post_test.rb +7 -0
- data/test/dummy/test/unit/user_test.rb +7 -0
- data/test/fixtures/translation_center/categories.yml +7 -0
- data/test/fixtures/translation_center/translation_keys.yml +11 -0
- data/test/fixtures/translation_center/translations.yml +15 -0
- data/test/functional/translation_center/categories_controller_test.rb +51 -0
- data/test/functional/translation_center/center_controller_test.rb +9 -0
- data/test/functional/translation_center/translation_keys_controller_test.rb +51 -0
- data/test/functional/translation_center/translations_controller_test.rb +51 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/translation_center_test.rb +7 -0
- data/test/unit/helpers/translation_center/categories_helper_test.rb +6 -0
- data/test/unit/helpers/translation_center/center_helper_test.rb +6 -0
- data/test/unit/helpers/translation_center/translation_keys_helper_test.rb +6 -0
- data/test/unit/helpers/translation_center/translations_helper_test.rb +6 -0
- data/test/unit/translation_center/category_test.rb +9 -0
- data/test/unit/translation_center/translation_key_test.rb +9 -0
- data/test/unit/translation_center/translation_test.rb +9 -0
- metadata +418 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
class ArticlesController < ApplicationController
|
2
|
+
before_filter :authenticate_user!
|
3
|
+
|
4
|
+
# GET /articles
|
5
|
+
# GET /articles.json
|
6
|
+
def index
|
7
|
+
@articles = Article.all
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.html # index.html.erb
|
11
|
+
format.json { render json: @articles }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /articles/1
|
16
|
+
# GET /articles/1.json
|
17
|
+
def show
|
18
|
+
@article = Article.find(params[:id])
|
19
|
+
|
20
|
+
respond_to do |format|
|
21
|
+
format.html # show.html.erb
|
22
|
+
format.json { render json: @article }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# GET /articles/new
|
27
|
+
# GET /articles/new.json
|
28
|
+
def new
|
29
|
+
@article = Article.new
|
30
|
+
|
31
|
+
respond_to do |format|
|
32
|
+
format.html # new.html.erb
|
33
|
+
format.json { render json: @article }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# GET /articles/1/edit
|
38
|
+
def edit
|
39
|
+
@article = Article.find(params[:id])
|
40
|
+
end
|
41
|
+
|
42
|
+
# POST /articles
|
43
|
+
# POST /articles.json
|
44
|
+
def create
|
45
|
+
@article = Article.new(params[:article])
|
46
|
+
|
47
|
+
respond_to do |format|
|
48
|
+
if @article.save
|
49
|
+
format.html { redirect_to @article, notice: 'Article was successfully created.' }
|
50
|
+
format.json { render json: @article, status: :created, location: @article }
|
51
|
+
else
|
52
|
+
format.html { render action: "new" }
|
53
|
+
format.json { render json: @article.errors, status: :unprocessable_entity }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# PUT /articles/1
|
59
|
+
# PUT /articles/1.json
|
60
|
+
def update
|
61
|
+
@article = Article.find(params[:id])
|
62
|
+
|
63
|
+
respond_to do |format|
|
64
|
+
if @article.update_attributes(params[:article])
|
65
|
+
format.html { redirect_to @article, notice: 'Article was successfully updated.' }
|
66
|
+
format.json { head :ok }
|
67
|
+
else
|
68
|
+
format.html { render action: "edit" }
|
69
|
+
format.json { render json: @article.errors, status: :unprocessable_entity }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# DELETE /articles/1
|
75
|
+
# DELETE /articles/1.json
|
76
|
+
def destroy
|
77
|
+
@article = Article.find(params[:id])
|
78
|
+
@article.destroy
|
79
|
+
|
80
|
+
respond_to do |format|
|
81
|
+
format.html { redirect_to articles_url }
|
82
|
+
format.json { head :ok }
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
# Include default devise modules. Others available are:
|
3
|
+
# :token_authenticatable, :confirmable,
|
4
|
+
# :lockable, :timeoutable and :omniauthable
|
5
|
+
devise :database_authenticatable, :registerable,
|
6
|
+
:recoverable, :rememberable, :trackable, :validatable
|
7
|
+
|
8
|
+
# Setup accessible (or protected) attributes for your model
|
9
|
+
attr_accessible :email, :password, :password_confirmation, :remember_me
|
10
|
+
|
11
|
+
acts_as_translator
|
12
|
+
|
13
|
+
def can_admin_translations?
|
14
|
+
self.id == User.first.id
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
= form_for @article do |f|
|
2
|
+
- if @article.errors.any?
|
3
|
+
#error_explanation
|
4
|
+
%h2= "#{pluralize(@article.errors.count, "error")} prohibited this article from being saved:"
|
5
|
+
%ul
|
6
|
+
- @article.errors.full_messages.each do |msg|
|
7
|
+
%li= msg
|
8
|
+
|
9
|
+
.field
|
10
|
+
= f.label :title
|
11
|
+
= f.text_field :title
|
12
|
+
.field
|
13
|
+
= f.label :content
|
14
|
+
= f.text_area :content
|
15
|
+
.actions
|
16
|
+
= f.submit 'Save'
|
@@ -0,0 +1,32 @@
|
|
1
|
+
%h1 Listing articles
|
2
|
+
|
3
|
+
= number_to_currency(10)
|
4
|
+
|
5
|
+
%table
|
6
|
+
%tr
|
7
|
+
%th= t('.title')
|
8
|
+
%th= t('.content')
|
9
|
+
%th
|
10
|
+
%th
|
11
|
+
%th
|
12
|
+
|
13
|
+
- @articles.each do |article|
|
14
|
+
%tr
|
15
|
+
%td= article.title
|
16
|
+
%td= article.content
|
17
|
+
%td= link_to 'Show', article
|
18
|
+
%td= link_to 'Edit', edit_article_path(article)
|
19
|
+
%td= link_to 'Destroy', article, :method => :delete, :data => { :confirm => 'Are you sure?' }
|
20
|
+
|
21
|
+
%br
|
22
|
+
|
23
|
+
= link_to 'New Article', new_article_path
|
24
|
+
|
25
|
+
#test_content
|
26
|
+
test ajax content
|
27
|
+
= link_to 'test ajax', '#', id: :test_ajax
|
28
|
+
|
29
|
+
:javascript
|
30
|
+
$('#test_ajax').click(function(){
|
31
|
+
$('#test_content').load('/')
|
32
|
+
})
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag "application", :media => "all" %>
|
6
|
+
<%= javascript_include_tag "application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
|
11
|
+
|
12
|
+
<%= yield %>
|
13
|
+
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require
|
6
|
+
require "translation_center"
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
34
|
+
config.encoding = "utf-8"
|
35
|
+
|
36
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
37
|
+
config.filter_parameters += [:password]
|
38
|
+
|
39
|
+
# Enable escaping HTML in JSON.
|
40
|
+
config.active_support.escape_html_entities_in_json = true
|
41
|
+
|
42
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
43
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
44
|
+
# like if you have constraints or database-specific column types
|
45
|
+
# config.active_record.schema_format = :sql
|
46
|
+
|
47
|
+
# Enforce whitelist mode for mass assignment.
|
48
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
49
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
50
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
51
|
+
config.active_record.whitelist_attributes = true
|
52
|
+
|
53
|
+
# Enable the asset pipeline
|
54
|
+
config.assets.enabled = true
|
55
|
+
|
56
|
+
# Version of your assets, change this if you want to expire all your assets
|
57
|
+
config.assets.version = '1.0'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# MySQL. Versions 4.1 and 5.0 are recommended.
|
2
|
+
#
|
3
|
+
# Install the MYSQL driver
|
4
|
+
# gem install mysql2
|
5
|
+
#
|
6
|
+
# Ensure the MySQL gem is defined in your Gemfile
|
7
|
+
# gem 'mysql2'
|
8
|
+
#
|
9
|
+
# And be sure to use new-style password hashing:
|
10
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
11
|
+
development:
|
12
|
+
adapter: mysql2
|
13
|
+
encoding: utf8
|
14
|
+
reconnect: false
|
15
|
+
database: translation_center_dev
|
16
|
+
pool: 5
|
17
|
+
username: root
|
18
|
+
password: "1234"
|
19
|
+
socket: /var/run/mysqld/mysqld.sock
|
20
|
+
|
21
|
+
# Warning: The database defined as "test" will be erased and
|
22
|
+
# re-generated from your development database when you run "rake".
|
23
|
+
# Do not set this db to the same as development or production.
|
24
|
+
test:
|
25
|
+
adapter: mysql2
|
26
|
+
encoding: utf8
|
27
|
+
reconnect: false
|
28
|
+
database: translation_center_test
|
29
|
+
pool: 5
|
30
|
+
username: root
|
31
|
+
password: "1234"
|
32
|
+
socket: /var/run/mysqld/mysqld.sock
|
33
|
+
|
34
|
+
production:
|
35
|
+
adapter: mysql2
|
36
|
+
encoding: utf8
|
37
|
+
reconnect: false
|
38
|
+
database: translation_center_pro
|
39
|
+
pool: 5
|
40
|
+
username: root
|
41
|
+
password:
|
42
|
+
socket: /var/run/mysqld/mysqld.sock
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
# config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
32
|
+
# Do not compress assets
|
33
|
+
config.assets.compress = false
|
34
|
+
|
35
|
+
# Expands the lines which load the assets
|
36
|
+
config.assets.debug = true
|
37
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
# config.assets.precompile += %w( search.js )
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
# config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
# Show full error reports and disable caching
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
|
24
|
+
# Disable request forgery protection in test environment
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
26
|
+
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
29
|
+
# ActionMailer::Base.deliveries array.
|
30
|
+
config.action_mailer.delivery_method = :test
|
31
|
+
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
34
|
+
|
35
|
+
# Print deprecation notices to the stderr
|
36
|
+
config.active_support.deprecation = :stderr
|
37
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|