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
@@ -0,0 +1,34 @@
1
+ #brick-form.modal.hide.fade{ :tabindex => '-1', :role => 'dialog' }
2
+ .modal-header
3
+ %button.close{ 'data-dismiss' => 'modal' }
4
+ ×
5
+ %h3= t('.create_new', :brick => @brick.backend_label)
6
+
7
+ = simple_form_for @brick, :as => :brick, :url => kuhsaft.cms_bricks_path, :method => :post, :remote => true, :html => { :id => nil }, :wrapper => :bootstrap do |form|
8
+ .modal-body
9
+ = form.hidden_field :position, :class => 'position-field'
10
+ = form.hidden_field :type
11
+ = form.hidden_field :brick_list_id
12
+ = form.hidden_field :brick_list_type
13
+
14
+ - brick_content = render(@brick.to_edit_partial_path, :brick => @brick, :form => form)
15
+
16
+ - unless @brick.available_display_styles.empty?
17
+ #display-styles.btn-group.pull-right
18
+ .btn.btn-small
19
+ %i.icon-tint
20
+ %a.btn.btn-small.dropdown-toggle{ 'data-toggle' => 'dropdown', 'href' => '#' }
21
+ %span.caret
22
+ %ul.dropdown-menu.pull-right
23
+ %li
24
+ = form.input :display_styles, :collection => @brick.translated_available_display_styles, :as => :check_boxes
25
+
26
+ - if brick_content.present?
27
+ = brick_content
28
+ - else
29
+ = t('.no_content')
30
+
31
+ .modal-footer
32
+ .clearfix
33
+ .pull-right
34
+ = form.button :submit, t('.save'), :class => 'btn-success'
@@ -6,3 +6,9 @@ initSavePopover(newlyInsertedBrick)
6
6
  initSubmitLinks(newlyInsertedBrick)
7
7
 
8
8
  $(newlyInsertedBrick).find('textarea.ckeditor').each(function (index, elem) { initCKEditor(elem.id) })
9
+
10
+ $("#form-container #brick-form").modal('hide')
11
+
12
+ -# Toggle collapse-bricks-nav
13
+ var showCollapseBricksNav = "#{@brick.brick_list.bricks.present?}" == 'true'
14
+ toggleCollapseBricksNav(showCollapseBricksNav)
@@ -5,3 +5,7 @@ brick.remove()
5
5
  if(brickList.children().length == 0){
6
6
  brickList.html("#{j(render('empty_state', :brick => @parent_brick))}")
7
7
  }
8
+
9
+ -# Toggle collapse-bricks-nav
10
+ var showCollapseBricksNav = "#{@brick.brick_list.bricks.present?}" == 'true'
11
+ toggleCollapseBricksNav(showCollapseBricksNav)
@@ -0,0 +1,11 @@
1
+ $("#form-container #brick-form").modal('hide')
2
+ $("#form-container #brick-form").remove()
3
+
4
+ $("#form-container").append("#{j(render('kuhsaft/cms/bricks/new', :brick => @brick, :format => :html))}")
5
+
6
+ $("#form-container").find('textarea.ckeditor').each(function (index, elem) { initCKEditor(elem.id) })
7
+
8
+ -# Stop propagation of display styles dropdown
9
+ stopPropagationOfDisplayStyles($('#display-styles ul'))
10
+
11
+ $("#brick-form").modal()
@@ -8,10 +8,10 @@
8
8
 
9
9
  .button-group
10
10
  - if page.children.empty?
11
- = link_to kuhsaft.cms_page_path(page), :confirm => t('kuhsaft.cms.admin.confirm_delete', :name => page.title), :method => :delete, :class => 'btn btn-small btn-danger' do
11
+ = link_to kuhsaft.cms_page_path(page), confirm: t('kuhsaft.cms.admin.confirm_delete', name: page.title), method: :delete, class: 'btn btn-small btn-danger' do
12
12
  %i.icon-trash.icon-white
