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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODVjYTQyNGY3ZTIxYWJjNjJmNWY0ZTY5YzAxZWNkNDYzOWUwNWIxZQ==
4
+ OGY0N2JhYjZmYjJmN2IxODk1NTY5ZmE0NzJjMGU3ZGE1YzM5YThjNA==
5
5
  data.tar.gz: !binary |-
6
- NTAwZWE5M2Q5Zjk1MjUyYzA0OTU2NjBiMTQzOGNiMzI5YzQxMmVmMQ==
6
+ MDVmNTRlZTM3NDQ2NjYwYjBmMmI1OGQ1YmU0MDM2MmYyOWUwNWJmZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzFhN2E4ZjUxNzc3Y2Q0ZGYwN2IwZTIzMTA1NmNmMGJlYjZkYTgwNWVkOWFj
10
- OTk0ZDg5NmUzOWY4MjM4MDVjN2YwM2VjNDI0MjU5NjM4NTE3ODI0YzM1NzFj
11
- YWZlMTg0ZWUyMWU2YzJkMDg2NjdkZjkxZjgxYzhiZWVkODFiMjA=
9
+ NjMwYTUyZDc0YjA3OTMyNTE2Y2VlNDA5ZmQxZmEzYzMwYzIzZjE1N2ViNzcx
10
+ NDhkM2NjM2JmMWE2MGExYWE5YzRhNzlmNjZhYzExYzJlMjQ0NWE5ODNiNTBi
11
+ ZjIxNDBhMTlhZTg1Yzk4NDY1ZTRkMDM5ZGZhZGVkMGI0ZWUxOTg=
12
12
  data.tar.gz: !binary |-
13
- OGVlZTczMDg5Nzc3MDFmMjBiNDA1ZjhlZmFiZmQxMGJkODE3MTkxYTU5OGQ2
14
- OGQ2YWFiMTMyOWM2YTIzYmJhZTQyMjQxMmJmYWQ4MzhmMjczZGRmZTJhZTNh
15
- OGZhYjU4Yzg0NDkxYTNiOWU4YzcxOGVmMzcxZjBhMDFhNDIxYWE=
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
- BoltonCms::TEMPLATES[page.template.to_s]['fragments'].each do |label|
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
 
@@ -5,7 +5,6 @@ BoltonCms::Manage.controllers :sessions do
5
5
  end
6
6
 
7
7
  post :create do
8
- logger.info "#{params[:email]}, #{params[:password]}"
9
8
  if account = Account.authenticate(params[:email], params[:password])
10
9
  set_current_account(account)
11
10
  redirect url(:base, :index)
Binary file
@@ -69,6 +69,8 @@ class Page
69
69
  fragments << Fragment.new(label: fragment)
70
70
  end
71
71
 
72
+ inactive_fragments.where(body: '').destroy_all
73
+
72
74
  save
73
75
  end
74
76
 
@@ -1,3 +1,3 @@
1
1
  module BoltonCms
2
- VERSION = '0.2.8'
2
+ VERSION = '0.2.9'
3
3
  end
@@ -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.8
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: 2013-12-28 00:00:00.000000000 Z
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