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.
- checksums.yaml +4 -4
- data/README.md +37 -0
- data/Rakefile +6 -5
- data/app/assets/javascripts/ckeditor/plugins/adv_link/LICENSE.txt +674 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/README.md +62 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/dialogs/anchor.js.coffee +81 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/dialogs/link.js.coffee +1353 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/images/anchor.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/images/hidpi/anchor.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/lang/de.js +68 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/lang/en.js +68 -0
- data/app/assets/javascripts/ckeditor/plugins/adv_link/plugin.js.coffee +282 -0
- data/app/assets/javascripts/kuhsaft/cms/application.js.coffee.erb +42 -4
- data/app/assets/stylesheets/kuhsaft/application.css.sass +0 -3
- data/app/assets/stylesheets/kuhsaft/cms/application.css.sass +26 -11
- data/app/controllers/kuhsaft/api/pages_controller.rb +14 -0
- data/app/controllers/kuhsaft/cms/admin_controller.rb +1 -1
- data/app/controllers/kuhsaft/cms/assets_controller.rb +7 -7
- data/app/controllers/kuhsaft/cms/bricks_controller.rb +15 -4
- data/app/controllers/kuhsaft/cms/pages_controller.rb +8 -15
- data/app/controllers/kuhsaft/pages_controller.rb +16 -6
- data/app/controllers/kuhsaft/sitemaps_controller.rb +13 -0
- data/app/helpers/cms_helper.rb +4 -4
- data/app/helpers/kuhsaft/admin_helper.rb +0 -1
- data/app/helpers/kuhsaft/cms/admin_helper.rb +1 -2
- data/app/helpers/kuhsaft/cms/pages_helper.rb +2 -7
- data/app/helpers/pages_helper.rb +8 -37
- data/app/helpers/sitemaps_helper.rb +12 -0
- data/app/models/kuhsaft/accordion_item_brick.rb +1 -1
- data/app/models/kuhsaft/anchor_brick.rb +1 -1
- data/app/models/kuhsaft/asset.rb +26 -23
- data/app/models/kuhsaft/asset_brick.rb +2 -1
- data/app/models/kuhsaft/brick.rb +38 -16
- data/app/models/kuhsaft/brick_type.rb +2 -2
- data/app/models/kuhsaft/brick_type_filter.rb +0 -2
- data/app/models/kuhsaft/column_brick.rb +0 -1
- data/app/models/kuhsaft/image_brick.rb +2 -2
- data/app/models/kuhsaft/image_size.rb +0 -1
- data/app/models/kuhsaft/link_brick.rb +1 -1
- data/app/models/kuhsaft/page.rb +111 -107
- data/app/models/kuhsaft/page_type.rb +1 -1
- data/app/models/kuhsaft/partition.rb +12 -12
- data/app/models/kuhsaft/placeholder_brick.rb +8 -0
- data/app/models/kuhsaft/publish_state.rb +9 -10
- data/app/models/kuhsaft/slider_brick.rb +0 -2
- data/app/models/kuhsaft/text_brick.rb +1 -1
- data/app/models/kuhsaft/two_column_brick.rb +0 -1
- data/app/models/kuhsaft/video_brick.rb +1 -2
- data/app/uploaders/kuhsaft/asset_brick_asset_uploader.rb +39 -38
- data/app/uploaders/kuhsaft/asset_uploader.rb +43 -43
- data/app/uploaders/kuhsaft/image_brick_image_uploader.rb +7 -34
- data/app/views/kuhsaft/asset_bricks/asset_brick/_edit.html.haml +3 -2
- data/app/views/kuhsaft/cms/admin/_brick_type_dropdown.html.haml +2 -2
- data/app/views/kuhsaft/cms/bricks/_brick_item.html.haml +17 -10
- data/app/views/kuhsaft/cms/bricks/_new.html.haml +34 -0
- data/app/views/kuhsaft/cms/bricks/create.js.haml +6 -0
- data/app/views/kuhsaft/cms/bricks/destroy.js.haml +4 -0
- data/app/views/kuhsaft/cms/bricks/new.js.haml +11 -0
- data/app/views/kuhsaft/cms/pages/_branch.html.haml +2 -2
- data/app/views/kuhsaft/cms/pages/_form.html.haml +29 -18
- data/app/views/kuhsaft/image_bricks/_image_brick.html.haml +9 -7
- data/app/views/kuhsaft/image_bricks/image_brick/_edit.html.haml +3 -0
- data/app/views/kuhsaft/pages/show.html.haml +1 -9
- data/app/views/kuhsaft/placeholder_bricks/_placeholder_brick.html.haml +1 -1
- data/app/views/kuhsaft/sitemaps/index.xml.haml +9 -0
- data/app/views/kuhsaft/video_bricks/_video_brick.html.haml +4 -4
- data/app/views/layouts/kuhsaft/cms/application.html.haml +4 -3
- data/config/initializers/simple_form.rb +4 -4
- data/config/initializers/simple_form_bootstrap.rb +14 -14
- data/config/locales/de.yml +203 -0
- data/config/locales/en.yml +282 -0
- data/config/locales/kuhsaft.de.yml +14 -0
- data/config/locales/kuhsaft.en.yml +60 -0
- data/config/locales/models/kuhsaft/image_brick/de.yml +1 -0
- data/config/locales/models/kuhsaft/image_brick/en.yml +16 -0
- data/config/locales/models/kuhsaft/text_brick/de.yml +3 -0
- data/config/locales/models/kuhsaft/text_brick/en.yml +16 -0
- data/config/locales/models/kuhsaft/video_brick/en.yml +15 -0
- data/config/locales/views/kuhsaft/cms/pages/de.yml +3 -0
- data/config/locales/views/kuhsaft/cms/video_bricks/de.yml +1 -1
- data/config/routes.rb +18 -9
- data/db/migrate/10_add_redirect_url_to_kuhsaft_pages.rb +1 -1
- data/db/migrate/11_update_url_and_redirect_url_value.rb +4 -4
- data/db/migrate/13_add_page_title_to_pages.rb +1 -1
- data/db/migrate/15_add_alt_text_to_bricks.rb +5 -0
- data/db/migrate/16_update_default_value_for_page_type.rb +9 -0
- data/db/migrate/17_set_page_type_to_content_for_empty_fields.rb +7 -0
- data/lib/generators/kuhsaft/assets/install_generator.rb +1 -2
- data/lib/generators/kuhsaft/translations/add_generator.rb +19 -4
- data/lib/kuhsaft.rb +1 -0
- data/lib/kuhsaft/brick_list.rb +6 -8
- data/lib/kuhsaft/engine.rb +5 -1
- data/lib/kuhsaft/orderable.rb +22 -19
- data/lib/kuhsaft/partial_extractor.rb +1 -1
- data/lib/kuhsaft/searchable.rb +8 -11
- data/lib/kuhsaft/translatable.rb +35 -19
- data/lib/kuhsaft/version.rb +1 -1
- data/lib/tasks/kuhsaft_tasks.rake +12 -0
- data/lib/templates/kuhsaft/assets/ck-config.js.coffee +7 -0
- data/lib/templates/kuhsaft/translations/add_translation.html.erb +4 -10
- data/spec/controllers/kuhsaft/api/pages_controller_spec.rb +70 -0
- data/spec/controllers/kuhsaft/pages_controller_spec.rb +18 -14
- data/spec/controllers/kuhsaft/sitemaps_controller_spec.rb +13 -0
- data/spec/dummy/app/assets/javascripts/kuhsaft/cms/ck-config.js.coffee +7 -0
- data/spec/dummy/config/application.rb +2 -1
- data/spec/dummy/config/database.yml +1 -1
- data/spec/factories.rb +3 -3
- data/spec/features/cms_pages_spec.rb +13 -13
- data/spec/features/search_spec.rb +16 -18
- data/spec/helpers/kuhsaft/cms/pages_helper_spec.rb +2 -1
- data/spec/kuhsaft_spec.rb +1 -1
- data/spec/lib/brick_list_spec.rb +1 -1
- data/spec/lib/page_tree_spec.rb +10 -6
- data/spec/lib/searchable_spec.rb +4 -4
- data/spec/lib/translatable_spec.rb +114 -44
- data/spec/models/anchor_brick_spec.rb +1 -1
- data/spec/models/asset_spec.rb +1 -1
- data/spec/models/brick_spec.rb +1 -1
- data/spec/models/page_spec.rb +48 -37
- data/spec/models/publish_state_spec.rb +9 -9
- data/spec/spec_helper.rb +43 -21
- data/spec/support/kuhsaft_spec_helper.rb +2 -2
- data/spec/support/write_expectation.rb +57 -0
- data/spec/views/kuhsaft/sitemaps/index.xml.haml_spec.rb +67 -0
- 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), :
|
|
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(:
|
|
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{ :
|
|
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{ :
|
|
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{ :
|
|
10
|
-
= simple_form_for @page, :
|
|
11
|
-
= form.input :title, :
|
|
12
|
-
= form.input :slug, :
|
|
13
|
-
= form.input :page_title, :
|
|
14
|
-
= form.input :parent_id, :
|
|
15
|
-
= form.input :page_type, :
|
|
16
|
-
= form.input :redirect_url, :
|
|
17
|
-
= form.input :url, :
|
|
18
|
-
= form.input :keywords, :
|
|
19
|
-
= form.input :description, :
|
|
20
|
-
= form.input :published, :
|
|
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, :
|
|
23
|
+
= form.button :submit, class: 'btn btn-primary'
|
|
24
24
|
|
|
25
25
|
- unless hide_content_tab?(@page)
|
|
26
|
-
#
|
|
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', :
|
|
32
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
-
|
|
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
|
|
2
|
+
= render placeholder_brick.partial_name if placeholder_brick.template_name.present?
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
%div{ :
|
|
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', :
|
|
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', :
|
|
6
|
-
%source{ :
|
|
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:
|
|
4
|
+
%meta{ charset: 'utf-8' }
|
|
5
5
|
%title Screen Concept CMS
|
|
6
|
-
= stylesheet_link_tag 'kuhsaft/cms/application.css', :
|
|
7
|
-
= stylesheet_link_tag 'kuhsaft/cms/customizations.css', :
|
|
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, :
|
|
9
|
-
|
|
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, :
|
|
45
|
-
b.use :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, :
|
|
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 :
|
|
7
|
+
b.wrapper tag: 'div', class: 'controls' do |ba|
|
|
8
8
|
ba.use :input
|
|
9
|
-
ba.use :error, :
|
|
10
|
-
ba.use :hint, :
|
|
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, :
|
|
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 :
|
|
19
|
-
input.wrapper :
|
|
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, :
|
|
23
|
-
input.use :error, :
|
|
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, :
|
|
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 :
|
|
32
|
-
input.wrapper :
|
|
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, :
|
|
36
|
-
input.use :error, :
|
|
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
|