qbrick 2.5.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +423 -0
- data/Rakefile +82 -0
- 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/application.js.coffee +7 -0
- data/app/assets/javascripts/kuhsaft/cms/application.js.coffee.erb +136 -0
- data/app/assets/javascripts/kuhsaft/views/read_more_view.js.coffee +17 -0
- data/app/assets/stylesheets/kuhsaft/application.css.sass +1 -0
- data/app/assets/stylesheets/kuhsaft/cms/application.css.sass +204 -0
- data/app/assets/stylesheets/kuhsaft/modules/_text_brick.css.sass +16 -0
- data/app/controllers/kuhsaft/api/pages_controller.rb +14 -0
- data/app/controllers/kuhsaft/cms/admin_controller.rb +18 -0
- data/app/controllers/kuhsaft/cms/assets_controller.rb +38 -0
- data/app/controllers/kuhsaft/cms/bricks_controller.rb +61 -0
- data/app/controllers/kuhsaft/cms/ckimages_controller.rb +26 -0
- data/app/controllers/kuhsaft/cms/pages_controller.rb +71 -0
- data/app/controllers/kuhsaft/pages_controller.rb +38 -0
- data/app/controllers/kuhsaft/sitemaps_controller.rb +12 -0
- data/app/helpers/cms_helper.rb +27 -0
- data/app/helpers/kuhsaft/admin_helper.rb +20 -0
- data/app/helpers/kuhsaft/cms/admin_helper.rb +21 -0
- data/app/helpers/kuhsaft/cms/pages_helper.rb +17 -0
- data/app/helpers/pages_helper.rb +49 -0
- data/app/helpers/sitemaps_helper.rb +12 -0
- data/app/models/kuhsaft/accordion_brick.rb +15 -0
- data/app/models/kuhsaft/accordion_item_brick.rb +21 -0
- data/app/models/kuhsaft/anchor_brick.rb +17 -0
- data/app/models/kuhsaft/asset.rb +29 -0
- data/app/models/kuhsaft/asset_brick.rb +26 -0
- data/app/models/kuhsaft/brick.rb +137 -0
- data/app/models/kuhsaft/brick_type.rb +7 -0
- data/app/models/kuhsaft/brick_type_filter.rb +18 -0
- data/app/models/kuhsaft/ckimage.rb +5 -0
- data/app/models/kuhsaft/cms.rb +7 -0
- data/app/models/kuhsaft/column_brick.rb +22 -0
- data/app/models/kuhsaft/image_brick.rb +16 -0
- data/app/models/kuhsaft/image_size.rb +51 -0
- data/app/models/kuhsaft/link_brick.rb +21 -0
- data/app/models/kuhsaft/page.rb +160 -0
- data/app/models/kuhsaft/page_type.rb +11 -0
- data/app/models/kuhsaft/partition.rb +18 -0
- data/app/models/kuhsaft/placeholder_brick.rb +23 -0
- data/app/models/kuhsaft/publish_state.rb +24 -0
- data/app/models/kuhsaft/slider_brick.rb +18 -0
- data/app/models/kuhsaft/text_brick.rb +23 -0
- data/app/models/kuhsaft/two_column_brick.rb +46 -0
- data/app/models/kuhsaft/video_brick.rb +22 -0
- data/app/uploaders/kuhsaft/asset_brick_asset_uploader.rb +43 -0
- data/app/uploaders/kuhsaft/asset_uploader.rb +50 -0
- data/app/uploaders/kuhsaft/ckimage_uploader.rb +16 -0
- data/app/uploaders/kuhsaft/image_brick_image_uploader.rb +35 -0
- data/app/views/kuhsaft/accordion_bricks/_accordion_brick.html.haml +3 -0
- data/app/views/kuhsaft/accordion_bricks/accordion_brick/_edit.html.haml +0 -0
- data/app/views/kuhsaft/accordion_item_bricks/_accordion_item_brick.html.haml +8 -0
- data/app/views/kuhsaft/accordion_item_bricks/accordion_item_brick/_edit.html.haml +1 -0
- data/app/views/kuhsaft/anchor_bricks/_anchor_brick.html.haml +1 -0
- data/app/views/kuhsaft/anchor_bricks/anchor_brick/_edit.html.haml +1 -0
- data/app/views/kuhsaft/asset_bricks/_asset_brick.html.haml +2 -0
- data/app/views/kuhsaft/asset_bricks/asset_brick/_edit.html.haml +8 -0
- data/app/views/kuhsaft/cms/admin/_brick_type_dropdown.html.haml +14 -0
- data/app/views/kuhsaft/cms/admin/_content_language_switch.html.haml +7 -0
- data/app/views/kuhsaft/cms/admin/_empty_state.html.haml +5 -0
- data/app/views/kuhsaft/cms/admin/_flash.html.haml +7 -0
- data/app/views/kuhsaft/cms/admin/_main_navigation.html.haml +6 -0
- data/app/views/kuhsaft/cms/assets/_form.html.haml +15 -0
- data/app/views/kuhsaft/cms/assets/_list.html.haml +11 -0
- data/app/views/kuhsaft/cms/assets/edit.html.haml +2 -0
- data/app/views/kuhsaft/cms/assets/index.html.haml +3 -0
- data/app/views/kuhsaft/cms/assets/new.html.haml +2 -0
- data/app/views/kuhsaft/cms/bricks/_brick_header.html.haml +43 -0
- data/app/views/kuhsaft/cms/bricks/_brick_item.html.haml +25 -0
- data/app/views/kuhsaft/cms/bricks/_brick_list.html.haml +4 -0
- data/app/views/kuhsaft/cms/bricks/_new.html.haml +41 -0
- data/app/views/kuhsaft/cms/bricks/_sort_form.html.haml +3 -0
- data/app/views/kuhsaft/cms/bricks/create.js.erb +11 -0
- data/app/views/kuhsaft/cms/bricks/destroy.js.erb +10 -0
- data/app/views/kuhsaft/cms/bricks/new.js.erb +14 -0
- data/app/views/kuhsaft/cms/bricks/update.js.erb +8 -0
- data/app/views/kuhsaft/cms/ckimages/create.html.haml +11 -0
- data/app/views/kuhsaft/cms/ckimages/destroy.js.erb +2 -0
- data/app/views/kuhsaft/cms/ckimages/index.html.haml +13 -0
- data/app/views/kuhsaft/cms/pages/_branch.html.haml +19 -0
- data/app/views/kuhsaft/cms/pages/_form.html.haml +45 -0
- data/app/views/kuhsaft/cms/pages/edit.html.haml +16 -0
- data/app/views/kuhsaft/cms/pages/index.html.haml +14 -0
- data/app/views/kuhsaft/cms/pages/new.html.haml +1 -0
- data/app/views/kuhsaft/cms/pages/show.html.haml +0 -0
- data/app/views/kuhsaft/cms/pages/sort.js.erb +0 -0
- data/app/views/kuhsaft/column_bricks/_column_brick.html.haml +3 -0
- data/app/views/kuhsaft/column_bricks/column_brick/_edit.html.haml +0 -0
- data/app/views/kuhsaft/image_bricks/_image_brick.html.haml +11 -0
- data/app/views/kuhsaft/image_bricks/image_brick/_edit.html.haml +13 -0
- data/app/views/kuhsaft/link_bricks/_link_brick.html.haml +2 -0
- data/app/views/kuhsaft/link_bricks/link_brick/_edit.html.haml +4 -0
- data/app/views/kuhsaft/pages/index.html.haml +7 -0
- data/app/views/kuhsaft/pages/show.html.haml +11 -0
- data/app/views/kuhsaft/placeholder_bricks/_placeholder_brick.html.haml +2 -0
- data/app/views/kuhsaft/placeholder_bricks/placeholder_brick/_edit.html.haml +1 -0
- data/app/views/kuhsaft/search/_form.html.haml +2 -0
- data/app/views/kuhsaft/search/_results.html.haml +8 -0
- data/app/views/kuhsaft/search/_results_entry.html.haml +13 -0
- data/app/views/kuhsaft/sitemaps/index.xml.haml +9 -0
- data/app/views/kuhsaft/slider_bricks/_slider_brick.html.haml +10 -0
- data/app/views/kuhsaft/slider_bricks/slider_brick/_edit.html.haml +0 -0
- data/app/views/kuhsaft/text_bricks/_text_brick.html.haml +11 -0
- data/app/views/kuhsaft/text_bricks/text_brick/_edit.html.haml +2 -0
- data/app/views/kuhsaft/two_column_bricks/_two_column_brick.html.haml +3 -0
- data/app/views/kuhsaft/two_column_bricks/two_column_brick/_childs.html.haml +5 -0
- data/app/views/kuhsaft/two_column_bricks/two_column_brick/_edit.html.haml +1 -0
- data/app/views/kuhsaft/video_bricks/_video_brick.html.haml +9 -0
- data/app/views/kuhsaft/video_bricks/video_brick/_edit.html.haml +8 -0
- data/app/views/layouts/kuhsaft/cms/application.html.haml +25 -0
- data/app/views/layouts/kuhsaft/cms/ckimages.html.haml +18 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +45 -0
- data/config/locales/de.yml +207 -0
- data/config/locales/en.yml +211 -0
- data/config/locales/models/kuhsaft/accordion_brick/de.yml +4 -0
- data/config/locales/models/kuhsaft/accordion_brick/en.yml +4 -0
- data/config/locales/models/kuhsaft/accordion_item_brick/de.yml +7 -0
- data/config/locales/models/kuhsaft/accordion_item_brick/en.yml +7 -0
- data/config/locales/models/kuhsaft/anchor_brick/de.yml +7 -0
- data/config/locales/models/kuhsaft/anchor_brick/en.yml +7 -0
- data/config/locales/models/kuhsaft/asset_brick/de.yml +9 -0
- data/config/locales/models/kuhsaft/asset_brick/en.yml +9 -0
- data/config/locales/models/kuhsaft/brick/de.yml +5 -0
- data/config/locales/models/kuhsaft/brick/en.yml +5 -0
- data/config/locales/models/kuhsaft/column_brick/de.yml +4 -0
- data/config/locales/models/kuhsaft/column_brick/en.yml +4 -0
- data/config/locales/models/kuhsaft/image_brick/de.yml +11 -0
- data/config/locales/models/kuhsaft/image_brick/en.yml +11 -0
- data/config/locales/models/kuhsaft/image_size/de.yml +13 -0
- data/config/locales/models/kuhsaft/image_size/en.yml +13 -0
- data/config/locales/models/kuhsaft/link_brick/de.yml +10 -0
- data/config/locales/models/kuhsaft/link_brick/en.yml +10 -0
- data/config/locales/models/kuhsaft/page/de.yml +19 -0
- data/config/locales/models/kuhsaft/page/en.yml +19 -0
- data/config/locales/models/kuhsaft/placeholder_brick/de.yml +8 -0
- data/config/locales/models/kuhsaft/placeholder_brick/en.yml +8 -0
- data/config/locales/models/kuhsaft/slider_brick/de.yml +4 -0
- data/config/locales/models/kuhsaft/slider_brick/en.yml +4 -0
- data/config/locales/models/kuhsaft/text_brick/de.yml +11 -0
- data/config/locales/models/kuhsaft/text_brick/en.yml +11 -0
- data/config/locales/models/kuhsaft/two_column_brick/de.yml +7 -0
- data/config/locales/models/kuhsaft/two_column_brick/en.yml +7 -0
- data/config/locales/models/kuhsaft/video_brick/de.yml +9 -0
- data/config/locales/models/kuhsaft/video_brick/en.yml +9 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/locales/views/kuhsaft/cms/admin/de.yml +13 -0
- data/config/locales/views/kuhsaft/cms/admin/en.yml +12 -0
- data/config/locales/views/kuhsaft/cms/bricks/de.yml +18 -0
- data/config/locales/views/kuhsaft/cms/bricks/en.yml +18 -0
- data/config/locales/views/kuhsaft/cms/pages/de.yml +31 -0
- data/config/locales/views/kuhsaft/cms/pages/en.yml +31 -0
- data/config/locales/views/kuhsaft/image_brick/de.yml +6 -0
- data/config/locales/views/kuhsaft/image_brick/en.yml +6 -0
- data/config/locales/views/kuhsaft/search/de.yml +12 -0
- data/config/locales/views/kuhsaft/search/en.yml +12 -0
- data/config/locales/views/kuhsaft/text_brick/de.yml +6 -0
- data/config/locales/views/kuhsaft/text_brick/en.yml +6 -0
- data/config/locales/views/kuhsaft/video_brick/de.yml +7 -0
- data/config/locales/views/kuhsaft/video_brick/en.yml +7 -0
- data/config/routes.rb +30 -0
- data/db/migrate/01_create_kuhsaft_pages.rb +31 -0
- data/db/migrate/02_create_kuhsaft_bricks.rb +23 -0
- data/db/migrate/03_create_kuhsaft_brick_types.rb +12 -0
- data/db/migrate/04_create_kuhsaft_assets.rb +10 -0
- data/db/migrate/05_remove_cms_admin.rb +9 -0
- data/db/migrate/06_add_template_name_to_kuhsaft_bricks.rb +7 -0
- data/db/migrate/07_add_default_value_to_brick_type_enabled.rb +6 -0
- data/db/migrate/08_add_display_styles_to_bricks.rb +5 -0
- data/db/migrate/09_add_additional_fields_to_kuhsaft_bricks.rb +6 -0
- data/db/migrate/10_add_redirect_url_to_kuhsaft_pages.rb +7 -0
- data/db/migrate/11_update_url_and_redirect_url_value.rb +45 -0
- data/db/migrate/12_regenerate_fulltext.rb +12 -0
- data/db/migrate/13_add_page_title_to_pages.rb +7 -0
- data/db/migrate/14_move_kuhsaft_assets.rb +22 -0
- 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/db/migrate/18_add_identifier_to_kuhsaft_pages.rb +6 -0
- data/db/migrate/19_add_col_count_to_bricks.rb +5 -0
- data/db/migrate/20_create_kuhsaft_ckimages.rb +9 -0
- data/db/seeds.rb +20 -0
- data/lib/generators/kuhsaft/assets/install_generator.rb +25 -0
- data/lib/generators/kuhsaft/translations/add_generator.rb +41 -0
- data/lib/kuhsaft.rb +22 -0
- data/lib/kuhsaft/brick_list.rb +87 -0
- data/lib/kuhsaft/engine.rb +27 -0
- data/lib/kuhsaft/gridded.rb +20 -0
- data/lib/kuhsaft/image_uploader_mounting.rb +22 -0
- data/lib/kuhsaft/orderable.rb +71 -0
- data/lib/kuhsaft/page_tree.rb +14 -0
- data/lib/kuhsaft/partial_extractor.rb +21 -0
- data/lib/kuhsaft/searchable.rb +69 -0
- data/lib/kuhsaft/touch_placeholders.rb +31 -0
- data/lib/kuhsaft/translatable.rb +54 -0
- data/lib/kuhsaft/version.rb +3 -0
- data/lib/tasks/kuhsaft_tasks.rake +22 -0
- data/lib/templates/kuhsaft/assets/ck-config.js.coffee +48 -0
- data/lib/templates/kuhsaft/assets/customizations.css.sass +0 -0
- data/lib/templates/kuhsaft/assets/customizations.js.coffee +0 -0
- data/lib/templates/kuhsaft/translations/add_translation.erb +8 -0
- data/spec/controllers/kuhsaft/api/pages_controller_spec.rb +70 -0
- data/spec/controllers/kuhsaft/pages_controller_spec.rb +90 -0
- data/spec/controllers/kuhsaft/sitemaps_controller_spec.rb +13 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/spec-image.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/javascripts/kuhsaft/cms/ck-config.js.coffee +48 -0
- data/spec/dummy/app/assets/javascripts/kuhsaft/cms/customizations.js.coffee +0 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/assets/stylesheets/kuhsaft/cms/customizations.css.sass +0 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +3 -0
- data/spec/dummy/config/database.yml +19 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +81 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/kuhsaft.rb +5 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/.gitkeep +0 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories.rb +26 -0
- data/spec/features/cms_pages_spec.rb +76 -0
- data/spec/features/search_spec.rb +78 -0
- data/spec/helpers/kuhsaft/cms/admin_helper_spec.rb +25 -0
- data/spec/helpers/kuhsaft/cms/pages_helper_spec.rb +46 -0
- data/spec/helpers/kuhsaft/pages_helper_spec.rb +21 -0
- data/spec/kuhsaft_spec.rb +7 -0
- data/spec/lib/brick_list_spec.rb +50 -0
- data/spec/lib/engine_spec.rb +25 -0
- data/spec/lib/gridded_spec.rb +24 -0
- data/spec/lib/image_uploader_mounting_spec.rb +14 -0
- data/spec/lib/page_tree_spec.rb +38 -0
- data/spec/lib/searchable_spec.rb +30 -0
- data/spec/lib/touch_placeholders_spec.rb +44 -0
- data/spec/lib/translatable_spec.rb +155 -0
- data/spec/models/accordion_brick_spec.rb +38 -0
- data/spec/models/accordion_item_brick_spec.rb +50 -0
- data/spec/models/anchor_brick_spec.rb +26 -0
- data/spec/models/asset_brick_spec.rb +45 -0
- data/spec/models/asset_spec.rb +41 -0
- data/spec/models/brick_spec.rb +134 -0
- data/spec/models/brick_type_filter_spec.rb +64 -0
- data/spec/models/column_brick_spec.rb +32 -0
- data/spec/models/image_brick_spec.rb +49 -0
- data/spec/models/image_size_spec.rb +36 -0
- data/spec/models/link_brick_spec.rb +51 -0
- data/spec/models/page_spec.rb +472 -0
- data/spec/models/placeholder_brick_spec.rb +46 -0
- data/spec/models/publish_state_spec.rb +33 -0
- data/spec/models/slider_brick_spec.rb +26 -0
- data/spec/models/text_brick_spec.rb +30 -0
- data/spec/models/two_column_brick_spec.rb +82 -0
- data/spec/models/video_brick_spec.rb +32 -0
- data/spec/spec_helper.rb +81 -0
- data/spec/support/kuhsaft_spec_helper.rb +8 -0
- data/spec/support/write_expectation.rb +57 -0
- data/spec/views/kuhsaft/sitemaps/index.xml.haml_spec.rb +67 -0
- data/vendor/assets/javascripts/bootstrap-modal-v2.js +376 -0
- data/vendor/assets/javascripts/bootstrap-modalmanager.js +423 -0
- data/vendor/assets/javascripts/jquery.nestable.js +485 -0
- data/vendor/assets/stylesheets/bootstrap_modal.css +214 -0
- data/vendor/assets/stylesheets/nestable.css +84 -0
- metadata +870 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
<% brick_html = render('kuhsaft/cms/bricks/brick_item', :brick => @brick) %>
|
2
|
+
$('#' + <%= @brick.brick_list.to_brick_list_id.to_json.html_safe %> + '.brick-list').append(<%= brick_html.to_json.html_safe %>).find("> .empty-state").remove();
|
3
|
+
|
4
|
+
// need a reference to the new dom node, so a new query is needed here
|
5
|
+
var newlyInsertedBrick = $("#" + <%= @brick.to_brick_item_id.to_json.html_safe %>);
|
6
|
+
initSavePopover(newlyInsertedBrick);
|
7
|
+
initSubmitLinks(newlyInsertedBrick);
|
8
|
+
|
9
|
+
$(newlyInsertedBrick).find('textarea.ckeditor').each(function (index, elem) { initCKEditor(elem.id) });
|
10
|
+
|
11
|
+
$("#brick-form").modal('hide');
|
@@ -0,0 +1,10 @@
|
|
1
|
+
var brick = $("#" + <%= @brick.to_brick_item_id.to_json.html_safe %>);
|
2
|
+
var brickList = brick.parent();
|
3
|
+
brick.remove();
|
4
|
+
|
5
|
+
if(brickList.children().length == 0){
|
6
|
+
brickList.html(<%= render('empty_state', :brick => @parent_brick).to_json.html_safe %>);
|
7
|
+
};
|
8
|
+
|
9
|
+
// Toggle collapse-bricks-nav
|
10
|
+
toggleCollapseBricksNav(<%= @brick.brick_list.bricks.present? %>);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%- if @brick.errors.any? %>
|
2
|
+
$("#brick-form").modal('attention');
|
3
|
+
<%- end %>
|
4
|
+
|
5
|
+
$("#brick-form").empty();
|
6
|
+
|
7
|
+
$("#brick-form").append(<%= render('kuhsaft/cms/bricks/new', :brick => @brick, :format => :html).to_json.html_safe %>);
|
8
|
+
|
9
|
+
$("#brick-form").find('textarea.ckeditor').each(function (index, elem) { initCKEditor(elem.id) });
|
10
|
+
|
11
|
+
$("#brick-form").modal('show');
|
12
|
+
|
13
|
+
// Stop propagation of display styles dropdown
|
14
|
+
stopPropagationOfDisplayStyles($('#display-styles ul'));
|
@@ -0,0 +1,8 @@
|
|
1
|
+
$("#" + <%= @brick.to_brick_item_id.to_json.html_safe %>).replaceWith(<%= render('kuhsaft/cms/bricks/brick_item', :brick => @brick).to_json.html_safe %>);
|
2
|
+
|
3
|
+
// need a reference to the new dom node, so a new query is needed here
|
4
|
+
var newlyInsertedBrick = $("#" + <%= @brick.to_brick_item_id.to_json.html_safe %>);
|
5
|
+
initSavePopover(newlyInsertedBrick);
|
6
|
+
initSubmitLinks(newlyInsertedBrick);
|
7
|
+
|
8
|
+
$(newlyInsertedBrick).find('textarea.ckeditor').each(function (index, elem) { initCKEditor(elem.id) });
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- @ckimages.each do |image|
|
2
|
+
.ckimage-wrapper{ id: "ckimage_#{image.id}" }
|
3
|
+
.ckimage-thumb{ 'data-image-url' => image.file.url, 'data-func-num' => @func_num }
|
4
|
+
= image_tag image.file.thumb.url
|
5
|
+
.ckimage-delete
|
6
|
+
=link_to 'Delete', cms_ckimage_path(image), method: :delete, remote: true, data: { confirm: t('kuhsaft.cms.ckimages.confirm') }
|
7
|
+
|
8
|
+
:coffeescript
|
9
|
+
$('.ckimage-thumb').click ->
|
10
|
+
funcNum = $(this).data('func-num')
|
11
|
+
imageUrl = $(this).data('image-url')
|
12
|
+
window.opener.CKEDITOR.tools.callFunction(funcNum, imageUrl)
|
13
|
+
window.close()
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- unless pages.blank?
|
2
|
+
%ol.dd-list
|
3
|
+
- pages.each do |page|
|
4
|
+
%li.dd-item.dd3-item{ 'data-id' => page.id }
|
5
|
+
.dd-handle.dd3-handle
|
6
|
+
.dd3-content{ class: page.state_class }
|
7
|
+
= link_to page.title.presence, kuhsaft.edit_cms_page_path(page)
|
8
|
+
|
9
|
+
.button-group
|
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
|
12
|
+
%i.icon-trash.icon-white
|
13
|
+
|
14
|
+
= link_to kuhsaft.new_cms_page_path(parent_id: page.id), class: 'btn btn-small' do
|
15
|
+
%i.icon-plus-sign
|
16
|
+
= t('kuhsaft.cms.pages.index.add_page')
|
17
|
+
|
18
|
+
- unless page.children.empty?
|
19
|
+
= render partial: 'branch', locals: { pages: page.children }
|
@@ -0,0 +1,45 @@
|
|
1
|
+
%ul.nav.nav-tabs.js-tabs
|
2
|
+
%li{ class: metadata_tab_active(@page) }
|
3
|
+
= link_to t('.tab_metadata'), '#page-metadata', 'data-toggle' => :tab
|
4
|
+
- unless hide_content_tab?(@page)
|
5
|
+
%li{ class: content_tab_active(@page) }
|
6
|
+
= link_to t('.tab_content'), '#page-content', 'data-toggle' => :tab
|
7
|
+
|
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: 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
|
+
|
22
|
+
.form-actions
|
23
|
+
= form.button :submit, class: 'btn btn-primary'
|
24
|
+
|
25
|
+
- unless hide_content_tab?(@page)
|
26
|
+
#brick-form.modal.hide.fade{ :tabindex => '-1', :role => 'dialog' }
|
27
|
+
#page-content.tab-pane{ class: content_tab_active(@page) }
|
28
|
+
- if @page.persisted?
|
29
|
+
.clearfix
|
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
|
+
|
40
|
+
.btn-group
|
41
|
+
= render 'brick_type_dropdown', brick_list: @page
|
42
|
+
|
43
|
+
= render 'kuhsaft/cms/bricks/brick_list', brick_list: @page
|
44
|
+
|
45
|
+
= render 'kuhsaft/cms/bricks/sort_form'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
%ul.breadcrumb
|
2
|
+
%li
|
3
|
+
= link_to Kuhsaft::Page.model_name.human(:count => 2), kuhsaft.cms_pages_path
|
4
|
+
%span.divider /
|
5
|
+
- @page.parent_pages.each do |parent_page|
|
6
|
+
%li
|
7
|
+
- if @page.parent_pages.last == parent_page
|
8
|
+
.active
|
9
|
+
= parent_page.title
|
10
|
+
- else
|
11
|
+
= link_to parent_page.title, kuhsaft.edit_cms_page_path(parent_page)
|
12
|
+
%span.divider /
|
13
|
+
|
14
|
+
%h1= @page.title
|
15
|
+
.box-container
|
16
|
+
= render :partial => 'form', :locals => { :url => kuhsaft.cms_page_path(@page), :page_title => t('.edit_html', :title => @page.title ) }
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%h1= controller.request.host
|
2
|
+
.actions.row
|
3
|
+
.span5
|
4
|
+
.span3
|
5
|
+
= link_to kuhsaft.new_cms_page_path, class: 'btn btn-primary' do
|
6
|
+
%i.icon-plus-sign.icon-white
|
7
|
+
= t('.add_page')
|
8
|
+
.span4
|
9
|
+
|
10
|
+
.row
|
11
|
+
.span8.pages-list
|
12
|
+
.dd
|
13
|
+
= render partial: 'branch', locals: { pages: @pages }
|
14
|
+
.span4
|
@@ -0,0 +1 @@
|
|
1
|
+
= render :partial => 'form', :locals => { :url => kuhsaft.cms_pages_path, :page_title => t('.new') }
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%div{ :class => image_brick.to_style_class }
|
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
|
11
|
+
= image_brick.caption
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- if brick.image.thumb.present?
|
2
|
+
.control-group
|
3
|
+
%label.control-label= t('.image_preview')
|
4
|
+
.controls
|
5
|
+
= link_to brick.image.converted.url do
|
6
|
+
= image_tag brick.image.thumb
|
7
|
+
|
8
|
+
= form.input :image, :as => :file, :input_html => { :class => 'span3' }
|
9
|
+
= form.input :image_cache, as: :hidden
|
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' }
|
12
|
+
= form.input :caption, :as => :string, :input_html => { :class => 'span6' }
|
13
|
+
= form.input :href, :as => :string, :input_html => { :class => 'span6' }
|
@@ -0,0 +1,11 @@
|
|
1
|
+
= content_for :head do
|
2
|
+
%title= @page.page_title.present? ? @page.page_title : @page.title
|
3
|
+
%meta{ name: 'keywords', content: @page.keywords }
|
4
|
+
%meta{ name: 'description', content: @page.description }
|
5
|
+
|
6
|
+
- cache [@page, I18n.locale, @page.children, @page.bricks] do
|
7
|
+
- unless @page.blank?
|
8
|
+
.page-content
|
9
|
+
-# TODO: refactor into scopes or simplify otherwise:
|
10
|
+
- @page.bricks.localized.select(&:valid?).each do |brick|
|
11
|
+
= render brick
|
@@ -0,0 +1 @@
|
|
1
|
+
= form.input :template_name, :as => :select, :collection => Kuhsaft::PlaceholderBrick.available_partials, :include_blank => true
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.link
|
2
|
+
= link_to page.link do
|
3
|
+
%h4= page.title
|
4
|
+
%h5= kuhsaft.page_url(:url => page.url_without_locale)
|
5
|
+
.summary
|
6
|
+
-if page.excerpt.present?
|
7
|
+
.excerpt!= page.excerpt
|
8
|
+
-elsif page.fulltext.present?
|
9
|
+
.fulltext!= excerpt(highlight(page.fulltext, @search), @search)
|
10
|
+
|
11
|
+
-if page.keywords.present?
|
12
|
+
.keywords
|
13
|
+
= page.keywords
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%div{ :class => slider_brick.to_style_class, :id => slider_brick.to_style_id }
|
2
|
+
.carousel-inner
|
3
|
+
- slider_brick.bricks.each do |brick|
|
4
|
+
.item{ :class => (slider_brick.bricks.first == brick ? 'active' : '')}
|
5
|
+
= render brick
|
6
|
+
|
7
|
+
%a.carousel-control.left{ :href => "##{slider_brick.to_style_id}", 'data-slide' => 'prev' }
|
8
|
+
‹
|
9
|
+
%a.carousel-control.right{ :href => "##{slider_brick.to_style_id}", 'data-slide' => 'next' }
|
10
|
+
›
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%div{ :class => text_brick.to_style_class }
|
2
|
+
- if text_brick.read_more_text.present?
|
3
|
+
= text_brick.text.to_s.html_safe
|
4
|
+
|
5
|
+
%div.collapse{ :id => text_brick.to_style_id }
|
6
|
+
= text_brick.read_more_text.to_s.html_safe
|
7
|
+
|
8
|
+
= read_more_link("##{text_brick.to_style_id}")
|
9
|
+
|
10
|
+
- else
|
11
|
+
= text_brick.text.to_s.html_safe
|
@@ -0,0 +1 @@
|
|
1
|
+
= form.input :partitioning, :as => :select, :collection => Kuhsaft::TwoColumnBrick.partitionings
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%div{ class: video_brick.to_style_class }
|
2
|
+
- if video_brick.video == Kuhsaft::VideoBrick::YOUTUBE
|
3
|
+
%video.sublime{ 'data-youtube-id' => video_brick.href, 'data-settings' => 'autoresize:fit', preload: 'none' }
|
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 }
|
7
|
+
- else
|
8
|
+
- if video_brick.embed_src.present?
|
9
|
+
= video_brick.embed_src.html_safe
|
@@ -0,0 +1,8 @@
|
|
1
|
+
- if brick.errors.any?
|
2
|
+
.alert.alert-error
|
3
|
+
= t('.any_source_error')
|
4
|
+
|
5
|
+
= form.input :video, :collection => Kuhsaft::VideoBrick.source_types
|
6
|
+
= form.input :href, :as => :string, :input_html => { :class => 'span6' }
|
7
|
+
%hr
|
8
|
+
= form.input :embed_src, :as => :text, :input_html => { :class => 'span6', :rows => 5 }, :hint => t('.embed_src_optional')
|
@@ -0,0 +1,25 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{ charset: 'utf-8' }
|
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'
|
8
|
+
= csrf_meta_tag
|
9
|
+
|
10
|
+
%body{ :class => "#{controller_name}" }
|
11
|
+
.navbar.navbar-fixed-top
|
12
|
+
.navbar-inner
|
13
|
+
.container
|
14
|
+
= render 'main_navigation'
|
15
|
+
|
16
|
+
#toolbar
|
17
|
+
.container.cms
|
18
|
+
.row
|
19
|
+
.span12
|
20
|
+
= render 'content_language_switch'
|
21
|
+
= render 'flash', :flash => flash
|
22
|
+
= yield
|
23
|
+
|
24
|
+
= javascript_include_tag 'kuhsaft/cms/application.js'
|
25
|
+
= javascript_include_tag 'kuhsaft/cms/customizations.js'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{ charset: "utf-8" }
|
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'
|
8
|
+
= javascript_include_tag 'kuhsaft/cms/application.js'
|
9
|
+
= javascript_include_tag 'kuhsaft/cms/customizations.js'
|
10
|
+
= csrf_meta_tag
|
11
|
+
|
12
|
+
%body
|
13
|
+
.container.cms
|
14
|
+
.row
|
15
|
+
.span3
|
16
|
+
.span6
|
17
|
+
= yield
|
18
|
+
.span3
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input,
|
9
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input :placeholder => "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable the lookup for any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
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 }
|
46
|
+
end
|
47
|
+
|
48
|
+
# The default wrapper to be used by the FormBuilder.
|
49
|
+
config.default_wrapper = :default
|
50
|
+
|
51
|
+
# Define the way to render check boxes / radio buttons with labels.
|
52
|
+
# Defaults to :nested for bootstrap config.
|
53
|
+
# :inline => input + label
|
54
|
+
# :nested => label > input
|
55
|
+
config.boolean_style = :nested
|
56
|
+
|
57
|
+
# Default class for buttons
|
58
|
+
config.button_class = 'btn'
|
59
|
+
|
60
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
61
|
+
# :first lists the first message for each field.
|
62
|
+
# Use :to_sentence to list all errors for each field.
|
63
|
+
# config.error_method = :first
|
64
|
+
|
65
|
+
# Default tag used for error notification helper.
|
66
|
+
config.error_notification_tag = :div
|
67
|
+
|
68
|
+
# CSS class to add for error notification helper.
|
69
|
+
config.error_notification_class = 'alert alert-error'
|
70
|
+
|
71
|
+
# ID to add for error notification helper.
|
72
|
+
# config.error_notification_id = nil
|
73
|
+
|
74
|
+
# Series of attempts to detect a default label method for collection.
|
75
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
76
|
+
|
77
|
+
# Series of attempts to detect a default value method for collection.
|
78
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
79
|
+
|
80
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
81
|
+
# config.collection_wrapper_tag = nil
|
82
|
+
|
83
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
84
|
+
# config.collection_wrapper_class = nil
|
85
|
+
|
86
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
87
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
88
|
+
# SimpleForm will force this option to be a label.
|
89
|
+
# config.item_wrapper_tag = :span
|
90
|
+
|
91
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
92
|
+
# config.item_wrapper_class = nil
|
93
|
+
|
94
|
+
# How the label text should be generated altogether with the required text.
|
95
|
+
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
96
|
+
|
97
|
+
# You can define the class to use on all labels. Default is nil.
|
98
|
+
config.label_class = 'control-label'
|
99
|
+
|
100
|
+
# You can define the class to use on all forms. Default is simple_form.
|
101
|
+
# config.form_class = :simple_form
|
102
|
+
|
103
|
+
# You can define which elements should obtain additional classes
|
104
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
105
|
+
|
106
|
+
# Whether attributes are required by default (or not). Default is true.
|
107
|
+
# config.required_by_default = true
|
108
|
+
|
109
|
+
# Tell browsers whether to use default HTML5 validations (novalidate option).
|
110
|
+
# Default is enabled.
|
111
|
+
config.browser_validations = false
|
112
|
+
|
113
|
+
# Collection of methods to detect if a file type was given.
|
114
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
115
|
+
|
116
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
117
|
+
# to match as key, and the input type that will be used when the field name
|
118
|
+
# matches the regexp as value.
|
119
|
+
# config.input_mappings = { /count/ => :integer }
|
120
|
+
|
121
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
122
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
123
|
+
# config.wrapper_mappings = { :string => :prepend }
|
124
|
+
|
125
|
+
# Default priority for time_zone inputs.
|
126
|
+
# config.time_zone_priority = nil
|
127
|
+
|
128
|
+
# Default priority for country inputs.
|
129
|
+
# config.country_priority = nil
|
130
|
+
|
131
|
+
# Default size for text inputs.
|
132
|
+
# config.default_input_size = 50
|
133
|
+
|
134
|
+
# When false, do not use translations for labels.
|
135
|
+
# config.translate_labels = true
|
136
|
+
|
137
|
+
# Automatically discover new inputs in Rails' autoload path.
|
138
|
+
# config.inputs_discovery = true
|
139
|
+
|
140
|
+
# Cache SimpleForm inputs discovery
|
141
|
+
# config.cache_discovery = !Rails.env.development?
|
142
|
+
end
|