solidus_static_content 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.gitignore +17 -6
  5. data/.rspec +2 -3
  6. data/.rubocop.yml +2 -0
  7. data/CHANGELOG.md +80 -0
  8. data/Gemfile +26 -6
  9. data/{LICENSE.md → LICENSE} +0 -0
  10. data/README.md +81 -68
  11. data/Rakefile +4 -13
  12. data/app/assets/stylesheets/spree/frontend/solidus_static_content.css +7 -0
  13. data/app/assets/stylesheets/spree/frontend/spree_static_content.css +2 -7
  14. data/app/models/solidus_static_content/permission_sets/page_display.rb +11 -0
  15. data/app/models/solidus_static_content/permission_sets/page_management.rb +11 -0
  16. data/app/models/spree/page.rb +16 -21
  17. data/bin/console +17 -0
  18. data/bin/r +8 -0
  19. data/bin/rails +6 -6
  20. data/bin/rails-engine +13 -0
  21. data/bin/rails-sandbox +16 -0
  22. data/bin/rake +7 -0
  23. data/bin/sandbox +84 -0
  24. data/bin/sandbox_rails +8 -0
  25. data/bin/setup +8 -0
  26. data/config/locales/de.yml +7 -5
  27. data/config/locales/en.yml +9 -7
  28. data/config/locales/es-MX.yml +38 -0
  29. data/config/locales/es.yml +6 -5
  30. data/config/locales/et.yml +6 -5
  31. data/config/locales/fr.yml +7 -5
  32. data/config/locales/it.yml +6 -5
  33. data/config/locales/nl.yml +7 -5
  34. data/config/locales/pl.yml +6 -5
  35. data/config/locales/pt-BR.yml +6 -5
  36. data/config/locales/pt.yml +7 -5
  37. data/config/locales/ro.yml +11 -9
  38. data/config/locales/ru.yml +7 -5
  39. data/config/locales/sv.yml +7 -5
  40. data/config/routes.rb +9 -2
  41. data/db/migrate/20081216193152_create_pages.rb +1 -1
  42. data/db/migrate/20090625125735_extend_pages.rb +1 -1
  43. data/db/migrate/20090814113100_add_visible_to_pages.rb +1 -1
  44. data/db/migrate/20090814142845_add_default_true_to_visible_for_page.rb +1 -1
  45. data/db/migrate/20090829000527_add_index_for_page.rb +1 -1
  46. data/db/migrate/20091219021134_add_meta_fields_to_pages.rb +1 -1
  47. data/db/migrate/20100204105222_add_layout_to_pages.rb +1 -1
  48. data/db/migrate/20100323085528_add_show_in_sidebar_option_to_pages.rb +1 -1
  49. data/db/migrate/20110717103112_add_meta_title_to_page.rb +1 -1
  50. data/db/migrate/20120723144115_add_render_as_partial_for_layout_for_spree_pages.rb +1 -1
  51. data/db/migrate/20140926121757_add_pages_stores.rb +1 -1
  52. data/db/migrate/20180305193240_update_spree_page_position.rb +13 -0
  53. data/lib/controllers/backend/spree/admin/pages_controller.rb +16 -0
  54. data/{app/controllers → lib/controllers/frontend}/spree/static_content_controller.rb +7 -3
  55. data/lib/generators/solidus_static_content/install/install_generator.rb +7 -5
  56. data/lib/solidus_static_content.rb +6 -18
  57. data/lib/solidus_static_content/engine.rb +35 -0
  58. data/lib/solidus_static_content/factories.rb +18 -0
  59. data/lib/solidus_static_content/route_matcher.rb +11 -0
  60. data/lib/solidus_static_content/version.rb +5 -0
  61. data/lib/views/backend/spree/admin/pages/_form.html.erb +119 -0
  62. data/lib/views/backend/spree/admin/pages/edit.html.erb +32 -0
  63. data/lib/views/backend/spree/admin/pages/index.html.erb +68 -0
  64. data/lib/views/backend/spree/admin/pages/new.html.erb +31 -0
  65. data/lib/views/backend/spree/admin/shared/_pages_tabs.html.erb +9 -0
  66. data/{app/views → lib/views/frontend}/spree/static_content/_static_content_footer.html.erb +0 -0
  67. data/{app/views → lib/views/frontend}/spree/static_content/_static_content_header.html.erb +0 -0
  68. data/{app/views → lib/views/frontend}/spree/static_content/_static_content_list.html.erb +0 -0
  69. data/{app/views → lib/views/frontend}/spree/static_content/_static_content_sidebar.html.erb +1 -1
  70. data/lib/views/frontend/spree/static_content/show.html.erb +18 -0
  71. data/solidus_static_content.gemspec +36 -31
  72. data/spec/controllers/spree/admin/pages_controller_spec.rb +11 -0
  73. data/spec/controllers/{static_content_controller_spec.rb → spree/static_content_controller_spec.rb} +9 -12
  74. data/spec/features/{admin → spree/admin}/pages_spec.rb +8 -5
  75. data/spec/features/{static_content_spec.rb → spree/static_content_spec.rb} +6 -4
  76. data/spec/helpers/{page_helper_spec.rb → spree/page_helper_spec.rb} +0 -0
  77. data/spec/lib/solidus_static_content/engine_spec.rb +14 -0
  78. data/spec/lib/{spree_static.content_spec.rb → solidus_static_content/route_matcher_spec.rb} +4 -13
  79. data/spec/models/{page_spec.rb → spree/page_spec.rb} +22 -7
  80. data/spec/spec_helper.rb +17 -40
  81. metadata +85 -177
  82. data/.travis.yml +0 -21
  83. data/app/assets/javascripts/spree/backend/spree_static_content.js +0 -1
  84. data/app/assets/javascripts/spree/frontend/spree_static_content.js +0 -1
  85. data/app/assets/stylesheets/spree/backend/spree_static_content.css +0 -3
  86. data/app/controllers/spree/admin/pages_controller.rb +0 -3
  87. data/app/overrides/pages_in_menu.rb +0 -5
  88. data/app/views/spree/admin/pages/_form.html.erb +0 -98
  89. data/app/views/spree/admin/pages/edit.html.erb +0 -18
  90. data/app/views/spree/admin/pages/index.html.erb +0 -51
  91. data/app/views/spree/admin/pages/new.html.erb +0 -18
  92. data/app/views/spree/static_content/show.html.erb +0 -26
  93. data/lib/spree_static_content/engine.rb +0 -17
  94. data/spec/factories/page_factory.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4fb012c97e50d28d83c4efce564265f2fdb538f7
