kuhsaft 2.2.6 → 2.3.0

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.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -0
  3. data/Rakefile +6 -5
  4. data/app/assets/javascripts/ckeditor/plugins/adv_link/LICENSE.txt +674 -0
  5. data/app/assets/javascripts/ckeditor/plugins/adv_link/README.md +62 -0
  6. data/app/assets/javascripts/ckeditor/plugins/adv_link/dialogs/anchor.js.coffee +81 -0
  7. data/app/assets/javascripts/ckeditor/plugins/adv_link/dialogs/link.js.coffee +1353 -0
  8. data/app/assets/javascripts/ckeditor/plugins/adv_link/images/anchor.png +0 -0
  9. data/app/assets/javascripts/ckeditor/plugins/adv_link/images/hidpi/anchor.png +0 -0
  10. data/app/assets/javascripts/ckeditor/plugins/adv_link/lang/de.js +68 -0
  11. data/app/assets/javascripts/ckeditor/plugins/adv_link/lang/en.js +68 -0
  12. data/app/assets/javascripts/ckeditor/plugins/adv_link/plugin.js.coffee +282 -0
  13. data/app/assets/javascripts/kuhsaft/cms/application.js.coffee.erb +42 -4
  14. data/app/assets/stylesheets/kuhsaft/application.css.sass +0 -3
  15. data/app/assets/stylesheets/kuhsaft/cms/application.css.sass +26 -11
  16. data/app/controllers/kuhsaft/api/pages_controller.rb +14 -0
  17. data/app/controllers/kuhsaft/cms/admin_controller.rb +1 -1
  18. data/app/controllers/kuhsaft/cms/assets_controller.rb +7 -7
  19. data/app/controllers/kuhsaft/cms/bricks_controller.rb +15 -4
  20. data/app/controllers/kuhsaft/cms/pages_controller.rb +8 -15
  21. data/app/controllers/kuhsaft/pages_controller.rb +16 -6
  22. data/app/controllers/kuhsaft/sitemaps_controller.rb +13 -0
  23. data/app/helpers/cms_helper.rb +4 -4
  24. data/app/helpers/kuhsaft/admin_helper.rb +0 -1
  25. data/app/helpers/kuhsaft/cms/admin_helper.rb +1 -2
  26. data/app/helpers/kuhsaft/cms/pages_helper.rb +2 -7
  27. data/app/helpers/pages_helper.rb +8 -37
  28. data/app/helpers/sitemaps_helper.rb +12 -0
  29. data/app/models/kuhsaft/accordion_item_brick.rb +1 -1
  30. data/app/models/kuhsaft/anchor_brick.rb +1 -1
  31. data/app/models/kuhsaft/asset.rb +26 -23
  32. data/app/models/kuhsaft/asset_brick.rb +2 -1
  33. data/app/models/kuhsaft/brick.rb +38 -16
  34. data/app/models/kuhsaft/brick_type.rb +2 -2
  35. data/app/models/kuhsaft/brick_type_filter.rb +0 -2
  36. data/app/models/kuhsaft/column_brick.rb +0 -1
  37. data/app/models/kuhsaft/image_brick.rb +2 -2
  38. data/app/models/kuhsaft/image_size.rb +0 -1
  39. data/app/models/kuhsaft/link_brick.rb +1 -1
  40. data/app/models/kuhsaft/page.rb +111 -107
  41. data/app/models/kuhsaft/page_type.rb +1 -1
  42. data/app/models/kuhsaft/partition.rb +12 -12
  43. data/app/models/kuhsaft/placeholder_brick.rb +8 -0
  44. data/app/models/kuhsaft/publish_state.rb +9 -10
  45. data/app/models/kuhsaft/slider_brick.rb +0 -2
  46. data/app/models/kuhsaft/text_brick.rb +1 -1
  47. data/app/models/kuhsaft/two_column_brick.rb +0 -1
  48. data/app/models/kuhsaft/video_brick.rb +1 -2
  49. data/app/uploaders/kuhsaft/asset_brick_asset_uploader.rb +39 -38
  50. data/app/uploaders/kuhsaft/asset_uploader.rb +43 -43
  51. data/app/uploaders/kuhsaft/image_brick_image_uploader.rb +7 -34
  52. data/app/views/kuhsaft/asset_bricks/asset_brick/_edit.html.haml +3 -2
  53. data/app/views/kuhsaft/cms/admin/_brick_type_dropdown.html.haml +2 -2
  54. data/app/views/kuhsaft/cms/bricks/_brick_item.html.haml +17 -10
  55. data/app/views/kuhsaft/cms/bricks/_new.html.haml +34 -0
  56. data/app/views/kuhsaft/cms/bricks/create.js.haml +6 -0
  57. data/app/views/kuhsaft/cms/bricks/destroy.js.haml +4 -0
  58. data/app/views/kuhsaft/cms/bricks/new.js.haml +11 -0
  59. data/app/views/kuhsaft/cms/pages/_branch.html.haml +2 -2
  60. data/app/views/kuhsaft/cms/pages/_form.html.haml +29 -18
  61. data/app/views/kuhsaft/image_bricks/_image_brick.html.haml +9 -7
  62. data/app/views/kuhsaft/image_bricks/image_brick/_edit.html.haml +3 -0
  63. data/app/views/kuhsaft/pages/show.html.haml +1 -9
  64. data/app/views/kuhsaft/placeholder_bricks/_placeholder_brick.html.haml +1 -1
  65. data/app/views/kuhsaft/sitemaps/index.xml.haml +9 -0
  66. data/app/views/kuhsaft/video_bricks/_video_brick.html.haml +4 -4
  67. data/app/views/layouts/kuhsaft/cms/application.html.haml +4 -3
  68. data/config/initializers/simple_form.rb +4 -4
  69. data/config/initializers/simple_form_bootstrap.rb +14 -14
  70. data/config/locales/de.yml +203 -0
  71. data/config/locales/en.yml +282 -0
  72. data/config/locales/kuhsaft.de.yml +14 -0
  73. data/config/locales/kuhsaft.en.yml +60 -0
  74. data/config/locales/models/kuhsaft/image_brick/de.yml +1 -0
  75. data/config/locales/models/kuhsaft/image_brick/en.yml +16 -0
  76. data/config/locales/models/kuhsaft/text_brick/de.yml +3 -0
  77. data/config/locales/models/kuhsaft/text_brick/en.yml +16 -0
  78. data/config/locales/models/kuhsaft/video_brick/en.yml +15 -0
  79. data/config/locales/views/kuhsaft/cms/pages/de.yml +3 -0
  80. data/config/locales/views/kuhsaft/cms/video_bricks/de.yml +1 -1
  81. data/config/routes.rb +18 -9
  82. data/db/migrate/10_add_redirect_url_to_kuhsaft_pages.rb +1 -1
  83. data/db/migrate/11_update_url_and_redirect_url_value.rb +4 -4
  84. data/db/migrate/13_add_page_title_to_pages.rb +1 -1
  85. data/db/migrate/15_add_alt_text_to_bricks.rb +5 -0
  86. data/db/migrate/16_update_default_value_for_page_type.rb +9 -0
  87. data/db/migrate/17_set_page_type_to_content_for_empty_fields.rb +7 -0
  88. data/lib/generators/kuhsaft/assets/install_generator.rb +1 -2
  89. data/lib/generators/kuhsaft/translations/add_generator.rb +19 -4
  90. data/lib/kuhsaft.rb +1 -0
  91. data/lib/kuhsaft/brick_list.rb +6 -8
  92. data/lib/kuhsaft/engine.rb +5 -1
  93. data/lib/kuhsaft/orderable.rb +22 -19
  94. data/lib/kuhsaft/partial_extractor.rb +1 -1
  95. data/lib/kuhsaft/searchable.rb +8 -11
  96. data/lib/kuhsaft/translatable.rb +35 -19
  97. data/lib/kuhsaft/version.rb +1 -1
  98. data/lib/tasks/kuhsaft_tasks.rake +12 -0
  99. data/lib/templates/kuhsaft/assets/ck-config.js.coffee +7 -0
  100. data/lib/templates/kuhsaft/translations/add_translation.html.erb +4 -10
  101. data/spec/controllers/kuhsaft/api/pages_controller_spec.rb +70 -0
  102. data/spec/controllers/kuhsaft/pages_controller_spec.rb +18 -14
  103. data/spec/controllers/kuhsaft/sitemaps_controller_spec.rb +13 -0
  104. data/spec/dummy/app/assets/javascripts/kuhsaft/cms/ck-config.js.coffee +7 -0
  105. data/spec/dummy/config/application.rb +2 -1
  106. data/spec/dummy/config/database.yml +1 -1
  107. data/spec/factories.rb +3 -3
  108. data/spec/features/cms_pages_spec.rb +13 -13
  109. data/spec/features/search_spec.rb +16 -18
  110. data/spec/helpers/kuhsaft/cms/pages_helper_spec.rb +2 -1
  111. data/spec/kuhsaft_spec.rb +1 -1
  112. data/spec/lib/brick_list_spec.rb +1 -1
  113. data/spec/lib/page_tree_spec.rb +10 -6
  114. data/spec/lib/searchable_spec.rb +4 -4
  115. data/spec/lib/translatable_spec.rb +114 -44
  116. data/spec/models/anchor_brick_spec.rb +1 -1
  117. data/spec/models/asset_spec.rb +1 -1
  118. data/spec/models/brick_spec.rb +1 -1
  119. data/spec/models/page_spec.rb +48 -37
  120. data/spec/models/publish_state_spec.rb +9 -9
  121. data/spec/spec_helper.rb +43 -21
  122. data/spec/support/kuhsaft_spec_helper.rb +2 -2
  123. data/spec/support/write_expectation.rb +57 -0
  124. data/spec/views/kuhsaft/sitemaps/index.xml.haml_spec.rb +67 -0
  125. metadata +119 -4
