simple-pages-rails 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: 3d41286186d3466f03371243b10c95a323973cb8
4
- data.tar.gz: 1ff02604adfdbb548791dad6b005082010db2825
3
+ metadata.gz: bc0d261ff974173b3b85ac94f1bb6cf238044b54
4
+ data.tar.gz: 4d259a29837760a217725a58526eecaa3bd24278
5
5
  SHA512:
6
- metadata.gz: cdae70ecf369fcbc36c015a8aa6533b7c81ccaea1c6f4ee3374ee6d83630906f70bd93fe99401af2ad3a98a52b9467fb76ca091b22aa53ee12d8adb8ec89d928
7
- data.tar.gz: af430b859d15ad2c71220a4e3f3018aebf80dad91181b1efa203a78e90c1ea1b0345b73a4ca4434e6b38d2dcf31454ea8dcb3f4867a9c894957ee972ec92dbf8
6
+ metadata.gz: a08e5493f0435790d9a9e76ca58dfc2ad19fc4d6bb512f4fe88643805e85f987a209ef4701686e0a05e20db9b31eec282275d8cf232e1673fa60c82e578e604a
7
+ data.tar.gz: e32b92dd5f371d25c9f05b8d1f5d3f0ac996414dbc3284627a96d8a018abafdc619fdb21adeb72cd62ffffe507b823ca6f08c14b3e116fcb1ddb9be8e452aa8b
data/Gemfile CHANGED
@@ -20,7 +20,7 @@ gem 'coffee-rails'
20
20
  gem 'devise'
21
21
  gem 'cancan'
22
22
  gem 'simple_form'
23
- gem 'anjlab-bootstrap-rails', require: 'bootstrap-rails'
23
+ gem 'anjlab-bootstrap-rails', '< 3.0', require: 'bootstrap-rails'
24
24
 
25
25
  group :test do
26
26
  if RUBY_PLATFORM =~ /darwin/i
@@ -10,14 +10,5 @@ module SimplePages
10
10
  if SimplePages.extra_page_layout.present?
11
11
  has_page_layout_at SimplePages.extra_page_layout
12
12
  end
13
-
14
- protected
15
-
16
- def load_author_options
17
- load_authors
18
- @author_options = @authors.map do |author|
19
- [author.name, author.simple_page_owner_option]
20
- end
21
- end
22
13
  end
23
14
  end
@@ -20,28 +20,20 @@ module SimplePages
20
20
  end
21
21
 
22
22
  def new
23
- load_page_options
24
23
  @page.author = session_user
25
24
  respond_with @page
26
25
  end
27
26
 
28
27
  def edit
29
- load_page_options
30
28
  end
31
29
 
32
30
  def create
33
31
  @page.save
34
- if @page.invalid?
35
- load_page_options
36
- end
37
32
  respond_with @page
38
33
  end
39
34
 
40
35
  def update
41
36
  @page.update_attributes page_params
42
- if @page.invalid?
43
- load_page_options
44
- end
45
37
  respond_with @page
46
38
  end
47
39
 
@@ -64,12 +56,6 @@ module SimplePages
64
56
  @page = SimplePages::Page.new page_params
65
57
  end
66
58
 
67
- def load_page_options
68
- load_author_options
69
- load_page_layout_at_options
70
- load_page_cluster_options
71
- end
72
-
73
59
  private
74
60
 
75
61
  def pagination_options
@@ -24,5 +24,23 @@ module SimplePages
24
24
  def local_published_at(object)
25
25
  object.published_at? ? object.published_at.localtime : nil
26
26
  end
27
+
28
+ def page_author_options
29
+ ::User.unscoped.map do |author|
30
+ [author.name, author.simple_page_owner_option]
31
+ end
32
+ end
33
+
34
+ def page_cluster_options
35
+ ::Role.enabled.map do |role|
36
+ [t(role.name, scope: 'roles.names'), role.name]
37
+ end
38
+ end
39
+
40
+ def page_layout_at_options
41
+ page_layout_at.map do |key|
42
+ [t(key, scope: 'simple_pages.layout_at'), key]
43
+ end
44
+ end
27
45
  end
28
46
  end
@@ -11,7 +11,7 @@
11
11
  } %>
12
12
  <%= f.input :content, input_html: { class: 'ckeditor' } %>
13
13
  <%= f.input :owner,
14
- collection: author_options,
14
+ collection: page_author_options,
15
15
  selected: selected_page_author(f.object),
16
16
  input_html: {
17
17
  class: 'chzn-select'
@@ -24,11 +24,11 @@
24
24
  } %>
25
25
  <%= f.input :layout_at,
26
26
  as: :select,
27
- collection: layout_at_options,
27
+ collection: page_layout_at_options,
28
28
  include_blank: false %>
