bolton-cms-padrino 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bolton_cms/display/helpers/helper.rb +1 -1
- data/bolton_cms/manage/controllers/accounts.rb +0 -1
- data/bolton_cms/manage/controllers/pages.rb +0 -1
- data/bolton_cms/manage/controllers/sessions.rb +0 -1
- data/gems/bolton-cms-padrino-0.2.8.gem +0 -0
- data/lib/bolton_cms/models/page.rb +2 -0
- data/lib/bolton_cms/version.rb +1 -1
- data/spec/models/page_spec.rb +7 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGY0N2JhYjZmYjJmN2IxODk1NTY5ZmE0NzJjMGU3ZGE1YzM5YThjNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDVmNTRlZTM3NDQ2NjYwYjBmMmI1OGQ1YmU0MDM2MmYyOWUwNWJmZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjMwYTUyZDc0YjA3OTMyNTE2Y2VlNDA5ZmQxZmEzYzMwYzIzZjE1N2ViNzcx
|
10
|
+
NDhkM2NjM2JmMWE2MGExYWE5YzRhNzlmNjZhYzExYzJlMjQ0NWE5ODNiNTBi
|
11
|
+
ZjIxNDBhMTlhZTg1Yzk4NDY1ZTRkMDM5ZGZhZGVkMGI0ZWUxOTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWQxODgzZWZlNTg0ZjNjZWM4Yjc5YTNlMzliYjVjYTM0N2FhNDcwNTMwMGVh
|
14
|
+
YTg0NDVjYzBkZjgwNTY5MTQxZWJhMGJlZTU2OWIxODUxODk1NDAxYmZlODk5
|
15
|
+
MzJiZjMyZWQ2YjQ5YzJlMmEwYWU4OGJmYjUwN2U0MjZhN2UyNWE=
|
@@ -40,7 +40,7 @@ BoltonCms::Display.helpers do
|
|
40
40
|
def render_active_fragments(page, wrapper_entity=:section)
|
41
41
|
output = ''
|
42
42
|
|
43
|
-
|
43
|
+
page.active_fragments.each do |label|
|
44
44
|
if fragment = @page.find_fragment(label)
|
45
45
|
output << content_tag(
|
46
46
|
wrapper_entity,
|
@@ -22,7 +22,6 @@ BoltonCms::Manage.controllers :accounts do
|
|
22
22
|
flash[:success] = "Account #{@account.name} (#{@account.email}) created"
|
23
23
|
params[:save_and_continue] ? redirect(url(:accounts, :index)) : redirect(url(:accounts, :edit, id: @account.id))
|
24
24
|
else
|
25
|
-
logger.info @account.errors.to_json
|
26
25
|
flash.now[:error] = "Account #{@account.name} (#{@account.email}) could not be created"
|
27
26
|
render 'accounts/new'
|
28
27
|
end
|
@@ -65,7 +65,6 @@ BoltonCms::Manage.controllers :pages do
|
|
65
65
|
|
66
66
|
if @page.update_attributes(params[:page])
|
67
67
|
@page.manage_fragments BoltonCms::TEMPLATES[@page.template.to_s]['fragments'].clone
|
68
|
-
logger.info @page.inactive_fragments
|
69
68
|
|
70
69
|
flash[:success] = "Page '#{@page.title}' saved"
|
71
70
|
|
Binary file
|
data/lib/bolton_cms/version.rb
CHANGED
data/spec/models/page_spec.rb
CHANGED
@@ -8,7 +8,7 @@ describe Page do
|
|
8
8
|
@grandchild_page = Page.new(template: :default, title: 'Grandchild')
|
9
9
|
@default_fragments = ['Fragment 1', 'Fragment 2']
|
10
10
|
@default_fragments.each do |label|
|
11
|
-
@page.fragments << Fragment.new(label: label, body: '')
|
11
|
+
@page.fragments << Fragment.new(label: label, body: 'test')
|
12
12
|
end
|
13
13
|
@attachment1 = File.open(Padrino.root('spec/fixtures/files/test1.jpg'))
|
14
14
|
@attachment2 = File.open(Padrino.root('spec/fixtures/files/test2.jpg'))
|
@@ -78,6 +78,12 @@ describe Page do
|
|
78
78
|
@page.inactive_fragments.size.must_equal 1
|
79
79
|
end
|
80
80
|
|
81
|
+
it 'should just delete an inactive fragment if it\'s empty' do
|
82
|
+
@page.fragments.first.body = ''
|
83
|
+
@page.manage_fragments(['Fragment 2'])
|
84
|
+
@page.inactive_fragments.size.must_equal 0
|
85
|
+
end
|
86
|
+
|
81
87
|
it 'should have page body' do
|
82
88
|
@page.must have_field(:body)
|
83
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolton-cms-padrino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Hudson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -372,6 +372,7 @@ files:
|
|
372
372
|
- config/mongoid.yml
|
373
373
|
- db/seeds.rb
|
374
374
|
- gems/bolton-cms-padrino-0.2.7.gem
|
375
|
+
- gems/bolton-cms-padrino-0.2.8.gem
|
375
376
|
- lib/bolton-cms-padrino.rb
|
376
377
|
- lib/bolton_cms/attachment_uploader.rb
|
377
378
|
- lib/bolton_cms/config.rb
|