13
13
 
14
- = link_to kuhsaft.new_cms_page_path(:parent_id => page.id), :class => 'btn btn-small' do
14
+ = link_to kuhsaft.new_cms_page_path(parent_id: page.id), class: 'btn btn-small' do
15
15
  %i.icon-plus-sign
16
16
  = t('kuhsaft.cms.pages.index.add_page')
17
17
 
@@ -1,34 +1,45 @@
1
1
  %ul.nav.nav-tabs.js-tabs
2
- %li{ :class => metadata_tab_active(@page) }
2
+ %li{ class: metadata_tab_active(@page) }
3
3
  = link_to t('.tab_metadata'), '#page-metadata', 'data-toggle' => :tab
4
4
  - unless hide_content_tab?(@page)
5
- %li{ :class => content_tab_active(@page) }
5
+ %li{ class: content_tab_active(@page) }
6
6
  = link_to t('.tab_content'), '#page-content', 'data-toggle' => :tab
7
7
 
8
8
  .tab-content
9
- #page-metadata.tab-pane{ :class => metadata_tab_active(@page) }
10
- = simple_form_for @page, :url => url, :html => { :class => 'form-horizontal' }, :wrapper => :bootstrap do |form|
11
- = form.input :title, :required => false, :input_html => { :class => :span5 }
12
- = form.input :slug, :required => false, :input_html => { :class => :span5 }
13
- = form.input :page_title, :required => false, :input_html => { :class => :span5 }
14
- = form.input :parent_id, :collection => Kuhsaft::Page.flat_tree, :label_method => :nesting_name, :selected => params[:parent_id].presence || @page.parent_id.presence, :prompt => 'None', :input_html => { :class => :span3 }
15
- = form.input :page_type, :collection => Kuhsaft::PageType.all, :prompt => false, :input_html => { :class => :span3 }
16
- = form.input :redirect_url, :as => :string
17
- = form.input :url, :as => :string, :input_html => { :disabled => 'disabled' }
18
- = form.input :keywords, :input_html => { :class => :span5 }, hint: t('.hint_keywords')
19
- = form.input :description, :as => :text, :input_html => { :class => :span5, :rows => 4 }, hint: t('.hint_description')
20
- = form.input :published, :as => :boolean
9
+ #page-metadata.tab-pane{ class: metadata_tab_active(@page) }
10
+ = simple_form_for @page, url: url, html: { class: 'form-horizontal' }, wrapper: :bootstrap do |form|
11
+ = form.input :title, required: false, input_html: { class: :span5 }
12
+ = form.input :slug, required: false, input_html: { class: :span5 }
13
+ = form.input :page_title, required: false, input_html: { class: :span5 }
14
+ = form.input :parent_id, collection: Kuhsaft::Page.flat_tree, label_method: :nesting_name, selected: params[:parent_id].presence || @page.parent_id.presence, prompt: t('.none'), input_html: { class: :span3 }
15
+ = form.input :page_type, collection: Kuhsaft::PageType.all, prompt: false, default: Kuhsaft::PageType::CONTENT, input_html: { class: :span3 }
16
+ = form.input :redirect_url, as: :string
17
+ = form.input :url, as: :string, input_html: { disabled: 'disabled' }
18
+ = form.input :keywords, input_html: { class: :span5 }, hint: t('.hint_keywords').html_safe
19
+ = form.input :description, as: :text, input_html: { class: :span5, rows: 4 }, hint: t('.hint_description').html_safe
20
+ = form.input :published, as: :boolean
21
21
 
22
22
  .form-actions
23
- = form.button :submit, :class => 'btn btn-primary'
23
+ = form.button :submit, class: 'btn btn-primary'
24
24
 
25
25
  - unless hide_content_tab?(@page)
26
- #page-content.tab-pane{ :class => content_tab_active(@page) }
26
+ #form-container
27
+ #page-content.tab-pane{ class: content_tab_active(@page) }
27
28
  - if @page.persisted?