29
29
  <%= f.input :cluster,
30
30
  as: :select,
31
- collection: cluster_options,
31
+ collection: page_cluster_options,
32
32
  input_html: {
33
33
  multiple: true,
34
34
  class: 'chzn-select'
@@ -15,12 +15,7 @@
15
15
  <div>
16
16
  <%= simple_form_for @page, as: :page, html: { class: 'form-horizontal' } do |f| %>
17
17
  <%= f.error_notification %>
18
- <%= render 'form', {
19
- f: f,
20
- cluster_options: @cluster_options,
21
- layout_at_options: @layout_at_options,
22
- author_options: @author_options
23
- } %>
18
+ <%= render 'form', f: f %>
24
19
  <div class="form-actions">
25
20
  <%= submit_button f %>
26
21
  </div>
@@ -12,12 +12,7 @@
12
12
  <div>
13
13
  <%= simple_form_for @page, as: :page, html: { class: 'form-horizontal' } do |f| %>
14
14
  <%= f.error_notification %>
15
- <%= render 'form', {
16
- f: f,
17
- cluster_options: @cluster_options,
18
- layout_at_options: @layout_at_options,
19
- author_options: @author_options
20
- } %>
15
+ <%= render 'form', f: f %>
21
16
  <div class="form-actions">
22
17
  <%= submit_button f %>
23
18
  </div>
@@ -18,8 +18,4 @@ module DeviseExt
18
18
  def session_user
19
19
  current_user
20
20
  end
21
-
22
- def load_authors
23
- @authors = User.unscoped
24
- end
25
21
  end
@@ -1,3 +1,3 @@
1
1
  module SimplePagesRails
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -16,12 +16,6 @@ module SimplePages
16
16
  def pages_cluster_for(name, location)
17
17
  SimplePages::Page.with_cluster(name).layout_at(location).published
18
18
  end
19
-
20
- def load_page_cluster_options
21
- @cluster_options = ::Role.enabled.map do |role|
22
- [t(role.name, scope: 'roles.names'), role.name]
23
- end
24
- end
25
19
  end
26
20
  end
27
21
  end
@@ -9,6 +9,7 @@ module SimplePages
9
9
  self.page_layout_at = %w{general header footer}
10
10
 
11
11
  helper_method :pages_layout_at
12
+ helper_method :page_layout_at
12
13
  end
13
14
 
14
15
  module ClassMethods
@@ -23,12 +24,6 @@ module SimplePages
23
24
  def pages_layout_at(location)
24
25
  SimplePages::Page.without_cluster.layout_at(location).published
25
26
  end
26
-
27
- def load_page_layout_at_options
28
- @layout_at_options = page_layout_at.map do |key|
29
- [t(key, scope: 'simple_pages.layout_at'), key]
30
- end
31
- end
32
27
  end
33
28
  end
34
29
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'rails', '>= 3.2.13'
21
21
  gem.add_dependency 'will_paginate'
22
- gem.add_dependency 'rails-theme-helper'
22
+ gem.add_dependency 'rails-theme-helper', '< 0.1'
23
23
  gem.add_dependency 'chosen-rails'
24
24
  gem.add_dependency 'ckeditor_rails'
25
25
  gem.add_dependency 'stringex'
@@ -18,8 +18,4 @@ module DeviseExt
18
18
  def session_user
19
19
  current_user
20
20
  end
21
-
22
- def load_authors
23
- @authors = User.unscoped
24
- end
25
21
  end
metadata CHANGED
@@ -1,181 +1,181 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-pages-rails
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-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
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
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.2.13
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: will_paginate
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rails-theme-helper
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: chosen-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ckeditor_rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: stringex
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mysql2
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec-rails
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: factory_girl_rails
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: capybara
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: guard-rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: guard-spork
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  description: This gem provides simple pages with rails engine
@@ -185,7 +185,7 @@ executables: []
185
185
  extensions: []
186
186
  extra_rdoc_files: []
187
187
  files:
188
- - .gitignore
188
+ - ".gitignore"
189
189
  - Gemfile
190
190
  - Guardfile
191
191
  - LICENSE.txt
@@ -294,17 +294,17 @@ require_paths:
294
294
  - lib
295
295
  required_ruby_version: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - '>='
297
+ - - ">="
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  required_rubygems_version: !ruby/object:Gem::Requirement
301
301
  requirements:
302
- - - '>='
302
+ - - ">="
303
303
  - !ruby/object:Gem::Version
304
304
  version: '0'
305
305
  requirements: []
306
306
  rubyforge_project:
307
- rubygems_version: 2.0.3
307
+ rubygems_version: 2.2.2
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: provides simple pages with rails engine