kuhsaft 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f6610c85076199dc2cffcb24437ede0ef6e6d07
4
- data.tar.gz: 56d5e2ed22b7ec384a1fa15731888bfd85699d5c
3
+ metadata.gz: f48c54fc9835d1c425f143c773aa93b85c94eab2
4
+ data.tar.gz: 6e54f3e91d24a7f7705c92b189b8c59fd49f72b9
5
5
  SHA512:
6
- metadata.gz: dd6ac9bd19452a2d1e117619c9ead75d8721f108606764ad3f2acc24aba98e5fc08347bc1f9377ab246672f4e4e11d8a15c2a7496b271730e4d0d697d522511b
7
- data.tar.gz: 1570c92b8e110fe146f381fba81142a452e64d84e34ae4b6c3a9d14d074a14f59e6e1a6b0baec201fa6206d00f30d9f04c10b274b81018840ce61085ca51aa79
6
+ metadata.gz: de22955455630cabe26e8ae610dbcca4419b422c1cc0179c98211e2a1e7864790b8c06ae7c82b95ee6a0d1fb90e6f92add3526a6bb2959f5ac3983c6f2a24cd3
7
+ data.tar.gz: fb6a08a93a30f74f5a12f9282492e150ea0088492203ef32e07cd90e5e7de4c6e7fcf5c85655cd3c38f4d64e715b81a40363ceb212cb22799efee0728505b058
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- Kuhsaft has been replaced by
1
+ **Kuhsaft has been replaced by
2
2
  [qBrick](http://github.com/screenconcept/qbrick). Please switch as soon
3
- as possible.
3
+ as possible.**
4
4
 
5
5
  # Kuhsaft. A CMS as simple as it could be
6
6
 
@@ -23,6 +23,20 @@ CKEDITOR.config.customConfig = "<%= asset_path('kuhsaft/cms/ck-config.js') %>"
23
23
  loadTextEditor = ->
24
24
  CKEDITOR.replaceAll('ckeditor')
25
25
 
26
+ reloadTextEditor = (ui) ->
27
+ editor_ids = ui.item.find('.ckeditor').map ->
28
+ @id
29
+
30
+ for editor in editor_ids
31
+ CKEDITOR.replace editor
32
+
33
+ destroyTextEditor = (ui)->
34
+ editor_ids = ui.item.find('.ckeditor').map ->
35
+ @id
36
+
37
+ for editor in editor_ids
38
+ CKEDITOR.instances[editor].destroy(true)
39
+
26
40
  pageType = ->
27
41
  $('#page_page_type option:selected').val()
28
42
 
@@ -59,7 +73,11 @@ sortableBrick = ->
59
73
  sortForm = $('#bricks-sort-form form')
60
74
  sortForm.find('input[name="bricks[ids]"]').val(idList.toArray().join(','))
61
75
  sortForm.trigger('submit')
62
- )
76
+ stop: (event, ui) ->
77
+ reloadTextEditor(ui)
78
+ start: (event, ui) ->
79
+ destroyTextEditor(ui)
80
+ ).disableSelection()
63
81
 
64
82
  window.initSubmitLinks = (selector = null)->
65
83
  selector ||= $('body')
@@ -23,8 +23,9 @@ module Kuhsaft
23
23
 
24
24
  def update
25
25
  @brick = Kuhsaft::Brick.find(params[:id])
26
+ @brick.image_size ||= ImageSize.all.first.name.to_s
27
+ params['brick'].delete('image_cache') if params['brick']['image']
26
28
  @brick.update_attributes(brick_params)
27
-
28
29
  #
29
30
  # rails will fall back to html if ajax can't be used
30
31
  # this is the case with the image brick, because ajax does not
@@ -1,5 +1,5 @@
1
1
  .pull-left
2
- - if brick_content.present?
2
+ - if brick_content.present? || brick.user_can_save?
3
3
  .resize-toggler.btn.btn-small{ 'data-toggle' => 'collapse', 'data-target' => "#brick-content-#{brick.id}" }
4
4
  %i.icon-resize-full
5
5
  %i.icon-resize-small
@@ -1,14 +1,15 @@
1
1
  .brick-item{ id: brick.to_brick_item_id, class: brick.to_style_class, 'data-id' => brick.id }
2
- = simple_form_for brick, as: :brick, url: kuhsaft.cms_brick_path(brick), remote: !brick.uploader?, html: { id: nil }, wrapper: :bootstrap do |form|
2
+ = simple_form_for brick, as: :brick, url: kuhsaft.cms_brick_path(brick), remote: true, html: { id: nil }, wrapper: :bootstrap do |form|
3
3
  = form.hidden_field :position, class: 'position-field'
4
4
  - brick_content = render(brick.to_edit_partial_path, brick: brick, form: form)
5
5
 
6
6
  .brick-item-header.clearfix
7
7
  = render('kuhsaft/cms/bricks/brick_header', brick: brick, brick_content: brick_content, form: form)
8
8
 
9
- - if brick_content.present?
9
+ - if brick_content.present? || brick.user_can_save?
10
10
  .brick-item-content.collapse.in{ id: "brick-content-#{brick.id}", 'data-toggle' => true }
11
- = brick_content
11
+ - if brick_content.present?
12
+ = brick_content
12
13
  - if brick.user_can_save?
13
14
  - # save button
14
15
  .clearfix
@@ -5,7 +5,7 @@
5
5
  - if @page.google_verification_key.present? && @page == homepage
6
6
  %meta{ name: 'google-site-verification', content: @page.google_verification_key }
7
7
 
8
- - cache [@page, I18n.locale, @page.children, @page.bricks] do
8
+ - cache [@page, I18n.locale, "relatedhash-#{(@page.children + @page.bricks).map(&:cache_key).join.hash}"] do
9
9
  - unless @page.blank?
10
10
  .page-content
11
11
  -# TODO: refactor into scopes or simplify otherwise:
@@ -1,3 +1,3 @@
1
1
  module Kuhsaft
2
- VERSION = '2.6.0'
2
+ VERSION = '2.6.1'
3
3
  end
@@ -26,6 +26,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require_relative f }
26
26
  ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
27
27
 
28
28
  RSpec.configure do |config|
29
+ config.infer_spec_type_from_file_location!
29
30
 
30
31
  # Remove this line if you don't want RSpec's should and should_not
31
32
  # methods or matchers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuhsaft
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Immanuel Häussermann
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-09-28 00:00:00.000000000 Z
15
+ date: 2015-03-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec-rails
@@ -777,7 +777,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
777
777
  version: '0'
778
778
  requirements: []
779
779
  rubyforge_project: kuhsaft
780
- rubygems_version: 2.1.10
780
+ rubygems_version: 2.0.3
781
781
  signing_key:
782
782
  specification_version: 4
783
783
  summary: A tool that helps you to manage your content within your app.