golden-setting 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 800d09425b041c08a44ab9cac58bb4782f5fbb94
4
- data.tar.gz: 7e62725cd53150713e3875d65c557508a8f91d9c
3
+ metadata.gz: f164c6d98361ffa4e4b3771ce3cf17eafff21cfd
4
+ data.tar.gz: 25fc0397c0c46b4fc9b4d86a2cd6a94ba96318e8
5
5
  SHA512:
6
- metadata.gz: 0c96623b32faee6ca82e7ce5fe3f3b0bb2d52c04c58032bbd157ba929eb221b67e774e64c7f46ec987cbe0fda0a170409d9cb4ad270eeb86effeed1147979e63
7
- data.tar.gz: 3c694b300dcb4184452f3311e3c44edf520b899d633a4c736c6c792a846ca612000c4b784012f40c771f325297f1d58508110ff2f7e6847df9b591c860cdc511
6
+ metadata.gz: 400e88f42a4b4a1f174df3c8bb3931fbda32b6a82ba3e14cb4ff86a6ee1bc717e9745fdde75578fbb79747f7c62d02872f63078c40ef9dd5d67231d484c57364
7
+ data.tar.gz: 6ea526354f6ca07787eb6db00abfa26288b270188ad56ef97eb2090e6b293755cf8adc77c8eda2758c0200b3b2b22cd9973e931df302ad8be82f93b3ca729d5b
data/README.md CHANGED
@@ -9,10 +9,10 @@ A web interface is provied to let users can update easily.
9
9
  For Rails 4 project, `Gemfile` should have
10
10
 
11
11
  ```ruby
12
- gem 'devise', '> 3.0'
13
- gem 'cancan'
14
- gem 'simple_form', '~> 3.0.0.rc'
15
- gem 'anjlab-bootstrap-rails', require: 'bootstrap-rails'
12
+ gem 'devise', '~> 3.0'
13
+ gem 'cancancan'
14
+ gem 'simple_form', '~> 3.0'
15
+ gem 'bootstrap-sass'
16
16
  gem 'will_paginate'
17
17
  gem 'rails-theme-helper'
18
18
  ```
@@ -29,9 +29,9 @@ For Rails 3 project, `Gemfile` should have
29
29
 
30
30
  ```ruby
31
31
  gem 'devise', '>= 2.0', '< 3.0'
32
- gem 'cancan'
32
+ gem 'cancancan'
33
33
  gem 'simple_form', '>= 2.0', '< 3.0'
34
- gem 'anjlab-bootstrap-rails', require: 'bootstrap-rails'
34
+ gem 'bootstrap-sass'
35
35
  gem 'will_paginate'
36
36
  gem 'rails-theme-helper'
37
37
  ```
@@ -54,7 +54,7 @@ $ rails generate golden:setting:install setting
54
54
  $ rake db:migrate
55
55
  ```
56
56
 
57
- Remember add setting abilities for `cancan`.
57
+ Remember add setting abilities for `cancancan`.
58
58
 
59
59
  ```ruby
60
60
  can :index, Setting
@@ -1,24 +1,21 @@
1
1
  <%= simple_form_for setting_class,
2
2
  as: :setting,
3
3
  url: batch_update_settings_path,
4
- method: :put,
5
- html: { class: 'form-horizontal' } do |f| %>
4
+ method: :put do |f| %>
6
5
 
7
6
  <%= f.error_notification %>
8
7
 
9
8
  <% settings.each do |setting| %>
10
9
  <% next if skip_setting? setting.name %>
11
- <div class="form-inputs">
12
- <%= f.input setting.name,
13
- as: setting.field_type,
14
- collection: setting_field_values(setting.field_values),
15
- label: setting_name(setting.name),
16
- include_blank: false,
17
- input_html: { value: setting.value } %>
18
- </div>
10
+ <%= f.input setting.name,
11
+ as: setting.field_type,
12
+ collection: setting_field_values(setting.field_values),
13
+ label: setting_name(setting.name),
14
+ include_blank: false,
15
+ input_html: { value: setting.value } %>
19
16
  <% end %>
20
17
 
21
18
  <div class="form-actions">