4
- data.tar.gz: d159565b4f4ea4a7a883ce4378fa1a4b35f6d21f
2
+ SHA256:
3
+ metadata.gz: 7a98d396588682a74ff937428388774a578806c8161da21195131e282244c0f9
4
+ data.tar.gz: 6247ace2e49037b397ae2adaca3456cf121a5d0fd242d7d8f5fc15c742afadc3
5
5
  SHA512:
6
- metadata.gz: a814032d5eab0fab3c699c1169864a59c8d48a8438d21eaa1115d6064444adc59ca8c103990f81002cb638ddeb8b7f37b37652a7ba814e9b68cbd2b8f5f70af8
7
- data.tar.gz: 3624ace3e06d964c27007cce8e50527c29e50e1ae7069fef94b10151538adb6e76614a3881a0c05d5b44a1e46b730637b402466797a4f27374787b42a244c2ba
6
+ metadata.gz: 4a7ec81a975abfc2d02b987787db16c99d33536525981fa0f30693d274bd519bc5e6721629f6cdae1dff8a1c30d33d323be79d23abb897a04b320130b38687d6
7
+ data.tar.gz: 4fe5ad4a7eae624705fd593d604c5bef9ac44ec91f3de12f5bd9293dc71086ad8b975fef2ef35f31b7d6b44cce8949091f2b543d6a07006ee0cf2dd7e0531664
@@ -0,0 +1,35 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ # Always take the latest version of the orb, this allows us to
5
+ # run specs against Solidus supported versions only without the need
6
+ # to change this configuration every time a Solidus version is released
7
+ # or goes EOL.
8
+ solidusio_extensions: solidusio/extensions@volatile
9
+
10
+ jobs:
11
+ run-specs-with-postgres:
12
+ executor: solidusio_extensions/postgres
13
+ steps:
14
+ - solidusio_extensions/run-tests
15
+ run-specs-with-mysql:
16
+ executor: solidusio_extensions/mysql
17
+ steps:
18
+ - solidusio_extensions/run-tests
19
+
20
+ workflows:
21
+ "Run specs on supported Solidus versions":
22
+ jobs:
23
+ - run-specs-with-postgres
24
+ - run-specs-with-mysql
25
+ "Weekly run specs against master":
26
+ triggers:
27
+ - schedule:
28
+ cron: "0 0 * * 4" # every Thursday
29
+ filters:
30
+ branches:
31
+ only:
32
+ - master
33
+ jobs:
34
+ - run-specs-with-postgres
35
+ - run-specs-with-mysql
@@ -0,0 +1,5 @@
1
+ bump:
2
+ recurse: false
3
+ file: 'lib/solidus_static_content/version.rb'
4
+ message: Bump SolidusStaticContent to %{version}
5
+ tag: true
data/.gitignore CHANGED
@@ -1,9 +1,20 @@
1
+ *.gem
2
+ \#*
3
+ *~
4
+ .#*
1
5
  .DS_Store
