kuhsaft 0.3.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +127 -77
- data/Rakefile +15 -10
- data/app/assets/javascripts/kuhsaft/application.js +2 -0
- data/app/assets/javascripts/kuhsaft/cms/application.js +16 -4
- data/app/assets/javascripts/kuhsaft/cms/customizations.js +1 -0
- data/app/assets/stylesheets/kuhsaft/application.css.sass +4 -0
- data/app/assets/stylesheets/kuhsaft/cms/application.css.sass +125 -0
- data/app/assets/stylesheets/kuhsaft/cms/customizations.css.sass +1 -0
- data/app/controllers/kuhsaft/application_controller.rb +5 -0
- data/app/controllers/kuhsaft/cms/admin_controller.rb +8 -10
- data/app/controllers/kuhsaft/cms/bricks_controller.rb +35 -0
- data/app/controllers/kuhsaft/cms/pages_controller.rb +16 -19
- data/app/controllers/kuhsaft/pages_controller.rb +4 -10
- data/app/helpers/cms_helper.rb +3 -3
- data/app/helpers/kuhsaft/application_helper.rb +21 -0
- data/app/helpers/kuhsaft/cms/application_helper.rb +10 -0
- data/app/helpers/kuhsaft/cms/pages_helper.rb +14 -0
- data/app/helpers/pages_helper.rb +18 -21
- data/app/models/kuhsaft/accordion_brick.rb +16 -0
- data/app/models/kuhsaft/accordion_item_brick.rb +22 -0
- data/app/models/kuhsaft/brick.rb +85 -0
- data/app/models/kuhsaft/brick_type.rb +7 -0
- data/app/models/kuhsaft/cms.rb +7 -0
- data/app/models/kuhsaft/cms/admin.rb +20 -0
- data/app/models/kuhsaft/column_brick.rb +23 -0
- data/app/models/kuhsaft/image_brick.rb +19 -0
- data/app/models/kuhsaft/image_size.rb +52 -0
- data/app/models/kuhsaft/link_brick.rb +19 -0
- data/app/models/kuhsaft/page.rb +83 -101
- data/app/models/kuhsaft/partition.rb +18 -0
- data/app/models/kuhsaft/placeholder_brick.rb +11 -0
- data/app/models/kuhsaft/slider_brick.rb +16 -0
- data/app/models/kuhsaft/text_brick.rb +9 -0
- data/app/models/kuhsaft/two_column_brick.rb +50 -0
- data/app/models/kuhsaft/video_brick.rb +20 -0
- data/app/uploaders/kuhsaft/asset_uploader.rb +2 -2
- data/app/uploaders/kuhsaft/image_brick_image_uploader.rb +63 -0
- data/app/views/kuhsaft/accordion_bricks/_accordion_brick.html.haml +3 -0
- data/app/{assets/stylesheets/kuhsaft/cms/base/partials/_forms.css.sass → 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/cms/admin/_brick_type_dropdown.html.haml +10 -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/_main_navigation.html.haml +6 -0
- data/app/views/kuhsaft/cms/assets/index.html.haml +2 -2
- data/app/views/kuhsaft/cms/bricks/_brick_item.html.haml +38 -0
- data/app/views/kuhsaft/cms/bricks/_brick_list.html.haml +4 -0
- data/app/views/kuhsaft/cms/bricks/create.js.haml +1 -0
- data/app/views/kuhsaft/cms/bricks/destroy.js.haml +7 -0
- data/app/views/kuhsaft/cms/bricks/update.js.haml +2 -0
- data/app/views/kuhsaft/cms/pages/_branch.html.haml +17 -9
- data/app/views/kuhsaft/cms/pages/_form.html.haml +25 -60
- data/app/views/kuhsaft/cms/pages/edit.html.haml +14 -8
- data/app/views/kuhsaft/cms/pages/index.html.haml +8 -8
- data/app/views/kuhsaft/cms/pages/new.html.haml +1 -10
- data/app/views/kuhsaft/column_bricks/_column_brick.html.haml +3 -0
- data/app/views/kuhsaft/{cms/page_parts/edit.html.haml → column_bricks/column_brick/_edit.html.haml} +0 -0
- data/app/views/kuhsaft/image_bricks/_image_brick.html.haml +9 -0
- data/app/views/kuhsaft/image_bricks/image_brick/_edit.html.haml +10 -0
- data/app/views/kuhsaft/link_bricks/_link_brick.html.haml +3 -0
- data/app/views/kuhsaft/link_bricks/link_brick/_edit.html.haml +3 -0
- data/app/views/kuhsaft/pages/show.html.haml +5 -3
- 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/slider_bricks/_slider_brick.html.haml +10 -0
- data/app/views/kuhsaft/{cms/page_parts/index.html.haml → slider_bricks/slider_brick/_edit.html.haml} +0 -0
- data/app/views/kuhsaft/text_bricks/_text_brick.html.haml +12 -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 +20 -0
- data/config/initializers/devise.rb +231 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +45 -0
- data/config/locales/kuhsaft.en.yml +4 -1
- data/config/locales/models/kuhsaft/accordion_brick/de.yml +4 -0
- data/config/locales/models/kuhsaft/accordion_item_brick/de.yml +7 -0
- data/config/locales/models/kuhsaft/column_brick/de.yml +6 -0
- data/config/locales/models/kuhsaft/image_brick/de.yml +10 -0
- data/config/locales/models/kuhsaft/image_size/de.yml +13 -0
- data/config/locales/models/kuhsaft/link_brick/de.yml +9 -0
- data/config/locales/models/kuhsaft/page/de.yml +17 -0
- data/config/locales/models/kuhsaft/placeholder_brick/de.yml +8 -0
- data/config/locales/models/kuhsaft/slider_brick/de.yml +4 -0
- data/config/locales/models/kuhsaft/text_brick/de.yml +8 -0
- data/config/locales/models/kuhsaft/two_column_brick/de.yml +7 -0
- data/config/locales/models/kuhsaft/video_brick/de.yml +9 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/locales/views/kuhsaft/cms/admin/de.yml +10 -0
- data/config/locales/views/kuhsaft/cms/bricks/de.yml +8 -0
- data/config/locales/views/kuhsaft/cms/pages/de.yml +9 -0
- data/config/locales/views/kuhsaft/cms/video_bricks/de.yml +7 -0
- data/config/locales/views/kuhsaft/text_brick/de.yml +6 -0
- data/config/locales/views/layouts/de.yml +6 -0
- data/config/routes.rb +10 -11
- 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_create_kuhsaft_cms_admins.rb +46 -0
- data/db/migrate/06_add_template_name_to_kuhsaft_bricks.rb +7 -0
- data/db/seeds.rb +14 -0
- data/lib/generators/kuhsaft/translations/add_generator.rb +26 -0
- data/lib/kuhsaft.rb +8 -1
- data/lib/kuhsaft/brick_list.rb +71 -0
- data/lib/kuhsaft/engine.rb +17 -12
- data/lib/kuhsaft/partial_extractor.rb +21 -0
- data/lib/kuhsaft/translatable.rb +40 -0
- data/lib/kuhsaft/version.rb +1 -1
- data/lib/tasks/kuhsaft_tasks.rake +10 -0
- data/lib/templates/kuhsaft/translations/add_translation.html.erb +13 -0
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/assets/javascripts/application.js +9 -3
- data/spec/dummy/app/assets/stylesheets/application.css +11 -5
- data/spec/dummy/app/controllers/application_controller.rb +0 -6
- data/spec/dummy/app/views/layouts/application.html.erb +1 -1
- data/spec/dummy/config/application.rb +24 -7
- data/spec/dummy/config/boot.rb +3 -2
- data/spec/dummy/config/database.yml +6 -3
- data/spec/dummy/config/environments/development.rb +8 -1
- data/spec/dummy/config/environments/production.rb +9 -2
- data/spec/dummy/config/environments/test.rb +4 -9
- data/spec/dummy/config/initializers/inflections.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +1 -1
- data/spec/dummy/config/locales/en.yml +2 -2
- data/spec/dummy/config/routes.rb +2 -57
- data/spec/dummy/db/{migrate/.gitkeep → .gitkeep} +0 -0
- data/spec/dummy/public/500.html +0 -1
- data/spec/dummy/{lib/tasks → public/stylesheets}/.gitkeep +0 -0
- data/spec/factories.rb +11 -17
- data/spec/features/cms_auth_spec.rb +9 -0
- data/spec/features/cms_pages_spec.rb +23 -0
- data/spec/helpers/kuhsaft/cms/application_helper_spec.rb +25 -0
- data/spec/lib/brick_list_spec.rb +39 -0
- data/spec/lib/engine_spec.rb +25 -0
- data/spec/lib/translatable_spec.rb +85 -0
- data/spec/models/accordion_brick_spec.rb +32 -0
- data/spec/models/accordion_item_brick_spec.rb +50 -0
- data/spec/models/asset_spec.rb +25 -23
- data/spec/models/brick_spec.rb +110 -0
- data/spec/models/cms/admin_spec.rb +26 -0
- data/spec/models/column_brick_spec.rb +32 -0
- data/spec/models/image_brick_spec.rb +36 -0
- data/spec/models/image_size_spec.rb +36 -0
- data/spec/models/link_brick_spec.rb +45 -0
- data/spec/models/page_spec.rb +262 -281
- data/spec/models/placeholder_brick_spec.rb +40 -0
- data/spec/models/slider_brick_spec.rb +20 -0
- data/spec/models/text_brick_spec.rb +14 -0
- data/spec/models/two_column_brick_spec.rb +72 -0
- data/spec/models/video_brick_spec.rb +26 -0
- data/spec/spec_helper.rb +60 -51
- data/spec/support/kuhsaft_spec_helper.rb +4 -28
- data/spec/support/request_macros.rb +19 -0
- data/vendor/assets/javascripts/redactor.min.js +12 -0
- data/vendor/assets/stylesheets/redactor.css +692 -0
- metadata +402 -346
- data/.gitignore +0 -19
- data/.rspec +0 -2
- data/.rvmrc +0 -47
- data/CHANGELOG.md +0 -81
- data/Gemfile +0 -2
- data/Guardfile +0 -25
- data/LICENSE +0 -7
- data/app/assets/images/kuhsaft/add-child-page.png +0 -0
- data/app/assets/images/kuhsaft/closedhand.cur +0 -0
- data/app/assets/images/kuhsaft/delete.png +0 -0
- data/app/assets/images/kuhsaft/header-bg.jpg +0 -0
- data/app/assets/images/kuhsaft/module-nav-tab-bg.png +0 -0
- data/app/assets/images/kuhsaft/openhand.cur +0 -0
- data/app/assets/images/kuhsaft/page-edit-icon.png +0 -0
- data/app/assets/images/kuhsaft/page-new-icon.png +0 -0
- data/app/assets/images/kuhsaft/page-part-draggable-area.png +0 -0
- data/app/assets/images/kuhsaft/page-tree-breadcrumb-arrow.png +0 -0
- data/app/assets/images/kuhsaft/pages-breadcrumb-icon.png +0 -0
- data/app/assets/images/kuhsaft/tab-bg.png +0 -0
- data/app/assets/images/kuhsaft/toggle-arrow-closed.png +0 -0
- data/app/assets/images/kuhsaft/toggle-arrow-open.png +0 -0
- data/app/assets/images/kuhsaft/wrapper-bg.png +0 -0
- data/app/assets/javascripts/kuhsaft/cms/backend.js +0 -34
- data/app/assets/javascripts/kuhsaft/cms/jquery-ui-1.8.12.custom.min.js +0 -192
- data/app/assets/javascripts/kuhsaft/cms/jquery.elastic.source.js +0 -161
- data/app/assets/javascripts/kuhsaft/cms/jquery.min.js +0 -18
- data/app/assets/javascripts/kuhsaft/cms/jquery_ujs.js +0 -336
- data/app/assets/stylesheets/kuhsaft/cms/application.css +0 -6
- data/app/assets/stylesheets/kuhsaft/cms/base/base.css.sass +0 -9
- data/app/assets/stylesheets/kuhsaft/cms/base/partials/_assets.css.sass +0 -15
- data/app/assets/stylesheets/kuhsaft/cms/base/partials/_buttons.css.sass +0 -34
- data/app/assets/stylesheets/kuhsaft/cms/base/partials/_generic.css.sass +0 -342
- data/app/assets/stylesheets/kuhsaft/cms/base/partials/_simple_form.css.sass +0 -76
- data/app/controllers/kuhsaft/cms/page_parts_controller.rb +0 -34
- data/app/models/kuhsaft/localized_page.rb +0 -81
- data/app/models/kuhsaft/page_part.rb +0 -12
- data/app/models/kuhsaft/page_part/content.rb +0 -76
- data/app/models/kuhsaft/page_part/markdown.rb +0 -8
- data/app/views/kuhsaft/cms/page_parts/destroy.js.haml +0 -1
- data/app/views/kuhsaft/cms/page_parts/new.html.haml +0 -0
- data/app/views/kuhsaft/cms/page_parts/show.html.haml +0 -0
- data/app/views/kuhsaft/cms/page_parts/update.js.haml +0 -0
- data/app/views/kuhsaft/page_part/markdowns/_edit_markdown.html.haml +0 -1
- data/app/views/kuhsaft/page_part/markdowns/_show_markdown.html.haml +0 -1
- data/app/views/kuhsaft/pages/index.html.haml +0 -0
- data/app/views/layouts/kuhsaft/admin.html.haml +0 -35
- data/config/initializers/generators.rb +0 -7
- data/config/initializers/page_parts.rb +0 -17
- data/kuhsaft.gemspec +0 -39
- data/lib/generators/kuhsaft/install/assets_generator.rb +0 -12
- data/lib/generators/kuhsaft/install/migrations_generator.rb +0 -43
- data/lib/templates/kuhsaft/install/acts_as_taggable_on_migration.rb +0 -37
- data/lib/templates/kuhsaft/install/add_fulltext_to_localized_page.rb +0 -9
- data/lib/templates/kuhsaft/install/add_page_type_to_localized_pages.rb +0 -9
- data/lib/templates/kuhsaft/install/add_published_at_to_localized_pages.rb +0 -9
- data/lib/templates/kuhsaft/install/add_tags_to_page_part_contents.rb +0 -9
- data/lib/templates/kuhsaft/install/add_type_to_page_part_contents.rb +0 -9
- data/lib/templates/kuhsaft/install/add_url_to_localized_pages.rb +0 -9
- data/lib/templates/kuhsaft/install/create_assets.rb +0 -12
- data/lib/templates/kuhsaft/install/create_kuhsaft_localized_pages.rb +0 -19
- data/lib/templates/kuhsaft/install/create_kuhsaft_pages.rb +0 -14
- data/lib/templates/kuhsaft/install/create_page_part_contents.rb +0 -14
- data/spec/controllers/cms_assets_controller_spec.rb +0 -26
- data/spec/controllers/cms_pages_controller_spec.rb +0 -65
- data/spec/controllers/page_parts_controller_spec.rb +0 -60
- data/spec/controllers/pages_controller_spec.rb +0 -30
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/helpers/cms_helper_spec.rb +0 -22
- data/spec/helpers/pages_helper_spec.rb +0 -119
- data/spec/integration/navigation_spec.rb +0 -9
- data/spec/models/localized_page_spec.rb +0 -266
- data/spec/models/page_part_content_spec.rb +0 -95
- data/spec/models/page_part_spec.rb +0 -17
- data/spec/requests/cms_pages_spec.rb +0 -27
- data/spec/routing/assets_routing_spec.rb +0 -63
- data/spec/routing/page_part_routing_spec.rb +0 -70
- data/spec/routing/pages_routing_spec.rb +0 -74
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kuhsaft
|
2
|
+
class VideoBrick < Brick
|
3
|
+
|
4
|
+
YOUTUBE = 'youtube'
|
5
|
+
VIMEO = 'vimeo'
|
6
|
+
EXTERNAL = 'external'
|
7
|
+
|
8
|
+
attr_accessible :video, :embed_src, :href
|
9
|
+
validates :any_source, :presence => true
|
10
|
+
|
11
|
+
# a video id, an embed code or a link to a video is required
|
12
|
+
def any_source
|
13
|
+
embed_src.presence || href.presence
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.source_types
|
17
|
+
[YOUTUBE, VIMEO, EXTERNAL]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
class Kuhsaft::AssetUploader < CarrierWave::Uploader::Base
|
4
4
|
|
5
5
|
# Include RMagick or ImageScience support:
|
6
|
-
include CarrierWave::
|
6
|
+
include CarrierWave::MiniMagick
|
7
7
|
#include CarrierWave::ImageScience
|
8
8
|
|
9
9
|
# Choose what kind of storage to use for this uploader:
|
@@ -35,7 +35,7 @@ class Kuhsaft::AssetUploader < CarrierWave::Uploader::Base
|
|
35
35
|
resize_to_fill(100, 100) if @file.present? && @file.content_type.present? && @file.content_type.include?('image')
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
# Add a white list of extensions which are allowed to be uploaded.
|
40
40
|
# For images you might use something like this:
|
41
41
|
def extension_white_list
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Kuhsaft
|
3
|
+
class ImageBrickImageUploader < CarrierWave::Uploader::Base
|
4
|
+
# include CarrierWave::RMagick
|
5
|
+
include CarrierWave::MiniMagick
|
6
|
+
# Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility:
|
7
|
+
# include Sprockets::Helpers::RailsHelper
|
8
|
+
# include Sprockets::Helpers::IsolatedHelper
|
9
|
+
|
10
|
+
storage :file
|
11
|
+
|
12
|
+
# Override the directory where uploaded files will be stored.
|
13
|
+
# This is a sensible default for uploaders that are meant to be mounted:
|
14
|
+
def store_dir
|
15
|
+
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Provide a default URL as a default if there hasn't been a file uploaded:
|
19
|
+
# def default_url
|
20
|
+
# # For Rails 3.1+ asset pipeline compatibility:
|
21
|
+
# # asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
22
|
+
#
|
23
|
+
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
24
|
+
# end
|
25
|
+
|
26
|
+
|
27
|
+
# Process files as they are uploaded:
|
28
|
+
# process :scale => [200, 300]
|
29
|
+
#
|
30
|
+
# def scale(width, height)
|
31
|
+
# # do something
|
32
|
+
# end
|
33
|
+
|
34
|
+
# Create different versions of your uploaded files:
|
35
|
+
version :converted do
|
36
|
+
process :process_brick_image_size
|
37
|
+
end
|
38
|
+
|
39
|
+
version :thumb, :from_version => :converted do
|
40
|
+
process :resize_to_fill => [160, 90]
|
41
|
+
end
|
42
|
+
|
43
|
+
# Add a white list of extensions which are allowed to be uploaded.
|
44
|
+
# For images you might use something like this:
|
45
|
+
def extension_white_list
|
46
|
+
%w(jpg jpeg gif png)
|
47
|
+
end
|
48
|
+
|
49
|
+
def process_brick_image_size
|
50
|
+
image_size = Kuhsaft::ImageSize.find_by_name(model.image_size)
|
51
|
+
if image_size.present?
|
52
|
+
resize_to_fill(image_size.width, image_size.height)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Override the filename of the uploaded files:
|
57
|
+
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
58
|
+
# def filename
|
59
|
+
# "something.jpg" if original_filename
|
60
|
+
# end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
%div{ :class => accordion_item_brick.to_style_class }
|
2
|
+
.accordion-heading
|
3
|
+
%a.accordion-toggle{ 'data-toggle' => 'collapse', 'data-parent' => "##{accordion_item_brick.brick_list.to_style_id}", :href => "##{accordion_item_brick.to_style_id}" }
|
4
|
+
= accordion_item_brick.caption
|
5
|
+
.accordion-body.collapse{ :id => accordion_item_brick.to_style_id, :class => (accordion_item_brick.brick_list.bricks.first == accordion_item_brick ? 'in' : '') }
|
6
|
+
.accordion-inner
|
7
|
+
- accordion_item_brick.bricks.each do |brick|
|
8
|
+
= render brick
|
@@ -0,0 +1 @@
|
|
1
|
+
= form.input :caption, :as => :string, :input_html => { :class => 'span6' }
|
@@ -0,0 +1,10 @@
|
|
1
|
+
- if brick_list.respond_to?(:user_can_add_childs?) && brick_list.user_can_add_childs? && Kuhsaft::BrickType.count > 0
|
2
|
+
%a.btn.btn-small.btn-primary.dropdown-toggle{ 'data-toggle' => 'dropdown', 'href' => '#' }
|
3
|
+
= t('.add_element')
|
4
|
+
%span.caret
|
5
|
+
%ul.dropdown-menu.pull-right
|
6
|
+
- Kuhsaft::BrickType.grouped.group_by(&:group).each do |group, types|
|
7
|
+
- types.each do |type|
|
8
|
+
%li
|
9
|
+
= link_to type.class_name.constantize.model_name.human, kuhsaft.cms_bricks_path(:brick => { :type => type.class_name, :brick_list_id => brick_list.id, :brick_list_type => brick_list.brick_list_type }), :remote => true, :method => :post
|
10
|
+
.divider
|
@@ -1,3 +1,3 @@
|
|
1
1
|
- content_for :admin_toolbar do
|
2
|
-
= link_to t('.create'),
|
3
|
-
= render 'list'
|
2
|
+
= link_to t('.create'), kuhsaft.new_asset_path, :class => 'button'
|
3
|
+
= render 'list'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
.brick-item{ :id => brick.to_brick_item_id, :class => brick.to_style_class }
|
2
|
+
= simple_form_for brick, :as => :brick, :url => kuhsaft.cms_brick_path(brick), :remote => true, :html => { :id => nil } do |form|
|
3
|
+
.brick-item-header.clearfix
|
4
|
+
.pull-left
|
5
|
+
- if brick.caption.present?
|
6
|
+
= brick.caption
|
7
|
+
%span.muted
|
8
|
+
= brick.backend_label(:parenthesis => true)
|
9
|
+
.pull-right
|
10
|
+
.btn-group
|
11
|
+
- # delete button
|
12
|
+
- if brick.persisted?
|
13
|
+
- if brick.user_can_delete?
|
14
|
+
= link_to kuhsaft.cms_brick_path(brick), :class => 'btn btn-small btn-danger', :confirm => t('kuhsaft.cms.bricks.brick_item.confirm'), :method => :delete, :remote => true do
|
15
|
+
%i.icon-trash.icon-white
|
16
|
+
|
17
|
+
- # addable child dropdown menu
|
18
|
+
- if brick.respond_to?(:brick_list)
|
19
|
+
= render 'brick_type_dropdown', :brick_list => brick
|
20
|
+
|
21
|
+
- brick_content = render(brick.to_edit_partial_path, :brick => brick, :form => form)
|
22
|
+
- if brick_content.present?
|
23
|
+
.brick-item-content
|
24
|
+
= brick_content
|
25
|
+
- if brick.user_can_save?
|
26
|
+
- # save button
|
27
|
+
.clearfix
|
28
|
+
.pull-right
|
29
|
+
= form.button :submit, :class => 'btn btn-success btn-small ', :value => t('.save')
|
30
|
+
|
31
|
+
|
32
|
+
- if brick.renders_own_childs?
|
33
|
+
.brick-item-childs
|
34
|
+
= render brick.to_edit_childs_partial_path, :brick => brick
|
35
|
+
- else
|
36
|
+
- if brick.respond_to?(:bricks)
|
37
|
+
.brick-item-childs
|
38
|
+
= render 'kuhsaft/cms/bricks/brick_list', :brick_list => brick
|
@@ -0,0 +1 @@
|
|
1
|
+
$("##{@brick.brick_list.to_brick_list_id}.brick-list").append("#{j(render('kuhsaft/cms/bricks/brick_item', :brick => @brick))}").find("> .empty-state").remove()
|
@@ -1,11 +1,19 @@
|
|
1
1
|
- unless pages.blank?
|
2
2
|
- pages.each do |page|
|
3
|
-
|
4
|
-
.branch
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
.
|
9
|
-
|
10
|
-
|
11
|
-
|
3
|
+
.branch-group{ :'data-id' => page.id, :'data-put-url' => kuhsaft.cms_page_path(page) }
|
4
|
+
.row-fluid.branch
|
5
|
+
.span9
|
6
|
+
.branch-title
|
7
|
+
= link_to page.title.presence, kuhsaft.edit_cms_page_path(page), :class => 'btn btn-link'
|
8
|
+
.span3
|
9
|
+
.pull-right
|
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 }
|
@@ -1,63 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
= localized.input :locale, :as => :hidden
|
7
|
-
= localized.input :title, :required => false
|
8
|
-
= localized.input :slug, :required => false, :input_html => { :class => :dimmed }
|
9
|
-
.clear
|
10
|
-
|
11
|
-
.page-part-list
|
12
|
-
- @localized_page.page_parts.each do |page_part_object|
|
13
|
-
.colored-box.draggable-box.page-part.can-drag{ :'data-id' => page_part_object.id, :'data-put-url' => cms_page_page_part_path(page_part_object, :page_id => @page) }
|
14
|
-
= localized.fields_for :page_parts, page_part_object do |page_part|
|
15
|
-
.actions
|
16
|
-
.drag-handler
|
17
|
-
- unless page_part.object.persisted?
|
18
|
-
= page_part.input :type, :as => :hidden, :input_html => { :value => page_part.object.class.to_s }
|
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
|
+
%li{ :class => content_tab_active(@page) }
|
5
|
+
= link_to t('.tab_content'), '#page-content', 'data-toggle' => :tab
|
19
6
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
.
|
31
|
-
%label.string{ :for => :page_part_type }= t('.add_element')
|
32
|
-
= page.collection_select :page_part_type, Kuhsaft::PagePart::Content.page_part_types, :to_s, :to_name
|
33
|
-
= page.button :submit, :name => :add_page_part, :value => t('.add_page_part')
|
34
|
-
.clear
|
7
|
+
.tab-content
|
8
|
+
#page-metadata.tab-pane{ :class => metadata_tab_active(@page) }
|
9
|
+
= simple_form_for @page, :url => url, :html => { :class => 'form-horizontal' } do |form|
|
10
|
+
= form.input :title, :required => false, :input_html => { :class => :span5 }
|
11
|
+
= form.input :slug, :required => false, :input_html => { :class => :span5 }
|
12
|
+
= 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 }
|
13
|
+
= form.input :page_type, :collection => Kuhsaft::PageType.all, :prompt => false, :input_html => { :class => :span3 }
|
14
|
+
= form.input :url, :as => :string if @page.redirect?
|
15
|
+
= form.input :keywords, :input_html => { :class => :span5 }
|
16
|
+
= form.input :description, :as => :text, :input_html => { :class => :span5, :rows => 4 }
|
17
|
+
= form.input :published, :as => :boolean
|
35
18
|
|
36
|
-
|
37
|
-
|
38
|
-
.collapsable.hidden
|
39
|
-
= page.input :parent_id, :collection => Kuhsaft::Page.flat_tree(), :label_method => :nesting_name, :selected => params[:parent_id].presence || page.object.parent_id.presence, :prompt => 'None', :label_html => { :class => :string }
|
40
|
-
= localized.input :page_type, :collection => Kuhsaft::PageType.all, :prompt => false, :label_html => { :class => :string }
|
41
|
-
= localized.input :url, :as => :string if @page.redirect?
|
42
|
-
- unless localized.object.page_type == Kuhsaft::PageType::REDIRECT
|
43
|
-
= localized.input :keywords
|
44
|
-
= localized.input :description, :input_html => { :class => :small }, :label_html => { :class => :string }
|
45
|
-
.lightened-box.publish-information
|
46
|
-
.column.grid-3
|
47
|
-
= localized.radio_button :published, Kuhsaft::PublishState::UNPUBLISHED
|
48
|
-
= localized.label :published, t('.unpublished'), :class => :radio, :for => :kuhsaft_page_localized_pages_attributes_0_published_0
|
49
|
-
.column.grid-3
|
50
|
-
= localized.radio_button :published, Kuhsaft::PublishState::PUBLISHED
|
51
|
-
= localized.label :published, t('.published'), :class => :radio, :for => :kuhsaft_page_localized_pages_attributes_0_published_1
|
52
|
-
.column.grid-5
|
53
|
-
= localized.radio_button :published, Kuhsaft::PublishState::PUBLISHED_AT
|
54
|
-
= localized.label :published, t('.published_at'), :class => :radio, :for => :kuhsaft_page_localized_pages_attributes_0_published_2
|
55
|
-
= localized.text_field :published_at, :class => 'small string', :placeholder => 'dd.mm.yyyy HH:MM'
|
56
|
-
.column.grid-2
|
57
|
-
= page.button :submit, :class => 'input-button'
|
58
|
-
.clear
|
19
|
+
.form-actions
|
20
|
+
= form.button :submit, :class => 'btn btn-primary'
|
59
21
|
|
60
|
-
:
|
61
|
-
|
62
|
-
|
63
|
-
|
22
|
+
#page-content.tab-pane{ :class => content_tab_active(@page) }
|
23
|
+
- if @page.persisted?
|
24
|
+
.clearfix
|
25
|
+
.actions
|
26
|
+
.btn-group
|
27
|
+
= render 'brick_type_dropdown', :brick_list => @page
|
28
|
+
= render 'kuhsaft/cms/bricks/brick_list', :brick_list => @page
|
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
.
|
6
|
-
= link_to(t('.pages'), cms_pages_path)
|
1
|
+
= render 'content_language_switch'
|
2
|
+
%ul.breadcrumb
|
3
|
+
%li
|
4
|
+
= link_to Kuhsaft::Page.model_name.human(:count => 2), kuhsaft.cms_pages_path
|
5
|
+
%span.divider /
|
7
6
|
- @page.parent_pages.each do |parent_page|
|
8
|
-
|
7
|
+
%li
|
8
|
+
- if @page.parent_pages.last == parent_page
|
9
|
+
.active
|
10
|
+
= parent_page.title
|
11
|
+
- else
|
12
|
+
= link_to parent_page.title, kuhsaft.edit_cms_page_path(parent_page)
|
13
|
+
%span.divider /
|
9
14
|
|
15
|
+
%h1= @page.title
|
10
16
|
.box-container
|
11
|
-
= render :partial => 'form', :locals => { :url => cms_page_path(@page), :page_title => t('.edit_html', :title => @page.title ) }
|
17
|
+
= render :partial => 'form', :locals => { :url => kuhsaft.cms_page_path(@page), :page_title => t('.edit_html', :title => @page.title ) }
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
%h1= controller.request.host
|
2
|
+
.actions.row
|
3
|
+
.span9
|
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
|
+
= render :partial => 'branch', :locals => { :pages => @pages }
|
@@ -1,10 +1 @@
|
|
1
|
-
|
2
|
-
- Kuhsaft::Page.translation_locales.each do |locale|
|
3
|
-
%li{ :class => (:current if params[:locale] == locale.to_s) }= link_to locale.to_s, new_cms_page_path(:locale => locale)
|
4
|
-
|
5
|
-
.page-tree-breadcrumb
|
6
|
-
- available_parent_pages.each do |parent_page|
|
7
|
-
= link_to((parent_page[:title].presence || parent_page.title), parent_page[:link].presence || edit_cms_page_path(parent_page))
|
8
|
-
|
9
|
-
.box-container
|
10
|
-
= render :partial => 'form', :locals => { :url => cms_pages_path, :page_title => t('.new') }
|
1
|
+
= render :partial => 'form', :locals => { :url => kuhsaft.cms_pages_path, :page_title => t('.new') }
|
data/app/views/kuhsaft/{cms/page_parts/edit.html.haml → column_bricks/column_brick/_edit.html.haml}
RENAMED
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%div{ :class => image_brick.to_style_class }
|
2
|
+
= image_tag image_brick.image.converted.url
|
3
|
+
- if image_brick.caption.present?
|
4
|
+
.image-caption
|
5
|
+
- if image_brick.href.present?
|
6
|
+
= link_to image_brick.href do
|
7
|
+
= image_brick.caption
|
8
|
+
- else
|
9
|
+
= image_brick.caption
|
@@ -0,0 +1,10 @@
|
|
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
|
+
= form.input :image, :as => :file, :input_html => { :class => 'span3' }
|
8
|
+
= form.input :image_size, :collection => Kuhsaft::ImageSize.all, :label_method => :label, :value_method => :name, :input_html => { :class => 'span3' }, :include_blank => false
|
9
|
+
= form.input :caption, :as => :string, :input_html => { :class => 'span6' }
|
10
|
+
= form.input :href, :as => :string, :input_html => { :class => 'span6' }
|