refinerycms-settings 1.0.11 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.rspec +3 -0
- data/.travis.yml +16 -0
- data/Gemfile +74 -0
- data/Rakefile +19 -0
- data/app/controllers/refinery/admin/settings_controller.rb +55 -0
- data/app/decorators/controllers/refinery/.gitkeep +0 -0
- data/app/decorators/models/refinery/.gitkeep +0 -0
- data/app/helpers/refinery/admin/settings_helper.rb +29 -0
- data/app/models/refinery/setting.rb +204 -0
- data/app/views/refinery/admin/settings/_actions.html.erb +8 -0
- data/app/views/refinery/admin/settings/_form.html.erb +54 -0
- data/app/views/refinery/admin/settings/_records.html.erb +21 -0
- data/app/views/refinery/admin/settings/_setting.html.erb +23 -0
- data/app/views/refinery/admin/settings/_settings.html.erb +4 -0
- data/app/views/refinery/admin/settings/edit.html.erb +1 -0
- data/app/views/{admin/refinery_settings → refinery/admin/settings}/index.html.erb +2 -2
- data/app/views/refinery/admin/settings/new.html.erb +1 -0
- data/config/locales/bg.yml +22 -40
- data/config/locales/cs.yml +22 -39
- data/config/locales/da.yml +22 -40
- data/config/locales/de.yml +26 -43
- data/config/locales/el.yml +22 -40
- data/config/locales/en.yml +22 -35
- data/config/locales/es.yml +31 -63
- data/config/locales/fi.yml +22 -40
- data/config/locales/fr.yml +22 -38
- data/config/locales/it.yml +20 -36
- data/config/locales/ja.yml +30 -0
- data/config/locales/ko.yml +29 -0
- data/config/locales/lolcat.yml +21 -37
- data/config/locales/lt.yml +23 -40
- data/config/locales/lv.yml +22 -40
- data/config/locales/nb.yml +22 -40
- data/config/locales/nl.yml +22 -40
- data/config/locales/pl.yml +23 -40
- data/config/locales/pt-BR.yml +22 -38
- data/config/locales/rs.yml +22 -40
- data/config/locales/ru.yml +22 -37
- data/config/locales/sk.yml +22 -40
- data/config/locales/sl.yml +21 -20
- data/config/locales/sv.yml +22 -39
- data/config/locales/vi.yml +23 -42
- data/config/locales/zh-CN.yml +22 -40
- data/config/locales/zh-TW.yml +22 -40
- data/config/routes.rb +3 -6
- data/db/migrate/20100913234710_create_refinerycms_settings_schema.rb +11 -19
- data/lib/refinery/generators/refinery/settings/settings_generator.rb +20 -0
- data/lib/refinery/settings/engine.rb +26 -0
- data/lib/refinery/settings.rb +22 -0
- data/lib/refinerycms-settings.rb +1 -32
- data/readme.md +46 -0
- data/refinerycms-settings.gemspec +7 -79
- data/script/rails +6 -0
- data/spec/factories/settings.rb +5 -0
- data/spec/models/refinery/setting_spec.rb +103 -0
- data/spec/requests/refinery/admin/settings_spec.rb +57 -0
- data/spec/spec_helper.rb +56 -0
- data/tasks/rspec.rake +4 -0
- metadata +87 -75
- data/app/controllers/admin/refinery_settings_controller.rb +0 -71
- data/app/helpers/refinery_settings_helper.rb +0 -25
- data/app/models/refinery_setting.rb +0 -206
- data/app/views/admin/refinery_settings/_actions.html.erb +0 -15
- data/app/views/admin/refinery_settings/_form.html.erb +0 -62
- data/app/views/admin/refinery_settings/_records.html.erb +0 -21
- data/app/views/admin/refinery_settings/_refinery_setting.html.erb +0 -23
- data/app/views/admin/refinery_settings/_refinery_settings.html.erb +0 -5
- data/app/views/admin/refinery_settings/edit.html.erb +0 -1
- data/app/views/admin/refinery_settings/new.html.erb +0 -1
- data/config/locales/jp.yml +0 -47
- data/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb +0 -9
- data/features/manage_refinery_settings.feature +0 -5
- data/features/step_definitions/setting_steps.rb +0 -9
- data/features/support/paths.rb +0 -14
- data/lib/gemspec.rb +0 -37
- data/lib/generators/refinerycms_settings_generator.rb +0 -8
- data/spec/models/refinery_setting_spec.rb +0 -101
data/config/locales/jp.yml
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
jp:
|
2
|
-
plugins:
|
3
|
-
refinery_settings:
|
4
|
-
title: 環境設定
|
5
|
-
description: Refinery環境設定
|
6
|
-
admin:
|
7
|
-
refinery_settings:
|
8
|
-
delete: この設定を削除する
|
9
|
-
edit: 設定を変更
|
10
|
-
actions:
|
11
|
-
new: 設定の新規追加
|
12
|
-
records:
|
13
|
-
empty_set: 設定はありません。
|
14
|
-
create_first: "「%{link}」をクリックして環境設定を始めて下さい。"
|
15
|
-
form:
|
16
|
-
enabled: "確認"
|
17
|
-
restart_may_be_in_order_html: "<strong>注意</strong> この設定を有効にするにはサイトを再スタートさせる必要がある場合があります。"
|
18
|
-
yes_make_this_setting_restricted: "管理人のみ閲覧可能にする。"
|
19
|
-
help:
|
20
|
-
restricted: 管理人のみが変更出来るようにします。
|
21
|
-
activity_show_limit: ダッシュボードで表示されるアイテムの数を制限します。
|
22
|
-
analytics_page_code: Google Analyticsを有効にします。空白か、「UA-xxxxxx-x」という形の場合には無効で、Google Analyticsへの呼び出しは為されません。
|
23
|
-
frontend_refinery_stylesheets_enabled: "Refineryには、カスタマイズされたスタイルシートの邪魔にならないようなスタイルシートが標準で配布されています。このスタイルシートを有効にしたり、無効にしたりします。"
|
24
|
-
image_dialogue_sizes: 「画像を挿入する」時に使われるダイアログに影響を及ぼす設定です。様々なサイズのサムネイルと併せて使用して下さい。
|
25
|
-
image_thumbnails: この設定を変更した際には、rake images:regenerate (サムネイルを追加した場合にはrake images:update)を走らせて画像を再び生成して下さい。 再生成されなければ、既存の映像についてのみこの設定は有効です。
|
26
|
-
menu_hide_children: 傘下のページを、存在するか否かに関わらず隠します。
|
27
|
-
new_page_parts: ページエディタでページ片を追加出来るようにする
|
28
|
-
page_title: ページのタイトルを設定します。CSSのカスタムクラス、異るタグ、或いはブレッドクラム等の使用を設定出来ます。
|
29
|
-
pages_advanced_options_include_seo: 検索エンジン最適化オプションの表示・非表示を切り替えます。
|
30
|
-
preferred_image_view: 画像のレイアウト(グリッド又はリスト)を設定します。プラグイン自体にもこれを設定するボタンがあります。
|
31
|
-
refinery_enable_backend_reordering: プラグインを表示する順番を変更する機能を取り除く事が出来ます。
|
32
|
-
refinery_menu_cache_action_suffix: サイトメニューをキャッシュする為に用いられるキーを変更します。テーマを使用する場合は、テーマがこのキーを管理しているのでデフォルトのままの使用をお勧めします。
|
33
|
-
show_contact_privacy_link: お問い合わせフォームで、個人情報保護方針のページのリンクを表示するかどうかを決定します。
|
34
|
-
site_name: このサイトの名前です。ヘッダに表示されます。テーマによっては、Refineryの管理画面や著作権表示のフッタでもこれが表示される場合があります。
|
35
|
-
theme: 使用可能なテーマの名前。これは直ぐに発効するので、現存するテーマの名前を指定する必要があります。
|
36
|
-
use_google_ajax_libraries: GoogleのAJAX CDNを使用される場合はこれを有効にして下さい。
|
37
|
-
use_marketable_urls: URLを/pages/aboutから/aboutに変更して、他のプラグインのと名前の衝突を自動的に管理します。
|
38
|
-
use_resource_caching: プロダクションモードではこれを有効にする事を推奨します。JavaScriptやスタイルシート等のリソースをまとめて転送する事でサーバへのアクセスの回数を減らします。
|
39
|
-
approximate_ascii: 'ラテン文字にアクセント記号を付けたものをページのタイトルに使用する際にはこれを有効にして下さい。ā, č, žをa, c, zへと変換します。'
|
40
|
-
activerecord:
|
41
|
-
models:
|
42
|
-
refinery_setting: 設定
|
43
|
-
attributes:
|
44
|
-
refinery_setting:
|
45
|
-
name: 名前
|
46
|
-
value: 値
|
47
|
-
restricted: 制限あり
|
@@ -1,9 +0,0 @@
|
|
1
|
-
Given /^I have no (?:|refinery )settings$/ do
|
2
|
-
RefinerySetting.delete_all
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^I (only )?have a (?:|refinery )setting titled "([^\"]*)"$/ do |only, title|
|
6
|
-
RefinerySetting.delete_all if only
|
7
|
-
|
8
|
-
RefinerySetting.set(title.to_s.gsub(' ', '').underscore.to_sym, nil)
|
9
|
-
end
|
data/features/support/paths.rb
DELETED
data/lib/gemspec.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# Encoding: UTF-8
|
2
|
-
require 'pathname'
|
3
|
-
gempath = Pathname.new(File.expand_path('../../', __FILE__))
|
4
|
-
require gempath.join('..', 'base', 'lib', 'base', 'refinery')
|
5
|
-
|
6
|
-
gemspec = <<EOF
|
7
|
-
# Encoding: UTF-8
|
8
|
-
# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
|
9
|
-
|
10
|
-
Gem::Specification.new do |s|
|
11
|
-
s.name = %q{#{gemname = 'refinerycms-settings'}}
|
12
|
-
s.version = %q{#{::Refinery.version}}
|
13
|
-
s.summary = %q{Settings engine for Refinery CMS}
|
14
|
-
s.description = %q{The default settings engine that is required by Refinery CMS core. Adds programmer creatable, user editable settings for each engine.}
|
15
|
-
s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
|
16
|
-
s.email = %q{info@refinerycms.com}
|
17
|
-
s.homepage = %q{http://refinerycms.com}
|
18
|
-
s.rubyforge_project = %q{refinerycms}
|
19
|
-
s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel', 'Uģis Ozols']
|
20
|
-
s.license = %q{MIT}
|
21
|
-
s.require_paths = %w(lib)
|
22
|
-
s.executables = %w(#{Pathname.glob(gempath.join('bin/*')).map{|d| d.relative_path_from(gempath)}.sort.join(" ")})
|
23
|
-
|
24
|
-
s.add_dependency 'activerecord', '~> 3.0.10'
|
25
|
-
|
26
|
-
s.files = [
|
27
|
-
'#{%w( **/{*,.rspec,.gitignore,.yardopts} ).map { |file| Pathname.glob(gempath.join(file)) }.flatten.reject{|f|
|
28
|
-
!f.exist? or f.to_s =~ /(\.(gem|rbc)|tmp(\/.*)?|spec\/lib\/tmp(\/.*)?)$/ or (f.directory? and f.children.empty?)
|
29
|
-
}.map{|d| d.relative_path_from(gempath)}.uniq.sort.join("',\n '")}'
|
30
|
-
]
|
31
|
-
|
32
|
-
s.add_dependency 'refinerycms-base', '= #{::Refinery::Version}'
|
33
|
-
end
|
34
|
-
EOF
|
35
|
-
|
36
|
-
(gemfile = gempath.join("#{gemname}.gemspec")).open('w') {|f| f.puts(gemspec)}
|
37
|
-
puts `cd #{gempath} && gem build #{gemfile}` if ARGV.any?{|a| a == "BUILD=true"}
|
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RefinerySetting do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
RefinerySetting.set(:creating_from_scratch, nil)
|
7
|
-
RefinerySetting.set(:rspec_testing_creating_from_scratch, nil)
|
8
|
-
end
|
9
|
-
|
10
|
-
context "set" do
|
11
|
-
it "should create a setting that didn't exist" do
|
12
|
-
RefinerySetting.get(:creating_from_scratch, :scoping => 'rspec_testing').should == nil
|
13
|
-
RefinerySetting.set(:creating_from_scratch, {:value => "Look, a value", :scoping => 'rspec_testing'}).should == "Look, a value"
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should override an existing setting" do
|
17
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "a value", :scoping => 'rspec_testing'})
|
18
|
-
@set.should == "a value"
|
19
|
-
|
20
|
-
@new_set = RefinerySetting.set(:creating_from_scratch, {:value => "newer replaced value", :scoping => 'rspec_testing'})
|
21
|
-
@new_set.should == "newer replaced value"
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should default to form_value_type text_area" do
|
25
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "a value", :scoping => 'rspec_testing'})
|
26
|
-
RefinerySetting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'}).form_value_type.should == "text_area"
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should fix true as a value to 'true' (string)" do
|
30
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => true, :scoping => 'rspec_testing'})
|
31
|
-
RefinerySetting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should == 'true'
|
32
|
-
@set.should == true
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should fix false as a value to 'false' (string)" do
|
36
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => false, :scoping => 'rspec_testing'})
|
37
|
-
RefinerySetting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should == 'false'
|
38
|
-
@set.should == false
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should fix '1' as a value with a check_box form_value_type to true" do
|
42
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "1", :scoping => 'rspec_testing', :form_value_type => 'check_box'})
|
43
|
-
RefinerySetting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should == 'true'
|
44
|
-
@set.should == true
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should fix '0' as a value with a check_box form_value_type to false" do
|
48
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "0", :scoping => 'rspec_testing', :form_value_type => 'check_box'})
|
49
|
-
RefinerySetting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should == 'false'
|
50
|
-
@set.should == false
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
context "get" do
|
55
|
-
it "should retrieve a seting that was created" do
|
56
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "some value", :scoping => 'rspec_testing'})
|
57
|
-
@set.should == 'some value'
|
58
|
-
|
59
|
-
@get = RefinerySetting.get(:creating_from_scratch, :scoping => 'rspec_testing')
|
60
|
-
@get.should == 'some value'
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should also work with setting scoping using string and getting via symbol" do
|
64
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "some value", :scoping => 'rspec_testing'})
|
65
|
-
@set.should == 'some value'
|
66
|
-
|
67
|
-
@get = RefinerySetting.get(:creating_from_scratch, :scoping => :rspec_testing)
|
68
|
-
@get.should == 'some value'
|
69
|
-
end
|
70
|
-
|
71
|
-
it "should also work with setting scoping using symbol and getting via string" do
|
72
|
-
@set = RefinerySetting.set(:creating_from_scratch, {:value => "some value", :scoping => :rspec_testing})
|
73
|
-
@set.should == 'some value'
|
74
|
-
|
75
|
-
@get = RefinerySetting.get(:creating_from_scratch, :scoping => 'rspec_testing')
|
76
|
-
@get.should == 'some value'
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context "find_or_set" do
|
81
|
-
it "should create a non existant setting" do
|
82
|
-
@created = RefinerySetting.find_or_set(:creating_from_scratch, 'I am a setting being created', :scoping => 'rspec_testing')
|
83
|
-
|
84
|
-
@created.should == "I am a setting being created"
|
85
|
-
end
|
86
|
-
|
87
|
-
it "should not override an existing setting" do
|
88
|
-
@created = RefinerySetting.set(:creating_from_scratch, {:value => 'I am a setting being created', :scoping => 'rspec_testing'})
|
89
|
-
@created.should == "I am a setting being created"
|
90
|
-
|
91
|
-
@find_or_set_created = RefinerySetting.find_or_set(:creating_from_scratch, 'Trying to change an existing value', :scoping => 'rspec_testing')
|
92
|
-
|
93
|
-
@created.should == "I am a setting being created"
|
94
|
-
end
|
95
|
-
|
96
|
-
it "should work without scoping" do
|
97
|
-
RefinerySetting.find_or_set(:rspec_testing_creating_from_scratch, 'Yes it worked').should == 'Yes it worked'
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|