22
- <%= submit_button f, t('.submit') %>
19
+ <%= f.button :submit, t('.submit'), name: nil %>
23
20
  </div>
24
21
  <% end %>
@@ -1,25 +1,23 @@
1
- <div class="form-inputs">
2
- <%= f.input :field_type,
3
- as: :select,
4
- collection: setting_field_types,
5
- include_blank: false,
6
- required: true %>
7
- <%= f.input :field_values,
8
- as: :text,
9
- required: true,
10
- wrapper_html: {
11
- class: setting_selectable?(f.object.field_type) ? '' : 'hide'
12
- } %>
13
- <%= f.input :group,
14
- as: :select,
15
- collection: setting_groups,
16
- include_blank: false %>
17
- <%= f.input :name %>
18
- <%= f.input :value,
19
- as: f.object.field_type,
20
- collection: setting_field_values(f.object.field_values),
21
- include_blank: false,
22
- input_html: {
23
- value: f.object.value
24
- } %>
25
- </div>
1
+ <%= f.input :field_type,
2
+ as: :select,
3
+ collection: setting_field_types,
4
+ include_blank: false,
5
+ required: true %>
6
+ <%= f.input :field_values,
7
+ as: :text,
8
+ required: true,
9
+ wrapper_html: {
10
+ class: setting_selectable?(f.object.field_type) ? '' : 'hide'
11
+ } %>
12
+ <%= f.input :group,
13
+ as: :select,
14
+ collection: setting_groups,
15
+ include_blank: false %>
16
+ <%= f.input :name %>
17
+ <%= f.input :value,
18
+ as: f.object.field_type,
19
+ collection: setting_field_values(f.object.field_values),
20
+ include_blank: false,
21
+ input_html: {
22
+ value: f.object.value
23
+ } %>
@@ -3,26 +3,33 @@
3
3
  <h1><%= t('.title') %></h1>
4
4
  </header>
5
5
 
6
- <%= render_list class: 'nav nav-tabs' do |li|
7
- if can? :index, @setting.class
8
- li << [link_to(t('helpers.index'), settings_path), { class: 'pull-right' }]
9
- end
10
- if can? :list, @setting.class
11
- li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
12
- end
13
- if can? :show, @setting
14
- li << [link_to(t('helpers.show'), setting_path(@setting)), { class: 'pull-right' }]
15
- end
16
- end %>
6
+ <div class="tabbable">
7
+ <%= render_list class: 'nav nav-tabs' do |li|
8
+ if can? :index, @setting.class
9
+ li << [link_to(t('.index'), settings_path), { class: 'pull-right' }]
10
+ end
11
+ if can? :list, @setting.class
12
+ li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
13
+ end
14
+ if can? :show, @setting
15
+ li << [link_to(t('helpers.show'), setting_path(@setting)), { class: 'pull-right' }]
16
+ end
17
+ end %>
17
18
 
18
- <div>
19
- <%= simple_form_for @setting, as: :setting, url: setting_path(@setting) do |f| %>
20
- <%= f.error_notification %>
21
- <%= render 'form', f: f %>
22
- <div class="form-actions">
23
- <%= submit_button f %>
24
- </div>
25
- <% end %>
19
+ <div>
20
+ <%= simple_form_for @setting,
21
+ as: :setting,
22
+ url: setting_path(@setting) do |f| %>
23
+
24
+ <%= f.error_notification %>
25
+
26
+ <%= render 'form', f: f %>
27
+
28
+ <div class="form-actions">
29
+ <%= f.button :submit, name: nil %>
30
+ </div>
31
+ <% end %>
32
+ </div>
26
33
  </div>
27
34
 
28
35
  <footer>
@@ -3,29 +3,31 @@
3
3
  <h1><%= t('.title') %></h1>
4
4
  </header>
5
5
 