@@ -1,4 +1 @@
1
1
  //= require_self
2
-
3
- @import bootstrap
4
- @import modules/*
@@ -60,12 +60,17 @@ form
60
60
  padding: 0.5em
61
61
 
62
62
  .btn
63
- opacity: 0
64
- @include transition(opacity, 0.2s)
65
-
66
- &:hover
67
- .btn
68
- opacity: 1
63
+ &.resize-toggler
64
+ .icon-resize-small
65
+ display: block
66
+ .icon-resize-full
67
+ display: none
68
+
69
+ &.collapsed
70
+ .icon-resize-small
71
+ display: none
72
+ .icon-resize-full
73
+ display: block
69
74
 
70
75
  .btn-toolbar
71
76
  margin-top: 0
@@ -82,7 +87,9 @@ form
82
87
  > .brick-item-childs
83
88
  > .brick-list
84
89
  padding-left: 0
90
+
85
91
  #page-content
92
+ padding-bottom: 6em
86
93
  > .brick-list
87
94
  padding-left: 0
88
95
 
@@ -96,7 +103,7 @@ form
96
103
  margin: -1px
97
104
  background: #fff
98
105
 
99
- .brick-item-content
106
+ .brick-item-content.in
100
107
  padding: 1em
101
108
 
102
109
  .empty-state
@@ -155,15 +162,23 @@ form
155
162
  .control-label
156
163
  font-weight: bold
157
164
 
165
+ .modal
166
+ width: 900px
167
+ margin-left: -450px
168
+
169
+ .modal-body
170
+ max-height: none
171
+
172
+ #display-styles
173
+ position: absolute
174
+ top: 7px
175
+ right: 15px
176
+
158
177
  textarea.ckeditor
159
178
  height: 263px
160
179
  display: block !important
161
180
  visibility: show !important
162
181
  position: absolute
163
182
 
164
- .kuhsaft-text-brick
165
- .controls
166
- min-height: 271px
167
-
168
183
  @import nestable
169
184
  @import bootstrap-responsive
@@ -0,0 +1,14 @@
1
+ module Kuhsaft
2
+ module Api
3
+ class PagesController < ActionController::Base
4
+ layout :false
5
+ respond_to :json
6
+
7
+ def index
8
+ I18n.locale = params[:locale]
9
+ @pages = Kuhsaft::Page.unscoped.published.content_page.translated.order(position: :asc)
10
+ render json: @pages.as_json
11
+ end
12
+ end
13
+ end
14
+ end
@@ -3,7 +3,7 @@ module Kuhsaft
3
3
  class AdminController < ActionController::Base
4
4
  respond_to :html
5
5
  layout 'kuhsaft/cms/application'
6
- before_filter :set_content_locale
6
+ before_action :set_content_locale
7
7
 
8
8
  def set_content_locale
9
9
  if params[:content_locale].present?
@@ -5,29 +5,29 @@ module Kuhsaft
5
5
  @assets = Kuhsaft::Asset.by_date
6
6
  respond_with @assets
7
7
  end
8
-
8
+
9
9
  def new
10
10
  @asset = Kuhsaft::Asset.new
11
11
  respond_with @asset
12
12
  end
13
-
13
+
14
14
  def create
15
15
  @asset = Kuhsaft::Asset.create params[:kuhsaft_asset]
16
16
  @asset.save
17
- respond_with @asset, :location => cms_assets_path
17
+ respond_with @asset, location: cms_assets_path
18
18
  end
19
-
19
+
20
20
  def edit
21
21
  @asset = Kuhsaft::Asset.find(params[:id])
22
22
  respond_with @asset
23
23
  end
24
-
24
+
25
25
  def update
26
26
  @asset = Kuhsaft::Asset.find(params[:id])
27
27
  @asset.update_attributes(params[:kuhsaft_asset])
28
- respond_with @asset, :location => cms_assets_path
28
+ respond_with @asset, location: cms_assets_path
29
29
  end
30
-
30
+
31
31
  def destroy
32
32
  @asset = Kuhsaft::Asset.find(params[:id])
33
33
  @asset.destroy
@@ -1,13 +1,24 @@
1
1
  module Kuhsaft
2
2
  module Cms
3
3
  class BricksController < AdminController
4
-
5
4
  respond_to :html, :js
6
5
 
7
6
  def create
8
- @brick = params[:brick][:type].constantize.new(brick_params)
7
+ @brick = params[:brick][:type].constantize.create(brick_params)
9
8
  @brick.image_size = ImageSize.all.first.name.to_s
10
- @brick.save(:validate => false)
9
+
10
+ if @brick.valid?
11
+ respond_with @brick do |format|
12
+ format.js
13
+ format.html { redirect_to edit_cms_page_path(@brick.parents.first) }
14
+ end
15
+ else
16
+ render 'new'
17
+ end
18
+ end
19
+
20
+ def new
21
+ @brick = Kuhsaft::Brick.new(brick_params)
11
22
  end
12
23
 
13
24
  def update
@@ -37,7 +48,7 @@ module Kuhsaft
37
48
  Kuhsaft::Brick.find(id).update_attribute(:position, idx.to_i + 1)
38
49
  end
39
50
  end
40
- render :nothing => true
51
+ render nothing: true
41
52
  end
42
53
 
43
54
  private
@@ -23,8 +23,8 @@ module Kuhsaft
23
23
  @page = Kuhsaft::Page.create(page_params)
24
24
 
25
25
  if @page.valid?
26
- flash[:success] = t('layouts.kuhsaft.cms.flash.success', :subject => Kuhsaft::Page.model_name.human)
27
- respond_with @page, :location => kuhsaft.edit_cms_page_path(@page)
26
+ flash[:success] = t('layouts.kuhsaft.cms.flash.success', subject: Kuhsaft::Page.model_name.human)
27
+ respond_with @page, location: kuhsaft.edit_cms_page_path(@page)
28
28
  else
29
29
  render 'new'
30
30
  end
@@ -40,8 +40,8 @@ module Kuhsaft
40
40
  def update
41
41
  @page = Kuhsaft::Page.find(params[:id])
42
42
  if @page.update_attributes(page_params)
43
- flash[:success] = t('layouts.kuhsaft.cms.flash.success', :subject => Kuhsaft::Page.model_name.human)
44
- respond_with @page, :location => kuhsaft.edit_cms_page_path(@page)
43
+ flash[:success] = t('layouts.kuhsaft.cms.flash.success', subject: Kuhsaft::Page.model_name.human)
44
+ respond_with @page, location: kuhsaft.edit_cms_page_path(@page)
45
45
  else
46
46
  render 'edit'
47
47
  end
@@ -60,17 +60,10 @@ module Kuhsaft
60
60
  private
61
61
 
62
62
  def page_params
63
- safe_params = [:title,
64
- :page_title,
65
- :slug,
66
- :redirect_url,
67
- :url,
68
- :page_type,
69
- :parent_id,
70
- :keywords,
71
- :description,
72
- :published,
73
- :position]
63
+ safe_params = [
64
+ :title, :page_title, :slug, :redirect_url, :url, :page_type, :parent_id,
65
+ :keywords, :description, :published, :position
66
+ ]
74
67
  params.require(:page).permit(*safe_params)
75
68
  end
76
69
  end
@@ -1,6 +1,7 @@
1
1
  module Kuhsaft
2
2
  class PagesController < ::ApplicationController
3
3
  respond_to :html
4
+ before_action :find_page_by_url, only: :show
4
5
 
5
6
  def index
6
7
  @search = params[:search]
@@ -10,20 +11,29 @@ module Kuhsaft
10
11
  end
11
12
 
12
13
  def show
13
- url = locale.to_s
14
- url += "/#{params[:url]}" if params[:url].present?
15
- @page = Kuhsaft::Page.find_by_url(url)
16
-
17
14
  if @page.present? && @page.redirect? && @page.redirect_url.present?
18
- redirect_url = @page.redirect_url.sub(/\A\/+/,'') # remove all preceding slashes
15
+ redirect_url = @page.redirect_url.sub(/\A\/+/, '') # remove all preceding slashes
19
16
  redirect_to "/#{redirect_url}"
20
17
  elsif @page.present?
21
18
  respond_with @page
22
19
  elsif @page.blank? && respond_to?(:handle_404)
23
20
  handle_404
24
21
  else
25
- raise ActionController::RoutingError.new('Not Found')
22
+ raise ActionController::RoutingError, 'Not Found'
26
23
  end
27
24
  end
25
+
26
+ def lookup_by_id
27
+ @page = Page.find(params[:id])
28
+ redirect_to "/#{@page.url}"
29
+ end
30
+
31
+ private
32
+
33
+ def find_page_by_url
34
+ url = locale.to_s
35
+ url += "/#{params[:url]}" if params[:url].present?
36
+ @page = Kuhsaft::Page.find_by_url(url)
37
+ end
28
38
  end
29
39
  end
@@ -0,0 +1,13 @@
1
+ module Kuhsaft
2
+ class SitemapsController < ::ApplicationController
3
+ def index
4
+ last_page = Kuhsaft::Page.published.last
5
+ if stale?(etag: last_page, last_modified: last_page.updated_at.utc)
6
+ respond_to do |format|
7
+ format.html
8
+ format.xml { @pages = Kuhsaft::Page.published }
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,15 +1,15 @@
1
1
  module CmsHelper
2
- def admin_tab title, path
3
- content_tag :li, link_to(title, path), :class => (:current if request.path.include?(path))
2
+ def admin_tab(title, path)
3
+ content_tag :li, link_to(title, path), class: (:current if request.path.include?(path))
4
4
  end
5
5
 
6
6
  def available_parent_pages
7
7
  pages = []
8
- pages << { :title => t('kuhsaft.cms.pages.new.pages'), :link => kuhsaft.cms_pages_path(:locale => :en) }
8
+ pages << { title: t('kuhsaft.cms.pages.new.pages'), link: kuhsaft.cms_pages_path(locale: :en) }
9
9
  if params[:parent_id].present?
10
10
  parent_page = Kuhsaft::Page.find(params[:parent_id])
11
11
  pages += parent_page.parent_pages
12
12
  end
13
- pages << { :title => t('kuhsaft.cms.pages.new.new_page'), :link => '#' }
13
+ pages << { title: t('kuhsaft.cms.pages.new.new_page'), link: '#' }
14
14
  end
15
15
  end
@@ -1,6 +1,5 @@
1
1
  module Kuhsaft
2
2
  module AdminHelper
3
-
4
3
  #
5
4
  # When rendering the layout of our host application,
6
5
  # the paths of the host application are not visible to the engine
@@ -1,7 +1,6 @@
1
1
  module Kuhsaft
2
2
  module Cms
3
3
  module AdminHelper
4
-
5
4
  def render_language_switch?
6
5
  I18n.available_locales.size > 1
7
6
  end
@@ -15,7 +14,7 @@ module Kuhsaft
15
14
  end
16
15
 
17
16
  link_to locale.to_s.upcase, url_for(
18
- :action => action, :content_locale => locale)
17
+ action: action, content_locale: locale)
19
18
  end
20
19
  end
21
20
  end
@@ -1,17 +1,12 @@
1
1
  module Kuhsaft
2
2
  module Cms
3
3
  module PagesHelper
4
-
5
4
  def content_tab_active(page)
6
- unless hide_content_tab?(page)
7
- :active
8
- end
5
+ :active unless hide_content_tab?(page)
9
6
  end
10
7
 
11
8
  def metadata_tab_active(page)
12
- if hide_content_tab?(page)
13
- :active
14
- end
9
+ :active if hide_content_tab?(page)
15
10
  end
16
11
 
17
12
  def hide_content_tab?(page)
@@ -1,73 +1,44 @@
1
1
  module PagesHelper
2
- def current_page
3
- # page = @page
4
- # yield @page if block_given?
5
- # rescue
6
- end
7
-
8
- def current_page_path(lang=nil)
9
- # if @page.present?
10
- # '/' + Kuhsaft::Page.find(@page.id).localized_pages.where('locale = ?', lang).first.url
11
- # else
12
- # root_path
13
- # end
14
- # rescue
15
- # root_path
16
- end
17
-
18
- def asset_for id
2
+ def asset_for(id)
19
3
  Kuhsaft::Asset.find(id)
20
4
  end
21
5
 
22
- def render_markdown text
6
+ def render_markdown(text)
23
7
  RDiscount.new(text).to_html if text.present?
24
8
  end
25
9
 
26
- def navigation_for options
27
- if options.is_a?(Hash) && slug = options.delete(:slug)
28
- pages = Kuhsaft::LocalizedPage.navigation(slug).first.page.children.current_locale.published rescue []
29
- elsif (options.is_a?(Fixnum) && id = options) || id = options.delete(:id)
30
- pages = Kuhsaft::Page.published.where('parent_id = ?', id)
31
- elsif options.nil?
32
- pages = Kuhsaft::Page.published.roots
33
- end
34
- yield pages if block_given? && pages.length > 0
35
- pages
36
- end
37
-
38
10
  def homepage
39
11
  Kuhsaft::Page.roots.first
40
12
  end
41
13
 
42
- def page_for_level num
14
+ def page_for_level(num)
43
15
  input = controller.current_url if controller.respond_to? :current_url
44
16
  input ||= params[:url].presence || ''
45
17
  url = input.split('/').take(num + 1).join('/') unless input.blank?
46
18
  page = Kuhsaft::Page.find_by_url(url)
47
19
  yield page if block_given?
48
20
  page
49
- rescue
50
21
  end
51
22
 
52
- def active_page_class page
23
+ def active_page_class(page)
53
24
  input = controller.current_url if controller.respond_to? :current_url
54
25
  input ||= params[:url].presence || ''
55
26
  input.include?(page.url.to_s) ? :active : nil
56
27
  end
57
28
 
58
- def current_page_class page
29
+ def current_page_class(page)
59
30
  :current if active_page_class(page) == :active
60
31
  end
61
32
 
62
33
  def read_more_link(id)
63
34
  link_to(id, :'data-toggle' => 'collapse', :'data-target' => id, :class => 'collapsed button button-read-more') do
64
- @content = content_tag(:p, t('kuhsaft.text_bricks.text_brick.read_more'), :class => 'read-more-text')
65
- @content << content_tag(:p, t('kuhsaft.text_bricks.text_brick.read_less'), :class => 'read-less-text')
35
+ @content = content_tag(:p, t('kuhsaft.text_bricks.text_brick.read_more'), class: 'read-more-text')
36
+ @content << content_tag(:p, t('kuhsaft.text_bricks.text_brick.read_less'), class: 'read-less-text')
66
37
  end
67
38
  end
68
39
 
69
40
  def search_page_form
70
- form_tag kuhsaft.pages_path, :method => :get, :class => 'form-inline' do
41
+ form_tag kuhsaft.pages_path, method: :get, class: 'form-inline' do
71
42
  if block_given?
72
43
  yield
73
44
  else
@@ -0,0 +1,12 @@
1
+ module SitemapsHelper
2
+ def locales_with_block(page)
3
+ I18n.available_locales.each do |locale|
4
+ I18n.with_locale locale do
5
+ if page.url.present?
6
+ url = "http://#{request.host_with_port}/#{page.url}"
7
+ yield(url)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,6 +1,6 @@
1
1
  module Kuhsaft
2
2
  class AccordionItemBrick < ColumnBrick
3
- validates :caption, :presence => true
3
+ validates :caption, presence: true
4
4
 
5
5
  def user_can_delete?
6
6
  true