28
29
  .clearfix
29
30
  .actions
31
+ .btn-group.pull-left#collapse-bricks-nav{ class: @page.bricks.present? ? '' : 'hidden' }
32
+ .btn.btn-small#expand-all
33
+ %i.icon-resize-full
34
+ = t('.expand_all')
35
+
36
+ .btn.btn-small#collapse-all
37
+ %i.icon-resize-small
38
+ = t('.collapse_all')
39
+
30
40
  .btn-group
31
- = render 'brick_type_dropdown', :brick_list => @page
32
- = render 'kuhsaft/cms/bricks/brick_list', :brick_list => @page
41
+ = render 'brick_type_dropdown', brick_list: @page
42
+
43
+ = render 'kuhsaft/cms/bricks/brick_list', brick_list: @page
33
44
 
34
45
  = render 'kuhsaft/cms/bricks/sort_form'
@@ -1,9 +1,11 @@
1
1
  %div{ :class => image_brick.to_style_class }
2
- = image_tag image_brick.image.converted.url if image_brick.image_present?
3
- - if image_brick.caption.present?
4
- .image-caption
5
- - if image_brick.href.present?
6
- = link_to image_brick.href do
2
+ - if image_brick.image.present?
3
+ = image_tag(image_brick.image.converted.url, :alt => image_brick.alt_text.present? ? image_brick.alt_text : image_alt(image_brick.image.path) )
4
+
5
+ - if image_brick.caption.present?
6
+ .image-caption
7
+ - if image_brick.href.present?
8
+ = link_to image_brick.href do
9
+ = image_brick.caption
10
+ - else
7
11
  = image_brick.caption
8
- - else
9
- = image_brick.caption
@@ -4,7 +4,10 @@
4
4
  .controls
5
5
  = link_to brick.image.converted.url do
6
6
  = image_tag brick.image.thumb
7
+
7
8
  = form.input :image, :as => :file, :input_html => { :class => 'span3' }
9
+ = form.input :image_cache, as: :hidden
8
10
  = form.input :image_size, :collection => Kuhsaft::ImageSize.all, :label_method => :label, :value_method => :name, :input_html => { :class => 'span3' }, :include_blank => false
11
+ = form.input :alt_text, :as => :string, :input_html => { :class => 'span6' }
9
12
  = form.input :caption, :as => :string, :input_html => { :class => 'span6' }
10
13
  = form.input :href, :as => :string, :input_html => { :class => 'span6' }
@@ -3,17 +3,9 @@
3
3
  %meta{ name: 'keywords', content: @page.keywords }
4
4
  %meta{ name: 'description', content: @page.description }
5
5
 
6
- - if @page.bricks.map(&:type).include? "Kuhsaft::PlaceholderBrick"
6
+ - cache [@page, I18n.locale, @page.children, @page.bricks] do
7
7
  - unless @page.blank?
8
8
  .page-content
9
9
  -# TODO: refactor into scopes or simplify otherwise:
10
10
  - @page.bricks.localized.select(&:valid?).each do |brick|
11
11
  = render brick
12
-
13
- - else
14
- - cache [@page, I18n.locale, @page.children] do
15
- - unless @page.blank?
16
- .page-content
17
- -# TODO: refactor into scopes or simplify otherwise:
18
- - @page.bricks.localized.select(&:valid?).each do |brick|
19
- = render brick
@@ -1,2 +1,2 @@
1
1
  %div{ :class => placeholder_brick.to_style_class }