6
- <%= render_list class: 'nav nav-tabs' do |li|
7
- if can? :new, @setting_class
8
- li << [link_to(t('helpers.new'), new_setting_path), { class: 'pull-right' }]
9
- end
10
- if can? :list, @setting_class
11
- li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
12
- end
13
- Golden::Setting.groups.each do |key, value|
14
- next if skip_setting_group? key
15
- li << settings_nav_tab(key, @default_tab)
16
- end
17
- end %>
6
+ <div class="tabbable">
7
+ <%= render_list class: 'nav nav-tabs' do |li|
8
+ if can? :new, @setting_class
9
+ li << [link_to(t('helpers.new'), new_setting_path), { class: 'pull-right' }]
10
+ end
11
+ if can? :list, @setting_class
12
+ li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
13
+ end
14
+ Golden::Setting.groups.each do |key, value|
15
+ next if skip_setting_group? key
16
+ li << settings_nav_tab(key, @default_tab)
17
+ end
18
+ end %>
18
19
 
19
- <div class="tab-content">
20
- <% Golden::Setting.groups.each do |key, value| %>
21
- <% next if skip_setting_group? key %>
22
- <%= settings_tab_pane key, @default_tab do %>
23
- <%= render 'batch_form',
24
- settings: @setting_class.without_resource.grouped(key),
25
- setting_class: @setting_class
26
- %>
20
+ <div class="tab-content">
21
+ <% Golden::Setting.groups.each do |key, value| %>
22
+ <% next if skip_setting_group? key %>
23
+ <%= settings_tab_pane key, @default_tab do %>
24
+ <%= render 'batch_form',
25
+ settings: @setting_class.without_resource.grouped(key),
26
+ setting_class: @setting_class
27
+ %>
28
+ <% end %>
27
29
  <% end %>
28
- <% end %>
30
+ </div>
29
31
  </div>
30
32
 
31
33
  <footer>
@@ -3,15 +3,20 @@
3
3
  <h1><%= t('.title') %></h1>
4
4
  </header>
5
5
 
6
- <%= render_list class: 'nav nav-tabs' do |li|
7
- if can? :index, @setting_class
8
- li << [link_to(t('.index'), settings_path), { class: 'pull-right' }]
9
- end
10
- end %>
6
+ <div class="tabbable">
7
+ <%= render_list class: 'nav nav-tabs' do |li|
8
+ if can? :new, @setting_class
9
+ li << [link_to(t('helpers.new'), new_setting_path), { class: 'pull-right' }]
10
+ end
11
+ if can? :index, @setting_class
12
+ li << [link_to(t('.index'), settings_path), { class: 'pull-right' }]
13
+ end
14
+ end %>
11
15
 
12
- <div>
13
- <%= render 'table', settings: @settings, setting_class: @setting_class %>
14
- <%= render 'application/pagination', collection: @settings %>
16
+ <div>
17
+ <%= render 'table', settings: @settings, setting_class: @setting_class %>
18
+ <%= render 'application/pagination', collection: @settings %>
19
+ </div>
15
20
  </div>
16
21
 
17
22
  <footer>
@@ -3,23 +3,30 @@
3
3
  <h1><%= t('.title') %></h1>
4
4
  </header>
5
5
 
6
- <%= render_list class: 'nav nav-tabs' do |li|
7
- if can? :index, @setting.class
8
- li << [link_to(t('helpers.index'), settings_path), { class: 'pull-right' }]
9
- end
10
- if can? :list, @setting.class
11
- li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
12
- end
13
- end %>
6
+ <div class="tabbable">
7
+ <%= render_list class: 'nav nav-tabs' do |li|
8
+ if can? :index, @setting.class
9
+ li << [link_to(t('.index'), settings_path), { class: 'pull-right' }]
10
+ end
11
+ if can? :list, @setting.class
12
+ li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
13
+ end
14
+ end %>
14
15
 
15
- <div>
16
- <%= simple_form_for @setting, as: :setting, url: settings_path do |f| %>
17
- <%= f.error_notification %>
18
- <%= render 'form', f: f %>
19
- <div class="form-actions">
20
- <%= submit_button f %>
21
- </div>
22
- <% end %>
16
+ <div>
17
+ <%= simple_form_for @setting,
18
+ as: :setting,
19
+ url: settings_path do |f| %>
20
+
21
+ <%= f.error_notification %>
22
+
23
+ <%= render 'form', f: f %>
24
+
25
+ <div class="form-actions">
26
+ <%= f.button :submit, name: nil %>
27
+ </div>
28
+ <% end %>
29
+ </div>
23
30
  </div>
