comfortable_mexican_sofa 1.11.2 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -2
- data/CONTRIBUTING.md +29 -0
- data/README.md +24 -15
- data/Rakefile +12 -4
- data/app/assets/javascripts/comfortable_mexican_sofa/application.js.coffee +11 -10
- data/app/assets/javascripts/comfortable_mexican_sofa/lib/diff.js.coffee +9 -0
- data/app/assets/javascripts/comfortable_mexican_sofa/lib/diff/diff_match_patch.min.js +49 -0
- data/app/assets/javascripts/comfortable_mexican_sofa/lib/diff/pretty_text_diff.min.js +5 -0
- data/app/assets/stylesheets/comfortable_mexican_sofa/application.css.sass +7 -9
- data/app/assets/stylesheets/comfortable_mexican_sofa/base.css.sass +45 -15
- data/app/assets/stylesheets/comfortable_mexican_sofa/bootstrap_overrides.css.sass +21 -41
- data/app/controllers/{admin → comfy/admin}/cms/base_controller.rb +9 -8
- data/app/controllers/{admin → comfy/admin}/cms/categories_controller.rb +1 -1
- data/app/controllers/{admin → comfy/admin}/cms/files_controller.rb +11 -11
- data/app/controllers/{admin → comfy/admin}/cms/layouts_controller.rb +10 -10
- data/app/controllers/{admin → comfy/admin}/cms/pages_controller.rb +16 -12
- data/app/controllers/{admin → comfy/admin}/cms/revisions_controller.rb +12 -12
- data/app/controllers/{admin → comfy/admin}/cms/sites_controller.rb +13 -13
- data/app/controllers/{admin → comfy/admin}/cms/snippets_controller.rb +9 -9
- data/app/controllers/{cms → comfy/cms}/assets_controller.rb +1 -1
- data/app/controllers/{cms → comfy/cms}/base_controller.rb +4 -4
- data/app/controllers/{cms → comfy/cms}/content_controller.rb +9 -6
- data/app/models/{cms → comfy/cms}/block.rb +13 -10
- data/app/models/{cms → comfy/cms}/categorization.rb +2 -2
- data/app/models/{cms → comfy/cms}/category.rb +2 -2
- data/app/models/{cms → comfy/cms}/file.rb +12 -11
- data/app/models/{cms → comfy/cms}/layout.rb +10 -8
- data/app/models/{cms → comfy/cms}/page.rb +6 -82
- data/app/models/{cms → comfy/cms}/revision.rb +2 -2
- data/app/models/{cms → comfy/cms}/site.rb +6 -6
- data/app/models/{cms → comfy/cms}/snippet.rb +7 -7
- data/app/views/{admin → comfy/admin}/cms/categories/_categories.html.haml +0 -0
- data/app/views/comfy/admin/cms/categories/_edit.html.haml +6 -0
- data/app/views/{admin → comfy/admin}/cms/categories/_form.html.haml +2 -2
- data/app/views/comfy/admin/cms/categories/_index.html.haml +25 -0
- data/app/views/{admin → comfy/admin}/cms/categories/_show.html.haml +3 -3
- data/app/views/{admin → comfy/admin}/cms/categories/create.js.erb +0 -0
- data/app/views/{admin → comfy/admin}/cms/categories/destroy.js.erb +0 -0
- data/app/views/{admin → comfy/admin}/cms/categories/edit.js.erb +0 -0
- data/app/views/{admin → comfy/admin}/cms/categories/update.js.erb +0 -0
- data/app/views/{admin → comfy/admin}/cms/files/_file.html.haml +2 -2
- data/app/views/comfy/admin/cms/files/_form.html.haml +19 -0
- data/app/views/comfy/admin/cms/files/_index.html.haml +11 -0
- data/app/views/{admin → comfy/admin}/cms/files/_page_form.html.haml +2 -2
- data/app/views/{admin → comfy/admin}/cms/files/destroy.js.coffee +0 -0
- data/app/views/{admin → comfy/admin}/cms/files/edit.html.haml +0 -0
- data/app/views/comfy/admin/cms/files/index.html.haml +31 -0
- data/app/views/{admin → comfy/admin}/cms/files/new.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/layouts/_form.html.haml +6 -6
- data/app/views/comfy/admin/cms/layouts/_index_branch.html.haml +23 -0
- data/app/views/comfy/admin/cms/layouts/edit.html.haml +9 -0
- data/app/views/comfy/admin/cms/layouts/index.html.haml +13 -0
- data/app/views/{admin → comfy/admin}/cms/layouts/new.html.haml +0 -0
- data/app/views/comfy/admin/cms/pages/_form.html.haml +40 -0
- data/app/views/{admin → comfy/admin}/cms/pages/_form_blocks.html.haml +4 -3
- data/app/views/{admin → comfy/admin}/cms/pages/_index_branch.html.haml +7 -7
- data/app/views/comfy/admin/cms/pages/edit.html.haml +9 -0
- data/app/views/{admin → comfy/admin}/cms/pages/form_blocks.js.erb +0 -0
- data/app/views/comfy/admin/cms/pages/index.html.haml +15 -0
- data/app/views/{admin → comfy/admin}/cms/pages/new.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/pages/toggle_branch.js.erb +1 -1
- data/app/views/{admin → comfy/admin}/cms/partials/_body_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_file_form_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_file_form_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_files_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_files_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_html_footer.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_html_head.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_layout_form_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_layout_form_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_layouts_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_layouts_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_navigation_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_navigation_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_navigation_inner.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_page_form_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_page_form_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_page_form_inner.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_pages_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_pages_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_right_column_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_right_column_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_site_form_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_site_form_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_sites_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_sites_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_snippet_form_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_snippet_form_before.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_snippets_after.html.haml +0 -0
- data/app/views/{admin → comfy/admin}/cms/partials/_snippets_before.html.haml +0 -0
- data/app/views/comfy/admin/cms/revisions/show.html.haml +35 -0
- data/app/views/comfy/admin/cms/sites/_form.html.haml +14 -0
- data/app/views/comfy/admin/cms/sites/_mirrors.html.haml +18 -0
- data/app/views/{admin → comfy/admin}/cms/sites/edit.html.haml +0 -0
- data/app/views/comfy/admin/cms/sites/index.html.haml +28 -0
- data/app/views/{admin → comfy/admin}/cms/sites/new.html.haml +0 -0
- data/app/views/comfy/admin/cms/snippets/_form.html.haml +15 -0
- data/app/views/{admin → comfy/admin}/cms/snippets/edit.html.haml +2 -2
- data/app/views/comfy/admin/cms/snippets/index.html.haml +32 -0
- data/app/views/{admin → comfy/admin}/cms/snippets/new.html.haml +0 -0
- data/app/views/{cms → comfy/cms}/content/render_sitemap.xml.builder +0 -0
- data/app/views/kaminari/{_first_page.html.haml → comfy/_first_page.html.haml} +0 -0
- data/app/views/kaminari/{_gap.html.haml → comfy/_gap.html.haml} +0 -0
- data/app/views/kaminari/{_last_page.html.haml → comfy/_last_page.html.haml} +0 -0
- data/app/views/kaminari/{_next_page.html.haml → comfy/_next_page.html.haml} +0 -0
- data/app/views/kaminari/{_page.html.haml → comfy/_page.html.haml} +0 -0
- data/app/views/kaminari/{_paginator.html.haml → comfy/_paginator.html.haml} +0 -0
- data/app/views/kaminari/{_prev_page.html.haml → comfy/_prev_page.html.haml} +0 -0
- data/app/views/layouts/comfy/admin/cms.html.haml +4 -0
- data/app/views/layouts/comfy/admin/cms/_body.html.haml +17 -0
- data/app/views/layouts/{admin → comfy/admin}/cms/_center.html.haml +0 -0
- data/app/views/layouts/{admin → comfy/admin}/cms/_footer.html.haml +0 -0
- data/app/views/layouts/{admin → comfy/admin}/cms/_footer_js.html.haml +2 -2
- data/app/views/layouts/{admin → comfy/admin}/cms/_head.html.haml +1 -1
- data/app/views/layouts/comfy/admin/cms/_left.html.haml +16 -0
- data/app/views/layouts/comfy/admin/cms/_right.html.haml +5 -0
- data/comfortable_mexican_sofa.gemspec +6 -4
- data/config/initializers/comfortable_mexican_sofa.rb +0 -5
- data/config/locales/da.yml +233 -0
- data/config/locales/de.yml +203 -214
- data/config/locales/en.yml +198 -210
- data/config/locales/es.yml +195 -207
- data/config/locales/fr.yml +195 -207
- data/config/locales/it.yml +201 -212
- data/config/locales/ja.yml +195 -208
- data/config/locales/nl.yml +201 -213
- data/config/locales/pl.yml +195 -207
- data/config/locales/pt-BR.yml +196 -208
- data/config/locales/ru.yml +203 -213
- data/config/locales/sv.yml +194 -206
- data/config/locales/zh-CN.yml +201 -213
- data/db/cms_fixtures/sample-site/layouts/default/nested/content.haml +3 -0
- data/db/cms_fixtures/sample-site/pages/index/child/left.haml +1 -0
- data/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png +0 -0
- data/db/migrate/01_create_cms.rb +40 -38
- data/db/upgrade_migrations/08_upgrade_to_1_12_0.rb +41 -0
- data/lib/comfortable_mexican_sofa.rb +1 -0
- data/lib/comfortable_mexican_sofa/configuration.rb +2 -8
- data/lib/comfortable_mexican_sofa/engine.rb +3 -1
- data/lib/comfortable_mexican_sofa/extensions/acts_as_tree.rb +6 -0
- data/lib/comfortable_mexican_sofa/extensions/cms_manageable.rb +106 -0
- data/lib/comfortable_mexican_sofa/extensions/has_revisions.rb +2 -1
- data/lib/comfortable_mexican_sofa/extensions/is_categorized.rb +4 -4
- data/lib/comfortable_mexican_sofa/extensions/is_mirrored.rb +8 -8
- data/lib/comfortable_mexican_sofa/fixture.rb +2 -9
- data/lib/comfortable_mexican_sofa/fixture/category.rb +6 -6
- data/lib/comfortable_mexican_sofa/fixture/file.rb +1 -1
- data/lib/comfortable_mexican_sofa/fixture/layout.rb +8 -3
- data/lib/comfortable_mexican_sofa/fixture/page.rb +13 -3
- data/lib/comfortable_mexican_sofa/fixture/snippet.rb +7 -3
- data/lib/comfortable_mexican_sofa/form_builder.rb +30 -17
- data/lib/comfortable_mexican_sofa/render_methods.rb +58 -50
- data/lib/comfortable_mexican_sofa/routes/cms.rb +12 -10
- data/lib/comfortable_mexican_sofa/routes/cms_admin.rb +26 -24
- data/lib/comfortable_mexican_sofa/tag.rb +14 -14
- data/lib/comfortable_mexican_sofa/tags/asset.rb +3 -3
- data/lib/comfortable_mexican_sofa/tags/file.rb +2 -2
- data/lib/comfortable_mexican_sofa/tags/page_file.rb +29 -18
- data/lib/comfortable_mexican_sofa/tags/page_files.rb +34 -35
- data/lib/comfortable_mexican_sofa/tags/snippet.rb +3 -3
- data/lib/comfortable_mexican_sofa/version.rb +1 -1
- data/lib/comfortable_mexican_sofa/view_methods.rb +67 -74
- data/lib/generators/comfy/scaffold/scaffold_generator.rb +1 -1
- data/lib/generators/comfy/scaffold/templates/controller.rb +4 -4
- data/lib/generators/comfy/scaffold/templates/tests/controller.rb +3 -3
- data/lib/generators/comfy/scaffold/templates/views/_form.haml +1 -1
- data/lib/generators/comfy/scaffold/templates/views/index.haml +6 -6
- data/test/controllers/{admin → comfy/admin}/cms/base_controller_test.rb +3 -3
- data/test/controllers/comfy/admin/cms/categories_controller_test.rb +70 -0
- data/test/controllers/{admin → comfy/admin}/cms/files_controller_test.rb +53 -45
- data/test/controllers/{admin → comfy/admin}/cms/layouts_controller_test.rb +29 -29
- data/test/controllers/{admin → comfy/admin}/cms/pages_controller_test.rb +111 -110
- data/test/controllers/comfy/admin/cms/revisions_controller_test.rb +138 -0
- data/test/controllers/{admin → comfy/admin}/cms/sites_controller_test.rb +15 -15
- data/test/controllers/{admin → comfy/admin}/cms/snippets_controller_test.rb +29 -29
- data/test/controllers/comfy/cms/assets_controller_test.rb +38 -0
- data/test/controllers/{cms → comfy/cms}/content_controller_test.rb +28 -28
- data/test/fixtures/{cms → comfy/cms}/blocks.yml +2 -2
- data/test/fixtures/{cms → comfy/cms}/categories.yml +1 -1
- data/test/fixtures/comfy/cms/categorizations.yml +3 -0
- data/test/fixtures/{cms → comfy/cms}/files.yml +0 -0
- data/test/fixtures/{cms → comfy/cms}/layouts.yml +0 -0
- data/test/fixtures/{cms → comfy/cms}/pages.yml +2 -2
- data/test/fixtures/{cms → comfy/cms}/revisions.yml +3 -3
- data/test/fixtures/{cms → comfy/cms}/sites.yml +0 -0
- data/test/fixtures/{cms → comfy/cms}/snippets.yml +0 -0
- data/test/fixtures/generators/scaffold/controller.rb +4 -4
- data/test/fixtures/generators/scaffold/tests/controller.rb +3 -3
- data/test/fixtures/generators/scaffold/views/_form.haml +1 -1
- data/test/fixtures/generators/scaffold/views/index.haml +6 -6
- data/test/gemfiles/Gemfile.rails.4.0 +4 -2
- data/test/gemfiles/Gemfile.rails.4.1 +5 -3
- data/test/gemfiles/Gemfile.rails.master +22 -0
- data/test/generators/scaffold_generator_test.rb +1 -1
- data/test/integration/authentication_test.rb +2 -2
- data/test/integration/fixtures_test.rb +26 -24
- data/test/integration/mirrors_test.rb +14 -14
- data/test/integration/render_cms_test.rb +17 -16
- data/test/integration/sites_test.rb +21 -21
- data/test/integration/view_hooks_test.rb +7 -7
- data/test/lib/configuration_test.rb +1 -5
- data/test/lib/fixtures/categories_test.rb +8 -8
- data/test/lib/fixtures/files_test.rb +11 -11
- data/test/lib/fixtures/layouts_test.rb +19 -19
- data/test/lib/fixtures/pages_test.rb +24 -24
- data/test/lib/fixtures/snippets_test.rb +14 -14
- data/test/lib/fixtures_test.rb +8 -8
- data/test/lib/mirrors_test.rb +25 -25
- data/test/lib/revisions_test.rb +26 -26
- data/test/lib/tag_test.rb +26 -26
- data/test/lib/tags/asset_test.rb +11 -11
- data/test/lib/tags/collection_test.rb +33 -32
- data/test/lib/tags/field_boolean_test.rb +6 -6
- data/test/lib/tags/field_datetime_test.rb +6 -6
- data/test/lib/tags/field_integer_test.rb +6 -6
- data/test/lib/tags/field_rich_text_test.rb +6 -6
- data/test/lib/tags/field_string_test.rb +7 -7
- data/test/lib/tags/field_text_test.rb +6 -6
- data/test/lib/tags/file_test.rb +12 -12
- data/test/lib/tags/helper_test.rb +10 -10
- data/test/lib/tags/page_datetime_test.rb +6 -6
- data/test/lib/tags/page_file_test.rb +11 -11
- data/test/lib/tags/page_files_test.rb +12 -11
- data/test/lib/tags/page_integer_test.rb +6 -6
- data/test/lib/tags/page_markdown_test.rb +6 -6
- data/test/lib/tags/page_rich_text_test.rb +6 -6
- data/test/lib/tags/page_string_test.rb +6 -6
- data/test/lib/tags/page_text_test.rb +7 -7
- data/test/lib/tags/partial_test.rb +10 -10
- data/test/lib/tags/snippet_test.rb +6 -6
- data/test/lib/tags/template_test.rb +7 -7
- data/test/lib/view_methods_test.rb +89 -120
- data/test/models/block_test.rb +34 -34
- data/test/models/categorization_test.rb +25 -25
- data/test/models/category_test.rb +9 -9
- data/test/models/file_test.rb +38 -21
- data/test/models/layout_test.rb +27 -27
- data/test/models/page_test.rb +101 -71
- data/test/models/site_test.rb +50 -50
- data/test/models/snippet_test.rb +9 -9
- data/test/test_helper.rb +7 -9
- metadata +174 -147
- data/app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings.png +0 -0
- data/app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap-wysihtml5.js +0 -492
- data/app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap.js +0 -6
- data/app/assets/javascripts/comfortable_mexican_sofa/lib/wysihtml5.js +0 -261
- data/app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap-wysihtml5.css +0 -102
- data/app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap.css +0 -9
- data/app/assets/stylesheets/comfortable_mexican_sofa/wysihtml5_overrides.css.sass +0 -5
- data/app/models/concerns/cms/base.rb +0 -17
- data/app/views/admin/cms/categories/_edit.html.haml +0 -6
- data/app/views/admin/cms/categories/_index.html.haml +0 -24
- data/app/views/admin/cms/files/_form.html.haml +0 -18
- data/app/views/admin/cms/files/_index.html.haml +0 -14
- data/app/views/admin/cms/files/index.html.haml +0 -32
- data/app/views/admin/cms/layouts/_index_branch.html.haml +0 -23
- data/app/views/admin/cms/layouts/edit.html.haml +0 -9
- data/app/views/admin/cms/layouts/index.html.haml +0 -13
- data/app/views/admin/cms/pages/_form.html.haml +0 -39
- data/app/views/admin/cms/pages/edit.html.haml +0 -9
- data/app/views/admin/cms/pages/index.html.haml +0 -15
- data/app/views/admin/cms/revisions/show.html.haml +0 -29
- data/app/views/admin/cms/sites/_form.html.haml +0 -14
- data/app/views/admin/cms/sites/_mirrors.html.haml +0 -18
- data/app/views/admin/cms/sites/index.html.haml +0 -28
- data/app/views/admin/cms/snippets/_form.html.haml +0 -15
- data/app/views/admin/cms/snippets/index.html.haml +0 -32
- data/app/views/layouts/admin/cms.html.haml +0 -4
- data/app/views/layouts/admin/cms/_body.html.haml +0 -17
- data/app/views/layouts/admin/cms/_left.html.haml +0 -16
- data/app/views/layouts/admin/cms/_right.html.haml +0 -5
- data/db/cms_fixtures/sample-site/layouts/default/nested/content.html +0 -2
- data/db/cms_fixtures/sample-site/pages/index/child/left.html +0 -1
- data/doc/sofa.png +0 -0
- data/test/controllers/admin/cms/categories_controller_test.rb +0 -70
- data/test/controllers/admin/cms/revisions_controller_test.rb +0 -138
- data/test/controllers/cms/assets_controller_test.rb +0 -29
- data/test/fixtures/cms/categorizations.yml +0 -3
@@ -1,14 +0,0 @@
|
|
1
|
-
- type ||= nil
|
2
|
-
- files_scope = (type == 'image') ? @site.files.images : @site.files
|
3
|
-
|
4
|
-
.box.file-uploader
|
5
|
-
= form_for :file, :url => admin_cms_site_files_path(@site, :ajax => true), :html => {:multipart => true, :target => 'file-upload-frame'} do |form|
|
6
|
-
%span.btn.btn-file
|
7
|
-
= t('.button')
|
8
|
-
= form.file_field :file, :multiple => true, :id => nil
|
9
|
-
|
10
|
-
.uploaded-files
|
11
|
-
- files_scope.order(:label).each do |file|
|
12
|
-
= render :partial => 'admin/cms/files/file', :object => file
|
13
|
-
|
14
|
-
%iframe#file-upload-frame{:name => 'file-upload-frame', :src => ''}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.new_link'), new_admin_cms_site_file_path(@site), :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
= render 'admin/cms/partials/files_before'
|
6
|
-
|
7
|
-
= render :partial => 'admin/cms/categories/index', :object => 'Cms::File'
|
8
|
-
|
9
|
-
%table.table.table-hover.table-bordered
|
10
|
-
%tbody.sortable
|
11
|
-
- @files.each do |file|
|
12
|
-
%tr{:id => dom_id(file)}
|
13
|
-
%td
|
14
|
-
- if file.is_image?
|
15
|
-
- icon_style = "background: url('#{file.file.url(:cms_thumb)}') no-repeat center"
|
16
|
-
.icon{:style => icon_style}
|
17
|
-
- if !params[:category].present? && @site.files.count > 1
|
18
|
-
.dragger
|
19
|
-
%span ⇅
|
20
|
-
%td.main
|
21
|
-
.item-title
|
22
|
-
= link_to file.label, edit_admin_cms_site_file_path(@site, file)
|
23
|
-
= render :partial => '/admin/cms/categories/categories', :object => file
|
24
|
-
.item-meta
|
25
|
-
= link_to file.file_file_name, file.file.url, :target => '_blank'
|
26
|
-
|
27
|
-
%td
|
28
|
-
.btn-group
|
29
|
-
= link_to t('.edit'), edit_admin_cms_site_file_path(@site, file), :class => 'btn btn-small'
|
30
|
-
= link_to t('.delete'), admin_cms_site_file_path(@site, file), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-small btn-danger'
|
31
|
-
|
32
|
-
= render 'admin/cms/partials/files_after'
|
@@ -1,23 +0,0 @@
|
|
1
|
-
- layout ||= index_branch
|
2
|
-
- has_siblings = layout.siblings.select{|l| l.site_id == @site.id}.size > 0
|
3
|
-
|
4
|
-
%li{:id => dom_id(layout)}
|
5
|
-
.item
|
6
|
-
.icon
|
7
|
-
- if !params[:category].present? && has_siblings
|
8
|
-
.dragger
|
9
|
-
%span ⇅
|
10
|
-
|
11
|
-
.btn-group
|
12
|
-
= link_to t('.add_child_layout'), new_admin_cms_site_layout_path(@site, :parent_id => layout.id), :class => 'btn btn-small'
|
13
|
-
= link_to t('.edit'), edit_admin_cms_site_layout_path(@site, layout), :class => 'btn btn-small'
|
14
|
-
= link_to t('.delete'), admin_cms_site_layout_path(@site, layout), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-small btn-danger'
|
15
|
-
|
16
|
-
.item-content
|
17
|
-
.item-title
|
18
|
-
= link_to layout.label, edit_admin_cms_site_layout_path(@site, layout)
|
19
|
-
.item-meta
|
20
|
-
= layout.identifier
|
21
|
-
|
22
|
-
- if layout.children.present?
|
23
|
-
%ul= render :partial => 'index_branch', :collection => layout.children
|
@@ -1,9 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.revision', :count => @layout.revisions.count), admin_cms_site_layout_revisions_path(@site, @layout), :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
- content_for :right_column do
|
6
|
-
= render 'admin/cms/sites/mirrors', :object => @layout
|
7
|
-
|
8
|
-
= comfy_form_for @layout, :as => :layout, :url => {:action => :update} do |form|
|
9
|
-
= render form
|
@@ -1,13 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.new_link'), new_admin_cms_site_layout_path(@site), :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
- content_for :right_column do
|
6
|
-
= render :partial => 'admin/cms/sites/mirrors'
|
7
|
-
|
8
|
-
= render 'admin/cms/partials/layouts_before'
|
9
|
-
|
10
|
-
%ul.list.sortable
|
11
|
-
= render :partial => 'index_branch', :collection => @layouts
|
12
|
-
|
13
|
-
= render 'admin/cms/partials/layouts_after'
|
@@ -1,39 +0,0 @@
|
|
1
|
-
- content_for :right_column do
|
2
|
-
#form-save.box
|
3
|
-
%label.checkbox.inline
|
4
|
-
%input{:type => 'checkbox'}
|
5
|
-
= ::Cms::Page.human_attribute_name(:is_published)
|
6
|
-
%button.btn.btn-small.btn-primary.pull-right
|
7
|
-
= render :partial => 'admin/cms/files/index'
|
8
|
-
|
9
|
-
= render 'admin/cms/partials/page_form_before', :object => form
|
10
|
-
|
11
|
-
= form.text_field :label, :data => {:slugify => @page.new_record?}
|
12
|
-
|
13
|
-
- unless @site.pages.count == 0 || @site.pages.root == @page
|
14
|
-
= form.text_field :slug, :data => {:slug => true}
|
15
|
-
- unless @page.new_record?
|
16
|
-
= form.text_field :full_path, :id => 'full-path', :disabled => true
|
17
|
-
|
18
|
-
- if (options = ::Cms::Layout.options_for_select(@site)).present?
|
19
|
-
= form.select :layout_id, options, {}, 'data-url' => form_blocks_admin_cms_site_page_path(@site, @page.id.to_i)
|
20
|
-
|
21
|
-
- if (options = ::Cms::Page.options_for_select(@site, @page)).present?
|
22
|
-
= form.select :parent_id, options
|
23
|
-
|
24
|
-
- if (options = ::Cms::Page.options_for_select(@site, @page, nil, 0, false)).present?
|
25
|
-
= form.select :target_page_id, [["---- #{t('.select_target_page')} ----", nil]] + options
|
26
|
-
|
27
|
-
= render 'admin/cms/partials/page_form_inner', :object => form
|
28
|
-
|
29
|
-
= render :partial => 'admin/cms/categories/form', :object => form
|
30
|
-
|
31
|
-
= render :partial => 'form_blocks'
|
32
|
-
|
33
|
-
= form.check_box :is_published, :label => t('.is_published')
|
34
|
-
|
35
|
-
= render 'admin/cms/partials/page_form_after', :object => form
|
36
|
-
|
37
|
-
.form-actions
|
38
|
-
= form.submit t('.preview'), :name => 'preview', :id => nil, :class => 'btn'
|
39
|
-
= form.submit t(@page.new_record?? '.create' : '.update'), :class => 'btn btn-primary'
|
@@ -1,9 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.revision', :count => @page.revisions.count), admin_cms_site_page_revisions_path(@site, @page), :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
- content_for :right_column do
|
6
|
-
= render 'admin/cms/sites/mirrors', :object => @page
|
7
|
-
|
8
|
-
= comfy_form_for @page, :as => :page, :url => {:action => :update}, :html => {:multipart => true} do |form|
|
9
|
-
= render form
|
@@ -1,15 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.new_link'), new_admin_cms_site_page_path(@site), :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
- content_for :right_column do
|
6
|
-
= render :partial => 'admin/cms/sites/mirrors'
|
7
|
-
|
8
|
-
= render 'admin/cms/partials/pages_before'
|
9
|
-
|
10
|
-
= render :partial => 'admin/cms/categories/index', :object => 'Cms::Page'
|
11
|
-
|
12
|
-
%ul.list.sortable
|
13
|
-
= render :partial => 'index_branch', :collection => @pages
|
14
|
-
|
15
|
-
= render 'admin/cms/partials/pages_after'
|
@@ -1,29 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
%h2
|
3
|
-
= t('.title')
|
4
|
-
= @record.class.to_s.demodulize
|
5
|
-
%h4
|
6
|
-
= @record.is_a?(::Cms::Page) ? "#{t('.full_path')}: #{@record.full_path}" : "#{t('.slug')}: #{@record.identifier}"
|
7
|
-
|
8
|
-
- content_for :right_column do
|
9
|
-
.box.revisions
|
10
|
-
- @record.revisions.each do |revision|
|
11
|
-
= active_link_to l(revision.created_at), :id => revision.id
|
12
|
-
|
13
|
-
%table.table
|
14
|
-
%tr
|
15
|
-
%th
|
16
|
-
%th= t('.current')
|
17
|
-
%th= l(@revision.created_at)
|
18
|
-
|
19
|
-
- @current_content.each do |label, content|
|
20
|
-
%tr
|
21
|
-
%th= ::Cms::Layout.human_attribute_name(label)
|
22
|
-
%td
|
23
|
-
%pre= content
|
24
|
-
%td
|
25
|
-
%pre= @versioned_content[label]
|
26
|
-
|
27
|
-
= comfy_form_for @revision, :url => {:action => :revert} do |form|
|
28
|
-
.form-actions
|
29
|
-
= form.submit t('.update'), :class => 'btn btn-primary'
|
@@ -1,14 +0,0 @@
|
|
1
|
-
= render 'admin/cms/partials/site_form_before', :object => form
|
2
|
-
|
3
|
-
= form.text_field :label, :data => {:slugify => @site.new_record?}
|
4
|
-
= form.text_field :identifier, :data => {:slug => true}
|
5
|
-
= form.text_field :hostname
|
6
|
-
= form.text_field :path
|
7
|
-
= form.select :locale, ComfortableMexicanSofa.config.locales.to_a.collect{|l| [l[1], l[0]]}
|
8
|
-
= form.check_box :is_mirrored, :label => t('.is_mirrored')
|
9
|
-
|
10
|
-
= render 'admin/cms/partials/site_form_after', :object => form
|
11
|
-
|
12
|
-
.form-actions
|
13
|
-
= form.submit t(@site.new_record?? '.create' : '.update'), :class => 'btn btn-primary'
|
14
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
- return unless @site.is_mirrored?
|
2
|
-
|
3
|
-
- object ||= nil
|
4
|
-
|
5
|
-
- options = case object
|
6
|
-
- when ::Cms::Layout
|
7
|
-
- object.mirrors.collect{|m| [m.site.label, edit_admin_cms_site_layout_path(m.site, m)]}
|
8
|
-
- when ::Cms::Page
|
9
|
-
- object.mirrors.collect{|m| [m.site.label, edit_admin_cms_site_page_path(m.site, m)]}
|
10
|
-
- when ::Cms::Snippet
|
11
|
-
- object.mirrors.collect{|m| [m.site.label, edit_admin_cms_site_snippet_path(m.site, m)]}
|
12
|
-
- else
|
13
|
-
- (::Cms::Site.mirrored - [@site]).collect{|s| [s.label, url_for(params.merge(:site_id => s))]}
|
14
|
-
|
15
|
-
- options = [[@site.label, request.fullpath]] + options
|
16
|
-
|
17
|
-
#mirrors.box
|
18
|
-
= select_tag :mirror, options_for_select(options)
|
@@ -1,28 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.new_link'), new_admin_cms_site_path, :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
= render 'admin/cms/partials/sites_before'
|
6
|
-
|
7
|
-
%table.table.table-hover.table-bordered
|
8
|
-
- @sites.each do |site|
|
9
|
-
%tr
|
10
|
-
%td
|
11
|
-
.icon
|
12
|
-
%td.main
|
13
|
-
.item-title
|
14
|
-
= link_to site.label, admin_cms_site_pages_path(site)
|
15
|
-
.item-meta
|
16
|
-
.identifier
|
17
|
-
= site.identifier
|
18
|
-
= "(#{site.locale})"
|
19
|
-
.host
|
20
|
-
- host = "http://#{site.hostname}/#{site.path}"
|
21
|
-
= link_to host, host, :target => '_blank'
|
22
|
-
%td
|
23
|
-
.btn-group
|
24
|
-
= link_to t('.select'), admin_cms_site_pages_path(site), :class => 'btn btn-small'
|
25
|
-
= link_to t('.edit'), edit_admin_cms_site_path(site), :class => 'btn btn-small'
|
26
|
-
= link_to t('.delete'), admin_cms_site_path(site), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-small btn-danger'
|
27
|
-
|
28
|
-
= render 'admin/cms/partials/sites_after'
|
@@ -1,15 +0,0 @@
|
|
1
|
-
- content_for :right_column do
|
2
|
-
= render :partial => 'admin/cms/files/index'
|
3
|
-
|
4
|
-
= render 'admin/cms/partials/snippet_form_before', :object => form
|
5
|
-
|
6
|
-
= form.text_field :label, :data => {:slugify => @snippet.new_record?}
|
7
|
-
= form.text_field :identifier, :data => {:slug => true}
|
8
|
-
= form.text_area :content, :data => {'cms-cm-mode' => 'text/html'}
|
9
|
-
|
10
|
-
= render :partial => 'admin/cms/categories/form', :object => form
|
11
|
-
|
12
|
-
= render 'admin/cms/partials/snippet_form_after', :object => form
|
13
|
-
|
14
|
-
.form-actions
|
15
|
-
= form.submit t(@snippet.new_record?? '.create' : '.update'), :class => 'btn btn-primary'
|
@@ -1,32 +0,0 @@
|
|
1
|
-
.page-header
|
2
|
-
= link_to t('.new_link'), new_admin_cms_site_snippet_path(@site), :class => 'btn pull-right'
|
3
|
-
%h2= t('.title')
|
4
|
-
|
5
|
-
- content_for :right_column do
|
6
|
-
= render :partial => 'admin/cms/sites/mirrors'
|
7
|
-
|
8
|
-
= render 'admin/cms/partials/snippets_before'
|
9
|
-
|
10
|
-
= render :partial => 'admin/cms/categories/index', :object => 'Cms::Snippet'
|
11
|
-
|
12
|
-
%table.table.table-hover.table-bordered
|
13
|
-
%tbody.sortable
|
14
|
-
- @snippets.each do |snippet|
|
15
|
-
%tr{:id => dom_id(snippet)}
|
16
|
-
%td
|
17
|
-
.icon
|
18
|
-
- if !params[:category].present? && @site.snippets.count > 1
|
19
|
-
.dragger
|
20
|
-
%span ⇅
|
21
|
-
%td.main
|
22
|
-
.item-title
|
23
|
-
= link_to snippet.label, edit_admin_cms_site_snippet_path(@site, snippet)
|
24
|
-
= render :partial => 'admin/cms/categories/categories', :object => snippet
|
25
|
-
.item-meta
|
26
|
-
= snippet.identifier
|
27
|
-
%td
|
28
|
-
.btn-group
|
29
|
-
= link_to t('.edit'), edit_admin_cms_site_snippet_path(@site, snippet), :class => 'btn btn-small'
|
30
|
-
= link_to t('.delete'), admin_cms_site_snippet_path(@site, snippet), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-small btn-danger'
|
31
|
-
|
32
|
-
= render 'admin/cms/partials/snippets_after'
|
@@ -1,17 +0,0 @@
|
|
1
|
-
%body#comfy{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify}"}
|
2
|
-
|
3
|
-
= render 'admin/cms/partials/body_before'
|
4
|
-
|
5
|
-
.body-wrapper
|
6
|
-
.left-column
|
7
|
-
.left-column-content
|
8
|
-
= render :partial => 'layouts/admin/cms/left'
|
9
|
-
.right-column
|
10
|
-
.right-column-content
|
11
|
-
= render :partial => 'layouts/admin/cms/right'
|
12
|
-
.center-column
|
13
|
-
= render :partial => 'layouts/admin/cms/center'
|
14
|
-
|
15
|
-
= render :partial => 'layouts/admin/cms/footer'
|
16
|
-
|
17
|
-
= render :partial => 'layouts/admin/cms/footer_js'
|
@@ -1,16 +0,0 @@
|
|
1
|
-
= render '/admin/cms/partials/navigation_before'
|
2
|
-
|
3
|
-
%ul.navigation
|
4
|
-
%li= active_link_to t('admin.cms.base.sites'), admin_cms_sites_path, :active => ['admin/cms/sites']
|
5
|
-
|
6
|
-
- if @site && !@site.new_record?
|
7
|
-
%li= active_link_to t('admin.cms.base.layouts'), admin_cms_site_layouts_path(@site)
|
8
|
-
%li= active_link_to t('admin.cms.base.pages'), admin_cms_site_pages_path(@site)
|
9
|
-
%li= active_link_to t('admin.cms.base.snippets'), admin_cms_site_snippets_path(@site)
|
10
|
-
%li= active_link_to t('admin.cms.base.files'), admin_cms_site_files_path(@site)
|
11
|
-
|
12
|
-
= cms_hook :navigation
|
13
|
-
|
14
|
-
= render '/admin/cms/partials/navigation_inner'
|
15
|
-
|
16
|
-
= render '/admin/cms/partials/navigation_after'
|
@@ -1 +0,0 @@
|
|
1
|
-
Child Page Left Fixture Content
|
data/doc/sofa.png
DELETED
Binary file
|
@@ -1,70 +0,0 @@
|
|
1
|
-
require_relative '../../../test_helper'
|
2
|
-
|
3
|
-
class Admin::Cms::CategoriesControllerTest < ActionController::TestCase
|
4
|
-
|
5
|
-
def test_get_edit
|
6
|
-
xhr :get, :edit, :site_id => cms_sites(:default), :id => cms_categories(:default)
|
7
|
-
assert_response :success
|
8
|
-
assert_template :edit
|
9
|
-
assert assigns(:category)
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_get_edit_failure
|
13
|
-
xhr :get, :edit, :site_id => cms_sites(:default), :id => 'invalid'
|
14
|
-
assert_response :success
|
15
|
-
assert response.body.blank?
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_creation
|
19
|
-
assert_difference 'Cms::Category.count' do
|
20
|
-
xhr :post, :create, :site_id => cms_sites(:default), :category => {
|
21
|
-
:label => 'Test Label',
|
22
|
-
:categorized_type => 'Cms::Snippet'
|
23
|
-
}
|
24
|
-
assert_response :success
|
25
|
-
assert_template :create
|
26
|
-
assert assigns(:category)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_creation_failure
|
31
|
-
assert_no_difference 'Cms::Category.count' do
|
32
|
-
xhr :post, :create, :site_id => cms_sites(:default), :category => { }
|
33
|
-
assert_response :success
|
34
|
-
assert response.body.blank?
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_update
|
39
|
-
category = cms_categories(:default)
|
40
|
-
xhr :put, :update, :site_id => cms_sites(:default), :id => category, :category => {
|
41
|
-
:label => 'Updated Label'
|
42
|
-
}
|
43
|
-
assert_response :success
|
44
|
-
assert_template :update
|
45
|
-
assert assigns(:category)
|
46
|
-
category.reload
|
47
|
-
assert_equal 'Updated Label', category.label
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_update_failure
|
51
|
-
category = cms_categories(:default)
|
52
|
-
xhr :put, :update, :site_id => cms_sites(:default), :id => category, :category => {
|
53
|
-
:label => ''
|
54
|
-
}
|
55
|
-
assert_response :success
|
56
|
-
assert response.body.blank?
|
57
|
-
category.reload
|
58
|
-
assert_not_equal '', category.label
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_destroy
|
62
|
-
assert_difference 'Cms::Category.count', -1 do
|
63
|
-
xhr :delete, :destroy, :site_id => cms_sites(:default), :id => cms_categories(:default)
|
64
|
-
assert assigns(:category)
|
65
|
-
assert_response :success
|
66
|
-
assert_template :destroy
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
@@ -1,138 +0,0 @@
|
|
1
|
-
require_relative '../../../test_helper'
|
2
|
-
|
3
|
-
class Admin::Cms::RevisionsControllerTest < ActionController::TestCase
|
4
|
-
|
5
|
-
def test_get_index_for_layouts
|
6
|
-
get :index, :site_id => cms_sites(:default), :layout_id => cms_layouts(:default)
|
7
|
-
assert_response :redirect
|
8
|
-
assert_redirected_to :action => :show, :id => cms_revisions(:layout)
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_get_index_for_pages
|
12
|
-
get :index, :site_id => cms_sites(:default), :page_id => cms_pages(:default)
|
13
|
-
assert_response :redirect
|
14
|
-
assert_redirected_to :action => :show, :id => cms_revisions(:page)
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_get_index_for_snippets
|
18
|
-
get :index, :site_id => cms_sites(:default), :snippet_id => cms_snippets(:default)
|
19
|
-
assert_response :redirect
|
20
|
-
assert_redirected_to :action => :show, :id => cms_revisions(:snippet)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_get_index_for_snippets_with_no_revisions
|
24
|
-
Cms::Revision.delete_all
|
25
|
-
get :index, :site_id => cms_sites(:default), :snippet_id => cms_snippets(:default)
|
26
|
-
assert_response :redirect
|
27
|
-
assert_redirected_to :action => :show, :id => 0
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_get_show_for_layout
|
31
|
-
get :show, :site_id => cms_sites(:default), :layout_id => cms_layouts(:default), :id => cms_revisions(:layout)
|
32
|
-
assert_response :success
|
33
|
-
assert assigns(:record)
|
34
|
-
assert assigns(:revision)
|
35
|
-
assert assigns(:record).is_a?(Cms::Layout)
|
36
|
-
assert_template :show
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_get_show_for_page
|
40
|
-
get :show, :site_id => cms_sites(:default), :page_id => cms_pages(:default), :id => cms_revisions(:page)
|
41
|
-
assert_response :success
|
42
|
-
assert assigns(:record)
|
43
|
-
assert assigns(:revision)
|
44
|
-
assert assigns(:record).is_a?(Cms::Page)
|
45
|
-
assert_template :show
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_get_show_for_snippet
|
49
|
-
get :show, :site_id => cms_sites(:default), :snippet_id => cms_snippets(:default), :id => cms_revisions(:snippet)
|
50
|
-
assert_response :success
|
51
|
-
assert assigns(:record)
|
52
|
-
assert assigns(:revision)
|
53
|
-
assert assigns(:record).is_a?(Cms::Snippet)
|
54
|
-
assert_template :show
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_get_show_for_bad_type
|
58
|
-
get :show, :site_id => cms_sites(:default), :snippet_id => 'invalid', :id => cms_revisions(:snippet)
|
59
|
-
assert_response :redirect
|
60
|
-
assert_redirected_to admin_cms_path
|
61
|
-
assert_equal 'Record Not Found', flash[:error]
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_get_show_for_layout_failure
|
65
|
-
site = cms_sites(:default)
|
66
|
-
get :show, :site_id => site, :layout_id => cms_layouts(:default), :id => 'invalid'
|
67
|
-
assert_response :redirect
|
68
|
-
assert assigns(:record)
|
69
|
-
assert_redirected_to edit_admin_cms_site_layout_path(site, assigns(:record))
|
70
|
-
assert_equal 'Revision Not Found', flash[:error]
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_get_show_for_page_failure
|
74
|
-
site = cms_sites(:default)
|
75
|
-
get :show, :site_id => site, :page_id => cms_pages(:default), :id => 'invalid'
|
76
|
-
assert_response :redirect
|
77
|
-
assert assigns(:record)
|
78
|
-
assert_redirected_to edit_admin_cms_site_page_path(site, assigns(:record))
|
79
|
-
assert_equal 'Revision Not Found', flash[:error]
|
80
|
-
end
|
81
|
-
|
82
|
-
def test_get_show_for_snippet_failure
|
83
|
-
site = cms_sites(:default)
|
84
|
-
get :show, :site_id => site, :snippet_id => cms_snippets(:default), :id => 'invalid'
|
85
|
-
assert_response :redirect
|
86
|
-
assert assigns(:record)
|
87
|
-
assert_redirected_to edit_admin_cms_site_snippet_path(site, assigns(:record))
|
88
|
-
assert_equal 'Revision Not Found', flash[:error]
|
89
|
-
end
|
90
|
-
|
91
|
-
def test_revert_for_layout
|
92
|
-
layout = cms_layouts(:default)
|
93
|
-
|
94
|
-
assert_difference 'layout.revisions.count' do
|
95
|
-
put :revert, :site_id => cms_sites(:default), :layout_id => layout, :id => cms_revisions(:layout)
|
96
|
-
assert_response :redirect
|
97
|
-
assert_redirected_to edit_admin_cms_site_layout_path(layout.site, layout)
|
98
|
-
assert_equal 'Content Reverted', flash[:success]
|
99
|
-
|
100
|
-
layout.reload
|
101
|
-
assert_equal 'revision {{cms:page:default_page_text}}', layout.content
|
102
|
-
assert_equal 'revision css', layout.css
|
103
|
-
assert_equal 'revision js', layout.js
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def test_revert_for_page
|
108
|
-
page = cms_pages(:default)
|
109
|
-
|
110
|
-
assert_difference 'page.revisions.count' do
|
111
|
-
put :revert, :site_id => cms_sites(:default), :page_id => page, :id => cms_revisions(:page)
|
112
|
-
assert_response :redirect
|
113
|
-
assert_redirected_to edit_admin_cms_site_page_path(page.site, page)
|
114
|
-
assert_equal 'Content Reverted', flash[:success]
|
115
|
-
|
116
|
-
page.reload
|
117
|
-
assert_equal [
|
118
|
-
{ :identifier => 'default_field_text', :content => 'revision field content' },
|
119
|
-
{ :identifier => 'default_page_text', :content => 'revision page content' }
|
120
|
-
], page.blocks_attributes
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
def test_revert_for_snippet
|
125
|
-
snippet = cms_snippets(:default)
|
126
|
-
|
127
|
-
assert_difference 'snippet.revisions.count' do
|
128
|
-
put :revert, :site_id => cms_sites(:default), :snippet_id => snippet, :id => cms_revisions(:snippet)
|
129
|
-
assert_response :redirect
|
130
|
-
assert_redirected_to edit_admin_cms_site_snippet_path(snippet.site, snippet)
|
131
|
-
assert_equal 'Content Reverted', flash[:success]
|
132
|
-
|
133
|
-
snippet.reload
|
134
|
-
assert_equal 'revision content', snippet.content
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
end
|