blueberry_cms 0.1.1.2 → 0.1.1.6

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
- SHA1:
3
- metadata.gz: 7180df0710431bc22fda1a58c18ff7852253d3a5
4
- data.tar.gz: 158855e925169811d1122648bcefee6a1cee6e57
2
+ SHA256:
3
+ metadata.gz: df8fee8e9848dbc6b1c5932d0ffecf48ef2cff79654e3391c7341a220e408382
4
+ data.tar.gz: 7135a5c2ffaaa10ae09e25b43a9c8d3617650bf27c844c3f50cd315c8d140ecd
5
5
  SHA512:
6
- metadata.gz: 7c994eb3ed5a42274901c64e8c95263c4362d79c59ccc16ff4825a0f49d115daf3e011aeef10d2ec1daf458303e26f4e2a09d36df7932c4afeefabe5dcd6c902
7
- data.tar.gz: 902affdda4a8c46a625e165c6810c7d61cf033daba28fc37b5bd1fc0eba44ce84c541a520ff7656e37193a07442a3ae005da78f31a0c3a428f19338552054c56
6
+ metadata.gz: 6fe637cd0dd056613d197c1bd168487ab5bd035b90e1dc902e62f118f2a4f1fa132cf90c9ec4d0dadd470b02b49763d294b725c2d7c7aab230f5aab1f69faa36
7
+ data.tar.gz: 7cd98f97f15abdfa105294cda77d010ef75a97cb1616aea11940b332f4b9b21ce66421b0d37945c2486247c5f1e5085609b8e2fc235186625159bc661f50cc1d
@@ -8,6 +8,6 @@ class BlockDecorator < Draper::Decorator
8
8
  end
9
9
 
10
10
  def process_markdown(string)
11
- h.sanitize Markdown.new(string).to_html, tags: %w(strong em)
11
+ h.sanitize(Markdown.new(string).to_html, tags: %w(strong em))
12
12
  end
13
13
  end
@@ -1,5 +1,9 @@
1
1
  module BlueberryCMS
2
2
  module PagesHelper
3
+ def block_visible?(object)
4
+ object.new_record? || object.errors.any?
5
+ end
6
+
3
7
  def nested_set_options(klass, current_page = nil)
4
8
  @cache ||= {}
5
9
  @cache[klass] ||= klass.traverse(:depth_first)
@@ -1,3 +1,5 @@
1
+ require 'redcarpet/render_strip'
2
+
1
3
  module BlueberryCMS
2
4
  class Menu
3
5
  include Mongoid::Document
@@ -6,7 +8,10 @@ module BlueberryCMS
6
8
  field :name, type: String
7
9
  validates :name, presence: true
8
10
 
9
- slug :name
11
+ slug :name do |menu|
12
+ renderer = Redcarpet::Markdown.new(Redcarpet::Render::StripDown)
13
+ renderer.render(menu.name).squish
14
+ end
10
15
 
11
16
  embeds_many :links, class_name: 'BlueberryCMS::MenuLink',
12
17
  cascade_callbacks: true,
@@ -1,3 +1,5 @@
1
+ require 'redcarpet/render_strip'
2
+
1
3
  module BlueberryCMS
2
4
  class Page
3
5
  include Mongoid::Document
@@ -43,7 +45,8 @@ module BlueberryCMS
43
45
  }
44
46
 
45
47
  def slug_source
46
- custom_slug.presence || name
48
+ renderer = Redcarpet::Markdown.new(Redcarpet::Render::StripDown)
49
+ renderer.render(custom_slug.presence || name).squish
47
50
  end
48
51
 
49
52
  def rebuild_children_paths
@@ -8,6 +8,7 @@ module BlueberryCMS
8
8
  enumerable :orientation, %i[left right]
9
9
 
10
10
  mount_uploader :image, ImageUploader
11
+ mount_uploader :background_image, ImageUploader
11
12
  end
12
13
  end
13
14
  end
@@ -1,4 +1,4 @@
1
- .rich-text-block data-controller='rich-text-block'
1
+ .rich-text-block data-controller='position-switch'
2
2
  .form-layout
3
3
  = f.input :css_class
4
4
 
@@ -6,11 +6,11 @@
6
6
  collection: translated_enum(BlueberryCMS::PageBlocks::RichText, :orientation),