2
- = render "kuhsaft/placeholder_bricks/partials/#{placeholder_brick.template_name}" if placeholder_brick.template_name.present?
2
+ = render placeholder_brick.partial_name if placeholder_brick.template_name.present?
@@ -0,0 +1,9 @@
1
+ !!! XML
2
+ %urlset{xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9"}
3
+ - for page in @pages
4
+ - locales_with_block page do |url|
5
+ %url
6
+ %loc= url
7
+ %lastmod= page.updated_at.utc
8
+ %changefreq monthly
9
+ %priority 0.5
@@ -1,9 +1,9 @@
1
- %div{ :class => video_brick.to_style_class }
1
+ %div{ class: video_brick.to_style_class }
2
2
  - if video_brick.video == Kuhsaft::VideoBrick::YOUTUBE
3
- %video.sublime{ 'data-youtube-id' => video_brick.href, 'data-settings' => 'autoresize:fit', :preload => 'none' }
3
+ %video.sublime{ 'data-youtube-id' => video_brick.href, 'data-settings' => 'autoresize:fit', preload: 'none' }
4
4
  - elsif video_brick.video == Kuhsaft::VideoBrick::VIMEO || video_brick.video == Kuhsaft::VideoBrick::EXTERNAL
5
- %video.sublime{ 'data-settings' => 'autoresize:fit', :preload => 'none' }
6
- %source{ :src => video_brick.href }
5
+ %video.sublime{ 'data-settings' => 'autoresize:fit', preload: 'none' }
6
+ %source{ src: video_brick.href }
7
7
  - else
8
8
  - if video_brick.embed_src.present?
9
9
  = video_brick.embed_src.html_safe
@@ -1,10 +1,10 @@
1
1
  !!!
2
2
  %html
3
3
  %head
4
- %meta{ charset: "utf-8" }
4
+ %meta{ charset: 'utf-8' }
5
5
  %title Screen Concept CMS
6
- = stylesheet_link_tag 'kuhsaft/cms/application.css', :media => 'screen, projection'
7
- = stylesheet_link_tag 'kuhsaft/cms/customizations.css', :media => 'screen, projection'
6
+ = stylesheet_link_tag 'kuhsaft/cms/application.css', media: 'screen, projection'
7
+ = stylesheet_link_tag 'kuhsaft/cms/customizations.css', media: 'screen, projection'
8
8
  = csrf_meta_tag
9
9
 
10
10
  %body{ :class => "#{controller_name}" }
@@ -20,5 +20,6 @@
20
20
  = render 'content_language_switch'
21
21
  = render 'flash', :flash => flash
22
22
  = yield
23
+
23
24
  = javascript_include_tag 'kuhsaft/cms/application.js'
24
25
  = javascript_include_tag 'kuhsaft/cms/customizations.js'
@@ -5,8 +5,8 @@ SimpleForm.setup do |config|
5
5
  # wrapper, change the order or even add your own to the
6
6
  # stack. The options given below are used to wrap the
7
7
  # whole input.
8
- config.wrappers :default, :class => :input,
9
- :hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
8
+ config.wrappers :default, class: :input,
9
+ hint_class: :field_with_hint, error_class: :field_with_errors do |b|
10
10
  ## Extensions enabled by default
11
11
  # Any of these extensions can be disabled for a
12
12
  # given input by passing: `f.input EXTENSION_NAME => false`.
@@ -41,8 +41,8 @@ SimpleForm.setup do |config|
41
41
 
42
42
  ## Inputs
43
43
  b.use :label_input
44
- b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
45
- b.use :error, :wrap_with => { :tag => :span, :class => :error }
44
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
45
+ b.use :error, wrap_with: { tag: :span, class: :error }
46
46
  end
47
47
 
48
48
  # The default wrapper to be used by the FormBuilder.
@@ -1,39 +1,39 @@
1
1
  # Use this setup block to configure all options available in SimpleForm.
2
2
  SimpleForm.setup do |config|
3
- config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
3
+ config.wrappers :bootstrap, tag: 'div', class: 'control-group', error_class: 'error' do |b|
4
4
  b.use :html5
5
5
  b.use :placeholder
6
6
  b.use :label
7
- b.wrapper :tag => 'div', :class => 'controls' do |ba|
7
+ b.wrapper tag: 'div', class: 'controls' do |ba|
8
8
  ba.use :input
9
- ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
10
- ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
9
+ ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
10
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
11
11
  end
12
12
  end
13
13
 
14
- config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
14
+ config.wrappers :prepend, tag: 'div', class: 'control-group', error_class: 'error' do |b|
15
15
  b.use :html5
16
16
  b.use :placeholder
17
17
  b.use :label
18
- b.wrapper :tag => 'div', :class => 'controls' do |input|
19
- input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
18
+ b.wrapper tag: 'div', class: 'controls' do |input|
19
+ input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
20
20
  prepend.use :input
21
21
  end
22
- input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
23
- input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
22
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
23
+ input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
24
24
  end
25
25
  end
26
26
 
27
- config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
27
+ config.wrappers :append, tag: 'div', class: 'control-group', error_class: 'error' do |b|
28
28
  b.use :html5
29
29
  b.use :placeholder
30
30
  b.use :label
31
- b.wrapper :tag => 'div', :class => 'controls' do |input|
32
- input.wrapper :tag => 'div', :class => 'input-append' do |append|
31
+ b.wrapper tag: 'div', class: 'controls' do |input|
32
+ input.wrapper tag: 'div', class: 'input-append' do |append|
33
33
  append.use :input
34
34
  end
35
- input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
36
- input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
35
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
36
+ input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
37
37
  end
38
38
  end
39
39
 
@@ -0,0 +1,203 @@
1
+ de:
2
+ date:
3
+ abbr_day_names:
4
+ - So
5
+ - Mo
6
+ - Di
7
+ - Mi
8
+ - Do
9
+ - Fr
10
+ - Sa
11
+ abbr_month_names:
12
+ -
13
+ - Jan
14
+ - Feb
15
+ - Mär
16
+ - Apr
17
+ - Mai
18
+ - Jun
19
+ - Jul
20
+ - Aug
21
+ - Sep
22
+ - Okt
23
+ - Nov
24
+ - Dez
25
+ day_names:
26
+ - Sonntag
27
+ - Montag
28
+ - Dienstag
29
+ - Mittwoch
30
+ - Donnerstag
31
+ - Freitag
32
+ - Samstag
33
+ formats:
34
+ default: '%d.%m.%Y'
35
+ long: '%e. %B %Y'
36
+ short: '%e. %b'
37
+ month_names:
38
+ -
39
+ - Januar
40
+ - Februar
41
+ - März
42
+ - April
43
+ - Mai
44
+ - Juni
45
+ - Juli
46
+ - August
47
+ - September
48
+ - Oktober
49
+ - November
50
+ - Dezember
51
+ order:
52
+ - :day
53
+ - :month
54
+ - :year
55
+ datetime:
56
+ distance_in_words:
57
+ about_x_hours:
58
+ one: etwa eine Stunde
59
+ other: etwa %{count} Stunden
60
+ about_x_months:
61
+ one: etwa ein Monat
62
+ other: etwa %{count} Monate
63
+ about_x_years:
64
+ one: etwa ein Jahr
65
+ other: etwa %{count} Jahre
66
+ almost_x_years:
67
+ one: fast ein Jahr
68
+ other: fast %{count} Jahre
69
+ half_a_minute: eine halbe Minute
70
+ less_than_x_minutes:
71
+ one: weniger als eine Minute
72
+ other: weniger als %{count} Minuten
73
+ less_than_x_seconds:
74
+ one: weniger als eine Sekunde
75
+ other: weniger als %{count} Sekunden
76
+ over_x_years:
77
+ one: mehr als ein Jahr
78
+ other: mehr als %{count} Jahre
79
+ x_days:
80
+ one: ein Tag
81
+ other: '%{count} Tage'
82
+ x_minutes:
83
+ one: eine Minute
84
+ other: '%{count} Minuten'
85
+ x_months:
86
+ one: ein Monat
87
+ other: '%{count} Monate'
88
+ x_seconds:
89
+ one: eine Sekunde
90
+ other: '%{count} Sekunden'
91
+ prompts:
92
+ day: Tag
93
+ hour: Stunden
94
+ minute: Minuten
95
+ month: Monat
96
+ second: Sekunden
97
+ year: Jahr
98
+ errors: &errors
99
+ format: '%{attribute} %{message}'
100
+ messages:
101
+ accepted: muss akzeptiert werden
102
+ blank: muss ausgefüllt werden
103
+ confirmation: stimmt nicht mit der Bestätigung überein
104
+ empty: muss ausgefüllt werden
105
+ equal_to: muss genau %{count} sein
106
+ even: muss gerade sein
107
+ exclusion: ist nicht verfügbar
108
+ greater_than: muss grösser als %{count} sein
109
+ greater_than_or_equal_to: muss grösser oder gleich %{count} sein
110
+ inclusion: ist kein gültiger Wert
111
+ invalid: ist nicht gültig
112
+ less_than: muss kleiner als %{count} sein
113
+ less_than_or_equal_to: muss kleiner oder gleich %{count} sein
114
+ not_a_number: ist keine Zahl
115
+ not_an_integer: muss ganzzahlig sein
116
+ odd: muss ungerade sein
117
+ record_invalid: 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}'
118
+ taken: ist bereits vergeben
119
+ too_long: ist zu lang (mehr als %{count} Zeichen)
120
+ too_short: ist zu kurz (weniger als %{count} Zeichen)
121
+ wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben)
122
+ template:
123
+ body: 'Bitte überprüfen Sie die folgenden Felder:'
124
+ header:
125
+ one: 'Konnte %{model} nicht speichern: ein Fehler.'
126
+ other: 'Konnte %{model} nicht speichern: %{count} Fehler.'
127
+ helpers:
128
+ select:
129
+ prompt: Bitte wählen
130
+ submit:
131
+ create: '%{model} erstellen'
132
+ submit: '%{model} speichern'
133
+ update: '%{model} aktualisieren'
134
+ number:
135
+ currency:
136
+ format:
137
+ delimiter: .
138
+ format: '%n %u'
139
+ precision: 2
140
+ separator: ','
141
+ significant: false
142
+ strip_insignificant_zeros: false
143
+ unit: €
144
+ format:
145
+ delimiter: .
146
+ precision: 2
147
+ separator: ','
148
+ significant: false
149
+ strip_insignificant_zeros: false
150
+ human:
151
+ decimal_units:
152
+ format: '%n %u'
153
+ units:
154
+ billion:
155
+ one: Milliarde
156
+ other: Milliarden
157
+ million: Millionen
158
+ quadrillion:
159
+ one: Billiarde
160
+ other: Billiarden
161
+ thousand: Tausend
162
+ trillion: Billionen
163
+ unit: ''
164
+ format:
165
+ delimiter: ''
166
+ precision: 1
167
+ significant: true
168
+ strip_insignificant_zeros: true
169
+ storage_units:
170
+ format: '%n %u'
171
+ units:
172
+ byte:
173
+ one: Byte
174
+ other: Bytes
175
+ gb: GB
176
+ kb: KB
177
+ mb: MB
178
+ tb: TB
179
+ percentage:
180
+ format:
181
+ delimiter: ''
182
+ precision:
183
+ format:
184
+ delimiter: ''
185
+ support:
186
+ array:
187
+ last_word_connector: ' und '
188
+ two_words_connector: ' und '
189
+ words_connector: ', '
190
+ time:
191
+ am: vormittags
192
+ formats:
193
+ default: '%A, %d. %B %Y, %H:%M Uhr'
194
+ long: '%A, %d. %B %Y, %H:%M Uhr'
195
+ short: '%d. %B, %H:%M Uhr'
196
+ pm: nachmittags
197
+ # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
198
+ activemodel:
199
+ errors:
200
+ <<: *errors
201
+ activerecord:
202
+ errors:
203
+ <<: *errors