2
- nbproject
3
- **.gem
6
+ .idea
7
+ .project
8
+ .sass-cache
9
+ coverage
4
10
  Gemfile.lock
5
- spec/dummy/
6
- .rvmrc
7
11
  tmp
8
- coverage
9
- .bundle
12
+ nbproject
13
+ pkg
14
+ *.swp
15
+ spec/dummy
16
+ spec/examples.txt
17
+ /sandbox
18
+ .rvmrc
19
+ .ruby-version
20
+ .ruby-gemset
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
- --colour
2
- --format
3
- progress
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,2 @@
1
+ require:
2
+ - solidus_dev_support/rubocop
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ ## [v2.0.0](https://github.com/solidusio-contrib/solidus_static_content/tree/v2.0.0) (2020-06-05)
4
+
5
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_static_content/compare/v1.0.0...v2.0.0)
6
+
7
+ **Breaking changes:**
8
+
9
+ - Rename SpreeStaticContent to SolidusStaticContent [\#67](https://github.com/solidusio-contrib/solidus_static_content/pull/67) ([aldesantis](https://github.com/aldesantis))
10
+ - Remove deprecated constants [\#66](https://github.com/solidusio-contrib/solidus_static_content/pull/66) ([aldesantis](https://github.com/aldesantis))
11
+
12
+ **Implemented enhancements:**
13
+
14
+ - Remove the `I18n` namespace from views [\#54](https://github.com/solidusio-contrib/solidus_static_content/issues/54)
15
+ - Drag & drop ordering + general views updates [\#53](https://github.com/solidusio-contrib/solidus_static_content/pull/53) ([elia](https://github.com/elia))
16
+ - Use the same sidebar logic that Solidus uses [\#52](https://github.com/solidusio-contrib/solidus_static_content/pull/52) ([elia](https://github.com/elia))
17
+ - Auto-generate slug when missing, require presence of a store, attach to the default store by default [\#48](https://github.com/solidusio-contrib/solidus_static_content/pull/48) ([elia](https://github.com/elia))
18
+ - Some more streamlining of the setup process and readme [\#46](https://github.com/solidusio-contrib/solidus_static_content/pull/46) ([elia](https://github.com/elia))
19
+ - Remove Deface hook for Pages in favor of MenuItem [\#45](https://github.com/solidusio-contrib/solidus_static_content/pull/45) ([elia](https://github.com/elia))
20
+ - CircleCI test results [\#43](https://github.com/solidusio-contrib/solidus_static_content/pull/43) ([elia](https://github.com/elia))
21
+ - General cleanup and updates [\#42](https://github.com/solidusio-contrib/solidus_static_content/pull/42) ([elia](https://github.com/elia))
22
+ - Gem structure refresh [\#39](https://github.com/solidusio-contrib/solidus_static_content/pull/39) ([elia](https://github.com/elia))
23
+
24
+ **Fixed bugs:**
25
+
26
+ - Could not find table 'spree\_pages' [\#30](https://github.com/solidusio-contrib/solidus_static_content/issues/30)
27
+ - Meta tag added to pages are added as well as the store ones [\#13](https://github.com/solidusio-contrib/solidus_static_content/issues/13)
28
+ - Page not found if store isn't mounted at the root [\#12](https://github.com/solidusio-contrib/solidus_static_content/issues/12)
29
+ - Add html code in static\_content [\#7](https://github.com/solidusio-contrib/solidus_static_content/issues/7)
30
+ - Add support for Solidus mounted on subpaths [\#55](https://github.com/solidusio-contrib/solidus_static_content/pull/55) ([elia](https://github.com/elia))
31
+ - Fix meta tags [\#50](https://github.com/solidusio-contrib/solidus_static_content/pull/50) ([elia](https://github.com/elia))
32
+ - Update the engine name to match migrations [\#49](https://github.com/solidusio-contrib/solidus_static_content/pull/49) ([elia](https://github.com/elia))
33
+ - Avoid adding the menu item multiple times [\#47](https://github.com/solidusio-contrib/solidus_static_content/pull/47) ([elia](https://github.com/elia))
34
+ - Limit sprockets to v3 until it's fixed on Solidus [\#44](https://github.com/solidusio-contrib/solidus_static_content/pull/44) ([elia](https://github.com/elia))
35
+
36
+ **Closed issues:**
37
+
38
+ - Couldn't find Spree::Page [\#33](https://github.com/solidusio-contrib/solidus_static_content/issues/33)
39
+ - Spree::PagesHelper doesn't have `render\_snippet` method [\#25](https://github.com/solidusio-contrib/solidus_static_content/issues/25)
40
+ - admin menu item 'Pages' still appears after logout [\#9](https://github.com/solidusio-contrib/solidus_static_content/issues/9)
41
+ - Problem with solidus 2.1.0.beta1 and solidus\_static\_content [\#5](https://github.com/solidusio-contrib/solidus_static_content/issues/5)
42
+ - DB Migration not working [\#4](https://github.com/solidusio-contrib/solidus_static_content/issues/4)
43
+ - Migrations not running [\#3](https://github.com/solidusio-contrib/solidus_static_content/issues/3)
44
+
45
+ **Merged pull requests:**
46
+
47
+ - Update the readme with the solidus\_dev\_support template [\#71](https://github.com/solidusio-contrib/solidus_static_content/pull/71) ([aldesantis](https://github.com/aldesantis))
48
+ - Update extension template with solidus\_dev\_support [\#70](https://github.com/solidusio-contrib/solidus_static_content/pull/70) ([aldesantis](https://github.com/aldesantis))
49
+ - Adds Spree::PermissionSets for Pages [\#64](https://github.com/solidusio-contrib/solidus_static_content/pull/64) ([memotoro](https://github.com/memotoro))
50
+ - Relax solidus\_support dependency [\#63](https://github.com/solidusio-contrib/solidus_static_content/pull/63) ([kennyadsl](https://github.com/kennyadsl))
51
+ - Regenerate ext with solidus\_dev\_support [\#60](https://github.com/solidusio-contrib/solidus_static_content/pull/60) ([elia](https://github.com/elia))
52
+ - Fixes wrong labels, tabs and breadcrumbs [\#59](https://github.com/solidusio-contrib/solidus_static_content/pull/59) ([memotoro](https://github.com/memotoro))
53
+ - Replace Spree.t and I18n.t with the "t" helper [\#56](https://github.com/solidusio-contrib/solidus_static_content/pull/56) ([elia](https://github.com/elia))
54
+ - Update pg requirement from ~\> 0.21 to ~\> 1.1 [\#41](https://github.com/solidusio-contrib/solidus_static_content/pull/41) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
55
+ - Update factory\_bot requirement from ~\> 4.7 to ~\> 5.1 [\#37](https://github.com/solidusio-contrib/solidus_static_content/pull/37) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
56
+ - Update mysql2 requirement from ~\> 0.4.10 to ~\> 0.5.2 [\#36](https://github.com/solidusio-contrib/solidus_static_content/pull/36) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
57
+ - Relax sqlite gem dependency for Rails 6 compatibility [\#35](https://github.com/solidusio-contrib/solidus_static_content/pull/35) ([aldesantis](https://github.com/aldesantis))
58
+ - Patch store relationship saving [\#34](https://github.com/solidusio-contrib/solidus_static_content/pull/34) ([octoxan](https://github.com/octoxan))
59
+ - Switch from Travis to CircleCI [\#32](https://github.com/solidusio-contrib/solidus_static_content/pull/32) ([BravoSimone](https://github.com/BravoSimone))
60
+ - Update test files [\#28](https://github.com/solidusio-contrib/solidus_static_content/pull/28) ([jtapia](https://github.com/jtapia))
61
+ - Use dynamic attributes on factories [\#24](https://github.com/solidusio-contrib/solidus_static_content/pull/24) ([aitbw](https://github.com/aitbw))
62
+ - Extension maintenance [\#23](https://github.com/solidusio-contrib/solidus_static_content/pull/23) ([aitbw](https://github.com/aitbw))
63
+ - Fix specs [\#22](https://github.com/solidusio-contrib/solidus_static_content/pull/22) ([kennyadsl](https://github.com/kennyadsl))
64
+ - Remove versions past EOL from .travis.yml [\#19](https://github.com/solidusio-contrib/solidus_static_content/pull/19) ([jacobherrington](https://github.com/jacobherrington))
65
+ - Add Solidus 2.7 to .travis.yml [\#18](https://github.com/solidusio-contrib/solidus_static_content/pull/18) ([jacobherrington](https://github.com/jacobherrington))
66
+ - Relax Deface dependency [\#14](https://github.com/solidusio-contrib/solidus_static_content/pull/14) ([aldesantis](https://github.com/aldesantis))
67
+ - Fixes visibility hidden of Page menu before login [\#11](https://github.com/solidusio-contrib/solidus_static_content/pull/11) ([memotoro](https://github.com/memotoro))
68
+
69
+ ## [v1.0.0](https://github.com/solidusio-contrib/solidus_static_content/tree/v1.0.0) (2016-09-22)
70
+
71
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_static_content/compare/3ad3f010dcb5cb66d195abe0c6c9abdd05ccc76f...v1.0.0)
72
+
73
+ **Merged pull requests:**
74
+
75
+ - Support Solidus 2.0, test all versions [\#2](https://github.com/solidusio-contrib/solidus_static_content/pull/2) ([jhawthorn](https://github.com/jhawthorn))
76
+ - Solidus support [\#1](https://github.com/solidusio-contrib/solidus_static_content/pull/1) ([alexblackie](https://github.com/alexblackie))
77
+
78
+
79
+
80
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,13 +1,33 @@
1
- source 'https://rubygems.org/'
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
2
5
 
3
6
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
7
  gem 'solidus', github: 'solidusio/solidus', branch: branch
5
8
 
6
- if branch == 'master' || branch >= "v2.0"
7
- gem "rails-controller-testing", group: :test
8
- end
9
+ # Needed to help Bundler figure out how to resolve dependencies,
10
+ # otherwise it takes forever to resolve them.
11
+ # See https://github.com/bundler/bundler/issues/6677
12
+ gem 'rails', '>0.a'
9
13
 
10
- gem 'pg'
11
- gem 'mysql2'
14
+ # Provides basic authentication functionality for testing parts of your engine
15
+ gem 'solidus_auth_devise'
16
+
17
+ case ENV['DB']
18
+ when 'mysql'
19
+ gem 'mysql2'
20
+ when 'postgresql'
21
+ gem 'pg'
22
+ else
23
+ gem 'sqlite3'
24
+ end
12
25
 
13
26
  gemspec
27
+
28
+ # Use a local Gemfile to include development dependencies that might not be
29
+ # relevant for the project or for other contributors, e.g. pry-byebug.
30
+ #
31
+ # We use `send` instead of calling `eval_gemfile` to work around an issue with
32
+ # how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
33
+ send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
File without changes
data/README.md CHANGED
@@ -1,105 +1,118 @@
1
1
  # Solidus Static Content
2
2
 
3
- [![Build Status](https://travis-ci.org/solidusio-contrib/solidus_static_content.svg)](https://travis-ci.org/solidusio-contrib/solidus_static_content)
3
+ [![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_static_content.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_static_content)
4
4
 
5
- A fork of the [Spree extension][1] for compatibility with [Solidus][7].
5
+ A fork of the [Spree extension](https://github.com/spree-contrib/spree_static_content) for
6
+ compatibility with [Solidus](https://solidus.io).
6
7
 
7
- Good, clean content management of pages for Spree. You can use this to:
8
+ Good, clean content management of pages for Solidus. You can use it to:
8
9
 
9
- - Add and manage static pages such as an 'About' page.
10
- - Show a static page instead of existing dynamic pages such as the home page,
11
- products pages, and taxon pages.
10
+ - Add and manage static pages such as an About page.
11
+ - Show a static page instead of existing dynamic pages such as the home page, products pages, and
12
+ taxon pages.
12
13
 
13
- ## Basic Installation
14
+ ## Installation
14
15
 
15
- Add to your `Gemfile`:
16
+ Add solidus_static_content to your Gemfile:
16
17
 
17
18
  ```ruby
18
- gem 'solidus_static_content', github: 'solidusio-contrib/solidus_static_content'
19
+ gem 'solidus_static_content'
19
20
  ```
20
21
 
21
- Run:
22
+ Bundle your dependencies and run the installation generator:
22
23
 
24
+ ```shell
25
+ bundle
26
+ bundle exec rails g solidus_static_content:install
23
27
  ```
24
- $ bundle install
25
- $ bundle exec rails g solidus_static_content:install
26
- ```
27
28
 
28
- That's all!
29
+ ## Usage
30
+
31
+ Using the 'Pages' option in the admin tab, you can add static pages to your Solidus store. The page
32
+ content can be pulled directly from the database, be a separate layout file or be rendered as a
33
+ partial.
29
34
 
35
+ In the admin tab, use the 'New page' option to create a new static page.
30
36
 
31
- ## HowTo
37
+ The title, slug, body, and meta fields will replace their respective page elements on load. The
38
+ title, slug and body element are all required fields.
32
39
 
33
- Using the 'Pages' option in the admin tab, you can add static pages to your
34
- Spree install. The page content can be pulled directly from the database, be a
35
- separate layout file or rendered as a partial.
40
+ Body text provided without a layout/partial being specified will be loaded in the
41
+ `spree_application` layout after it is pulled from the database.
36
42
 
37
- In the admin tab, use the 'New page' option to create a new static page.
43
+ ### Layout and partial rendering
38
44
 
39
- The title, slug, body, and meta fields will replace their respective page
40
- elements on load. The title, slug and body element are all required fields.
45
+ To render an entire page without the `spree_application` layout, specify a relative path to the
46
+ layout file (e.g. `spree/layouts/layout_file_name`). Note that the name of this file will not be
47
+ prefixed with an underscore as it is a layout, not a partial.
41
48
 
42
- Body text provided without a layout / partial being specified will be loaded in
43
- the spree_application layout after it is pulled from the database.
49
+ To render a partial, specify the path in the layout file name and check the 'Render layout as
50
+ partial' option. The path specified in the layout area will not have an underscore, but it will be
51
+ required in the filename.
44
52
 
53
+ Also note the availability of the `render_snippet` helper which finds a page by its slug and renders
54
+ the raw page body anywhere in your view.
45
55
 
46
- ### Layout and Partial Rendering
56
+ ### Options
47
57
 
48
- To render an entire page without the spree_application layout, specify a
49
- relative path to the layout file (eg. `spree/layouts/layout_file_name`). This
50
- file will not be prefixed with an underscore as it is a layout, not a partial.
58
+ Use the 'Show in' checkboxes to specify whether to display the page links in the header, footer or
59
+ sidebar. The position setting alters the order in which they appear.
51
60
 
52
- To render a partial, specify the path in the layout file name and check the
53
- 'Render layout as partial' option. The path specified in the layout area will
54
- not have an underscore, but it will be required in the filename.
61
+ Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked, the page will not
62
+ be available.
55
63
 
56
- Also note the availability of the render_snippet helper which finds a page by
57
- its slug and renders the raw page body anywhere in your view.
64
+ ## Development
58
65
 
59
- ### Options
66
+ ### Testing the extension
67
+
68
+ First bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy
69
+ app if it does not exist, then it will run specs. The dummy app can be regenerated by using
70
+ `bin/rake extension:test_app`.
71
+
72
+ ```shell
73
+ bundle
74
+ bin/rake
75
+ ```
76
+
77
+ To run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run
78
+
79
+ ```shell
80
+ bundle exec rubocop
81
+ ```
60
82
 
61
- Use the 'Show in' checkboxes to specify whether to display the page links in the
62
- header, footer or sidebar. The position setting alters the order in which they
63
- appear.
83
+ When testing your application's integration with this extension you may use its factories.
84
+ Simply add this require statement to your spec_helper:
64
85
 
65
- Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked,
66
- the page will not be available.
86
+ ```ruby
87
+ require 'solidus_static_content/factories'
88
+ ```
67
89
 
90
+ ### Running the sandbox
68
91
 
69
- ## Contributing
92
+ To run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for
93
+ the sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands to
94
+ `sandbox/bin/rails`.
70
95
 
71
- In the spirit of [free software][2], **everyone** is encouraged to help improve
72
- this project.
96
+ Here's an example:
73
97
 
74
- Here are some ways *you* can contribute:
98
+ ```shell
99
+ $ bin/rails server
100
+ => Booting Puma
101
+ => Rails 6.0.2.1 application starting in development
102
+ * Listening on tcp://127.0.0.1:3000
103
+ Use Ctrl-C to stop
104
+ ```
75
105
 
76
- * by using prerelease versions
77
- * by reporting [bugs][3]
78
- * by suggesting new features
79
- * by writing translations
80
- * by writing or editing documentation
81
- * by writing specifications
82
- * by writing code (*no patch is too small*: fix typos, add comments, clean up inconsistent whitespace)
83
- * by refactoring code
84
- * by resolving [issues][3]
85
- * by reviewing patches
106
+ ### Releasing new versions
86
107
 
87
- Starting point:
108
+ Your new extension version can be released using `gem-release` like this:
88
109
 
89
- * Fork the repo
90
- * Clone your repo
91
- * Run `bundle install`
92
- * Run `bundle exec rake test_app` to create the test application in `spec/test_app`
93
- * Make your changes
94
- * Ensure specs pass by running `bundle exec rspec spec`
95
- * Submit your pull request
110
+ ```shell
111
+ bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release
112
+ ```
96
113
 
97
- Copyright (c) 2014 [Peter Berkenbosch][4] and [contributors][5], released under the [New BSD License][6]
114
+ ## License
98
115
 
99
- [1]: https://github.com/spree-contrib/spree_static_content/
100
- [2]: http://www.fsf.org/licensing/essays/free-sw.html
101
- [3]: https://github.com/solidusio-contrib/solidus_static_content/issues
102
- [4]: https://github.com/peterberkenbosch
103
- [5]: https://github.com/solidusio-contrib/solidus_static_content/graphs/contributors
104
- [6]: ./LICENSE.md
105
- [7]: https://solidus.io/
116
+ Copyright (c) 2014 [Peter Berkenbosch](https://github.com/peterberkenbosch) and
117
+ [contributors](https://github.com/solidusio-contrib/solidus_static_content/graphs/contributors),
118
+ released under the New BSD License.
data/Rakefile CHANGED
@@ -1,15 +1,6 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
1
+ # frozen_string_literal: true
3
2
 
4
- require 'rspec/core/rake_task'
5
- require 'spree/testing_support/common_rake'
3
+ require 'solidus_dev_support/rake_tasks'
4
+ SolidusDevSupport::RakeTasks.install
6
5
 
7
- RSpec::Core::RakeTask.new
8
-
9
- task :default => [:spec]
10
-
11
- desc "Generates a dummy app for testing"
12
- task :test_app do
13
- ENV['LIB_NAME'] = 'solidus_static_content'
14
- Rake::Task['common:test_app'].invoke
15
- end
6
+ task default: 'extension:specs'
@@ -0,0 +1,7 @@
1
+ /* Sidebar */
2
+ nav#pages .pages-root {
3
+ text-transform: uppercase;
4
+ border-bottom: 1px solid rgb(217, 217, 219);
5
+ margin-bottom: 5px;
6
+ font-size: 14px;
7
+ }
@@ -1,7 +1,2 @@
1
- /* Sidebar */
2
- nav#pages .pages-root {
3
- text-transform: uppercase;
4
- border-bottom: 1px solid rgb(217, 217, 219);
5
- margin-bottom: 5px;
6
- font-size: 14px;
7
- }
1
+ /* DEPRECATED: Delegate to the solidus namespaced file */
2
+ /* = require spree/frontend/solidus_static_content */
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusStaticContent
4
+ module PermissionSets
5
+ class PageDisplay < Spree::PermissionSets::Base
6
+ def activate!
7
+ can [:display, :admin], Spree::Page
8
+ end
9
+ end
10
+ end
11
+ end