7
7
  include_blank: false,
8
8
  input_html: { \
9
- data: { target: 'rich-text-block.positionSwitcher', action: 'change->rich-text-block#changePosition' } \
9
+ data: { target: 'position-switch.positionSwitcher', action: 'change->position-switch#changePosition' } \
10
10
  }
11
11
 
12
12
  .form-layout
13
- div data={ target: 'rich-text-block.wrapper' }
13
+ div data={ target: 'position-switch.wrapper' }
14
14
  .image-holder
15
15
  - if f.object.image.present?
16
16
  - if f.object.image?
@@ -28,3 +28,15 @@
28
28
  = f.input :content
29
29
  = f.simple_fields_for :content_translations do |localized_field|
30
30
  = localized_field.input locale, input_html: { value: richtext.content_translations[locale], class: 'redactor' }, as: :text, label: false
31
+
32
+ .form-layout
33
+ .image-holder
34
+ - if f.object.background_image.present?
35
+ - if f.object.background_image?
36
+ - if f.object.background_image.content_type == 'image/svg+xml'
37
+ = image_tag f.object.background_image.url
38
+ - else
39
+ = image_tag f.object.background_image.url(:thumb)
40
+ = f.input :remove_background_image, as: :boolean
41
+ - else
42
+ = f.input :background_image
@@ -4,18 +4,23 @@ cs:
4
4
  title: Nadpis
5
5
  mongoid:
6
6
  attributes:
7
+ blueberry_cms/image:
8
+ href: URL
9
+ name: Název
7
10
  blueberry_cms/link:
8
11
  css_class: CSS Bloku
9
12
  description: Popis
10
13
  image: Obrázek
11
14
  page_id: Stránka
12
15
  percentage: Procenta
16
+ url: URL
13
17
  blueberry_cms/page_block:
14
- block_anchor: ID Bloku
18
+ block_anchor: ID bloku
15
19
  bottom_margin: Dolní mezera
16
20
  bottom_margin_xs: Dolní mezera mobil
17
- css_class: CSS Bloku
21
+ css_class: CSS bloku
18
22
  description: Popis
23
+ image: Obrázek
19
24
  images_files: Obrázky
20
25
  kind: Typ
21
26
  name: Název
@@ -26,6 +31,8 @@ cs:
26
31
  top_margin: Horní mezera
27
32
  top_margin_xs: Horní mezera mobil
28
33
  blueberry_cms/page_blocks/rich_text:
34
+ background_image: Obrázek na pozadí
35
+ remove_background_image: Odstranit obrázek na pozadí
29
36
  remove_image: Odstranit obrázek
30
37
  blueberry_cms/page_blocks/shared:
31
38
  block_id: Blok
@@ -33,7 +40,7 @@ cs:
33
40
  answer: Odpověď
34
41
  question: Otázka
35
42
  blueberry_cms/video:
36
- movie_url: Url videa
43
+ movie_url: URL videa
37
44
  title: Název
38
45
  errors:
39
46
  messages:
@@ -30,6 +30,8 @@ cs:
30
30
  add: Přidat otázku
31
31
  faq_questions_fields:
32
32
  remove: Odebrat otázku
33
+ gallery_images_fields:
34
+ remove: Odebrat obrázek
33
35
  links:
34
36
  add: Přidat odkaz
35
37
  links_links_fields:
@@ -1,3 +1,3 @@
1
1
  module BlueberryCMS
2
- VERSION = '0.1.1.2'.freeze
2
+ VERSION = '0.1.1.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueberry_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.2
4
+ version: 0.1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Magnusek
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-01-10 00:00:00.000000000 Z
12
+ date: 2019-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: carrierwave
@@ -85,16 +85,16 @@ dependencies:
85
85
  name: mongoid
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: 6.4.2
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: 6.4.2
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: mongoid-slug
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -371,8 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
371
371
  - !ruby/object:Gem::Version
372
372
  version: '0'
373
373
  requirements: []
374
- rubyforge_project:
375
- rubygems_version: 2.6.13
374
+ rubygems_version: 3.0.1
376
375
  signing_key:
377
376
  specification_version: 4
378
377
  summary: Summary of BlueberryCMS.