24
31
 
25
32
  <footer>
@@ -3,20 +3,22 @@
3
3
  <h1><%= t('.title', name: @setting.name) %></h1>
4
4
  </header>
5
5
 
6
- <%= render_list class: 'nav nav-tabs' do |li|
7
- if can? :index, @setting.class
8
- li << [link_to(t('helpers.index'), settings_path), { class: 'pull-right' }]
9
- end
10
- if can? :list, @setting.class
11
- li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
12
- end
13
- if can? :edit, @setting
14
- li << [link_to(t('helpers.edit'), edit_setting_path(@setting)), { class: 'pull-right' }]
15
- end
16
- end %>
6
+ <div class="tabbable">
7
+ <%= render_list class: 'nav nav-tabs' do |li|
8
+ if can? :index, @setting.class
9
+ li << [link_to(t('.index'), settings_path), { class: 'pull-right' }]
10
+ end
11
+ if can? :list, @setting.class
12
+ li << [link_to(t('.list'), list_settings_path), { class: 'pull-right' }]
13
+ end
14
+ if can? :edit, @setting
15
+ li << [link_to(t('helpers.edit'), edit_setting_path(@setting)), { class: 'pull-right' }]
16
+ end
17
+ end %>
17
18
 
18
- <div>
19
- <%= render 'setting', setting: @setting %>
19
+ <div>
20
+ <%= render 'setting', setting: @setting %>
21
+ </div>
20
22
  </div>
21
23
 
22
24
  <footer>
@@ -10,14 +10,19 @@ en:
10
10
  settings:
11
11
  edit:
12
12
  title: 'Editing setting'
13
+ index: 'Settings'
14
+ list: 'List'
13
15
  index:
14
16
  title: 'Settings'
15
17
  list: 'List'
16
18
  new:
17
19
  title: 'New setting'
20
+ index: 'Settings'
18
21
  list: 'List'
19
22
  show:
20
23
  title: 'Setting - %{name}'
24
+ index: 'Settings'
25
+ list: 'List'
21
26
  list:
22
27
  title: 'Listing settings'
23
28
  index: 'Settings'
@@ -10,14 +10,19 @@ zh-TW:
10
10
  settings:
11
11
  edit:
12
12
  title: '編輯設定'
13
+ index: '設定管理'
14
+ list: '設定列表'
13
15
  index:
14
16
  title: '設定管理'
15
17
  list: '設定列表'
16
18
  new:
17
19
  title: '新增設定'
20
+ index: '設定管理'
18
21
  list: '設定列表'
19
22
  show:
20
23
  title: '設定 - %{name}'
24
+ index: '設定管理'
25
+ list: '設定列表'
21
26
  list:
22
27
  title: '設定列表'
23
28
  index: '設定管理'
@@ -1,5 +1,5 @@
1
1
  module Golden
2
2
  module Setting
3
- VERSION = '0.6.0'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,109 +1,109 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: golden-setting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tse-Ching Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-13 00:00:00.000000000 Z
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.13
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.2.13
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: railties
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 3.2.13
40
- - - <
40
+ - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '5'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 3.2.13
50
- - - <
50
+ - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '5'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: bundler
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ~>
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '1.3'
60
60
  type: :development
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ~>
64
+ - - "~>"
65
65
  - !ruby/object:Gem::Version
66
66
  version: '1.3'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rake
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rspec
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: 2.13.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: 2.13.0
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: sqlite3
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  description: Golden Setting persists settings in database and keep alive in cache.
@@ -113,7 +113,7 @@ executables: []
113
113
  extensions: []
114
114
  extra_rdoc_files: []
115
115
  files:
116
- - .gitignore
116
+ - ".gitignore"
117
117
  - Gemfile
118
118
  - LICENSE.txt
119
119
  - README.md
@@ -171,17 +171,17 @@ require_paths:
171
171
  - lib
172
172
  required_ruby_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - '>='
174
+ - - ">="
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - '>='
179
+ - - ">="
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.0.3
184
+ rubygems_version: 2.2.2
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: persists settings in database and keep alive in cache.