solidus_static_content 1.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gem_release.yml +5 -0
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/lint.yml +29 -0
- data/.github/workflows/test.yml +25 -0
- data/.gitignore +18 -6
- data/.rspec +2 -3
- data/.standard.yml +6 -0
- data/CHANGELOG.md +110 -0
- data/Gemfile +48 -7
- data/Guardfile +9 -7
- data/README.md +94 -69
- data/Rakefile +4 -13
- data/app/assets/stylesheets/spree/frontend/solidus_static_content.css +7 -0
- data/app/assets/stylesheets/spree/frontend/spree_static_content.css +2 -7
- data/app/helpers/spree/pages_helper.rb +9 -5
- data/app/models/solidus_static_content/permission_sets/page_display.rb +21 -0
- data/app/models/solidus_static_content/permission_sets/page_management.rb +21 -0
- data/app/models/spree/page.rb +36 -37
- data/app/overrides/solidus_static_content/pages_in_footer.rb +11 -0
- data/app/overrides/solidus_static_content/pages_in_header.rb +11 -0
- data/app/overrides/solidus_static_content/pages_in_sidebar.rb +11 -0
- data/bin/console +17 -0
- data/bin/r +9 -0
- data/bin/rails +7 -6
- data/bin/rails-engine +15 -0
- data/bin/rails-sandbox +17 -0
- data/bin/rake +7 -0
- data/bin/sandbox +77 -0
- data/bin/sandbox_rails +9 -0
- data/bin/setup +8 -0
- data/config/locales/de.yml +7 -5
- data/config/locales/en.yml +7 -6
- data/config/locales/es-MX.yml +38 -0
- data/config/locales/es.yml +6 -5
- data/config/locales/et.yml +6 -5
- data/config/locales/fr.yml +7 -5
- data/config/locales/it.yml +6 -5
- data/config/locales/nl.yml +7 -5
- data/config/locales/pl.yml +6 -5
- data/config/locales/pt-BR.yml +6 -5
- data/config/locales/pt.yml +7 -5
- data/config/locales/ro.yml +11 -9
- data/config/locales/ru.yml +7 -5
- data/config/locales/sv.yml +7 -5
- data/config/routes.rb +13 -3
- data/db/migrate/20081216193152_create_pages.rb +3 -1
- data/db/migrate/20090625125735_extend_pages.rb +10 -9
- data/db/migrate/20090814113100_add_visible_to_pages.rb +6 -4
- data/db/migrate/20090814142845_add_default_true_to_visible_for_page.rb +5 -3
- data/db/migrate/20090829000527_add_index_for_page.rb +3 -2
- data/db/migrate/20091219021134_add_meta_fields_to_pages.rb +3 -1
- data/db/migrate/20100204105222_add_layout_to_pages.rb +4 -2
- data/db/migrate/20100323085528_add_show_in_sidebar_option_to_pages.rb +5 -3
- data/db/migrate/20110717103112_add_meta_title_to_page.rb +3 -1
- data/db/migrate/20120723144115_add_render_as_partial_for_layout_for_spree_pages.rb +9 -7
- data/db/migrate/20140926121757_add_pages_stores.rb +3 -3
- data/db/migrate/20180305193240_update_spree_page_position.rb +15 -0
- data/lib/controllers/backend/spree/admin/pages_controller.rb +22 -0
- data/lib/controllers/frontend/spree/static_content_controller.rb +32 -0
- data/lib/generators/solidus_static_content/install/install_generator.rb +35 -5
- data/lib/generators/solidus_static_content/install/templates/app/controllers/static_content_controller.rb +28 -0
- data/lib/generators/solidus_static_content/install/templates/app/views/static_content/show.html.erb +28 -0
- data/lib/solidus_static_content/engine.rb +43 -0
- data/lib/solidus_static_content/route_matcher.rb +15 -0
- data/lib/solidus_static_content/testing_support/factories.rb +18 -0
- data/lib/solidus_static_content/version.rb +5 -0
- data/lib/solidus_static_content.rb +5 -20
- data/lib/views/backend/spree/admin/pages/_form.html.erb +119 -0
- data/lib/views/backend/spree/admin/pages/edit.html.erb +32 -0
- data/lib/views/backend/spree/admin/pages/index.html.erb +68 -0
- data/lib/views/backend/spree/admin/pages/new.html.erb +31 -0
- data/lib/views/backend/spree/admin/shared/_pages_tabs.html.erb +9 -0
- data/{app/views → lib/views/frontend}/spree/static_content/_static_content_sidebar.html.erb +1 -1
- data/lib/views/frontend/spree/static_content/show.html.erb +18 -0
- data/solidus_static_content.gemspec +35 -31
- metadata +75 -184
- data/.travis.yml +0 -21
- data/app/assets/javascripts/spree/backend/spree_static_content.js +0 -1
- data/app/assets/javascripts/spree/frontend/spree_static_content.js +0 -1
- data/app/assets/stylesheets/spree/backend/spree_static_content.css +0 -3
- data/app/controllers/spree/admin/pages_controller.rb +0 -3
- data/app/controllers/spree/static_content_controller.rb +0 -20
- data/app/overrides/pages_in_footer.rb +0 -5
- data/app/overrides/pages_in_header.rb +0 -5
- data/app/overrides/pages_in_menu.rb +0 -5
- data/app/overrides/pages_in_sidebar.rb +0 -5
- data/app/views/spree/admin/pages/_form.html.erb +0 -98
- data/app/views/spree/admin/pages/edit.html.erb +0 -18
- data/app/views/spree/admin/pages/index.html.erb +0 -51
- data/app/views/spree/admin/pages/new.html.erb +0 -18
- data/app/views/spree/static_content/show.html.erb +0 -26
- data/lib/spree_static_content/engine.rb +0 -17
- data/spec/controllers/static_content_controller_spec.rb +0 -37
- data/spec/factories/page_factory.rb +0 -18
- data/spec/features/admin/pages_spec.rb +0 -67
- data/spec/features/static_content_spec.rb +0 -53
- data/spec/helpers/page_helper_spec.rb +0 -14
- data/spec/lib/spree_static.content_spec.rb +0 -34
- data/spec/models/page_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -50
- /data/{LICENSE.md → LICENSE} +0 -0
- /data/{app/views → lib/views/frontend}/spree/static_content/_static_content_footer.html.erb +0 -0
- /data/{app/views → lib/views/frontend}/spree/static_content/_static_content_header.html.erb +0 -0
- /data/{app/views → lib/views/frontend}/spree/static_content/_static_content_list.html.erb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 36a00320fd2554bbb2414bc64b45691610c1fdd6446e026e57d162553a39d47b
|
|
4
|
+
data.tar.gz: d2480b136fc1ecc8f64cf8eebd20e3e5b597966df697e102bda3c4aecbab6e0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33d3223b1fe7f2aebd01751af23414834c0dc02edf4d22a29a80fffc7b0043a9138abd3dca03149160abec35e3aaeebfd2e35732d1ea77dd0d348cbcfb8e6f15
|
|
7
|
+
data.tar.gz: f4fdf74889347f53dd93ac6d441bd813c36b97eb145f312c18afa460a1ab013a232766b895ed655e59fe1dfe8e7a015f0a512e09f8b97ee1f40e60d0389d7d28
|
data/.gem_release.yml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: lint-${{ github.ref_name }}
|
|
11
|
+
cancel-in-progress: ${{ github.ref_name != 'main' }}
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
standardrb:
|
|
18
|
+
name: StandardRB
|
|
19
|
+
runs-on: ubuntu-24.04
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- name: Set up Ruby
|
|
23
|
+
uses: ruby/setup-ruby@v1
|
|
24
|
+
with:
|
|
25
|
+
ruby-version: "3.4"
|
|
26
|
+
bundler-cache: true
|
|
27
|
+
rubygems: latest
|
|
28
|
+
- name: Run StandardRB
|
|
29
|
+
run: bundle exec standardrb
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "0 0 * * 4" # every Thursday
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: test-${{ github.ref_name }}
|
|
13
|
+
cancel-in-progress: ${{ github.ref_name != 'main' }}
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
rspec:
|
|
20
|
+
uses: solidusio/test-solidus-extension/.github/workflows/test.yml@main
|
|
21
|
+
with:
|
|
22
|
+
ruby_versions: '["3.4"]'
|
|
23
|
+
rails_versions: '["8.0", "7.2"]'
|
|
24
|
+
solidus_branches: '["v4.7"]'
|
|
25
|
+
databases: '["postgresql", "sqlite"]'
|
data/.gitignore
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
\#*
|
|
3
|
+
*~
|
|
4
|
+
.#*
|
|
1
5
|
.DS_Store
|
|
2
|
-
|
|
3
|
-
|
|
6
|
+
.idea
|
|
7
|
+
.project
|
|
8
|
+
.sass-cache
|
|
9
|
+
coverage
|
|
4
10
|
Gemfile.lock
|
|
5
|
-
spec/dummy/
|
|
6
|
-
.rvmrc
|
|
7
11
|
tmp
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
nbproject
|
|
13
|
+
pkg
|
|
14
|
+
*.swp
|
|
15
|
+
spec/dummy
|
|
16
|
+
spec/examples.txt
|
|
17
|
+
/sandbox
|
|
18
|
+
.rvmrc
|
|
19
|
+
.ruby-version
|
|
20
|
+
.ruby-gemset
|
|
21
|
+
vendor
|
data/.rspec
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
--
|
|
2
|
-
--
|
|
3
|
-
progress
|
|
1
|
+
--color
|
|
2
|
+
--require spec_helper
|
data/.standard.yml
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [v2.1.0](https://github.com/solidusio-contrib/solidus_static_content/tree/v2.1.0) (2026-08-25)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/solidusio-contrib/solidus_static_content/compare/v2.0.0...v2.1.0)
|
|
6
|
+
|
|
7
|
+
**Closed issues:**
|
|
8
|
+
|
|
9
|
+
- Not compatible with Solidus 4 [\#87](https://github.com/solidusio-contrib/solidus_static_content/issues/87)
|
|
10
|
+
- Not compatible with Ruby 3.1.2 [\#85](https://github.com/solidusio-contrib/solidus_static_content/issues/85)
|
|
11
|
+
- Support for Ruby 3.0 [\#83](https://github.com/solidusio-contrib/solidus_static_content/issues/83)
|
|
12
|
+
- Dependabot can't resolve your Ruby dependency files [\#78](https://github.com/solidusio-contrib/solidus_static_content/issues/78)
|
|
13
|
+
- Prepare Solidus Static Content for Solidus 3.0 [\#75](https://github.com/solidusio-contrib/solidus_static_content/issues/75)
|
|
14
|
+
- Dependabot can't resolve your Ruby dependency files [\#74](https://github.com/solidusio-contrib/solidus_static_content/issues/74)
|
|
15
|
+
- Dependabot can't resolve your Ruby dependency files [\#73](https://github.com/solidusio-contrib/solidus_static_content/issues/73)
|
|
16
|
+
- wrong translation key [\#72](https://github.com/solidusio-contrib/solidus_static_content/issues/72)
|
|
17
|
+
- Version conflict on newest version \(deface compatibility\) [\#65](https://github.com/solidusio-contrib/solidus_static_content/issues/65)
|
|
18
|
+
|
|
19
|
+
**Merged pull requests:**
|
|
20
|
+
|
|
21
|
+
- Add privilege and category method to permission sets [\#93](https://github.com/solidusio-contrib/solidus_static_content/pull/93) ([sascha-karnatz](https://github.com/sascha-karnatz))
|
|
22
|
+
- Move to Standardrb [\#92](https://github.com/solidusio-contrib/solidus_static_content/pull/92) ([sascha-karnatz](https://github.com/sascha-karnatz))
|
|
23
|
+
- Run tests on GitHub [\#91](https://github.com/solidusio-contrib/solidus_static_content/pull/91) ([sascha-karnatz](https://github.com/sascha-karnatz))
|
|
24
|
+
- Add updated Menu Item for Solidus 4.2 [\#89](https://github.com/solidusio-contrib/solidus_static_content/pull/89) ([sascha-karnatz](https://github.com/sascha-karnatz))
|
|
25
|
+
- Restore solidus\_static\_content on Solidus 4.0 [\#88](https://github.com/solidusio-contrib/solidus_static_content/pull/88) ([JustShah](https://github.com/JustShah))
|
|
26
|
+
- Update to use forked solidus\_frontend when needed [\#84](https://github.com/solidusio-contrib/solidus_static_content/pull/84) ([waiting-for-dev](https://github.com/waiting-for-dev))
|
|
27
|
+
- English Translation Key Fix [\#82](https://github.com/solidusio-contrib/solidus_static_content/pull/82) ([QuintinAdam](https://github.com/QuintinAdam))
|
|
28
|
+
- Updates Gemspec to allow Ruby 3 [\#81](https://github.com/solidusio-contrib/solidus_static_content/pull/81) ([QuintinAdam](https://github.com/QuintinAdam))
|
|
29
|
+
- Upgrade to GitHub-native Dependabot [\#80](https://github.com/solidusio-contrib/solidus_static_content/pull/80) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
|
30
|
+
- Solidus version update to v3.0.0 [\#79](https://github.com/solidusio-contrib/solidus_static_content/pull/79) ([webhive](https://github.com/webhive))
|
|
31
|
+
- Scroll Update button into view before clicking [\#76](https://github.com/solidusio-contrib/solidus_static_content/pull/76) ([jarednorman](https://github.com/jarednorman))
|
|
32
|
+
|
|
33
|
+
## [v2.0.0](https://github.com/solidusio-contrib/solidus_static_content/tree/v2.0.0) (2020-06-05)
|
|
34
|
+
|
|
35
|
+
[Full Changelog](https://github.com/solidusio-contrib/solidus_static_content/compare/v1.0.0...v2.0.0)
|
|
36
|
+
|
|
37
|
+
**Breaking changes:**
|
|
38
|
+
|
|
39
|
+
- Rename SpreeStaticContent to SolidusStaticContent [\#67](https://github.com/solidusio-contrib/solidus_static_content/pull/67) ([aldesantis](https://github.com/aldesantis))
|
|
40
|
+
- Remove deprecated constants [\#66](https://github.com/solidusio-contrib/solidus_static_content/pull/66) ([aldesantis](https://github.com/aldesantis))
|
|
41
|
+
|
|
42
|
+
**Implemented enhancements:**
|
|
43
|
+
|
|
44
|
+
- Remove the `I18n` namespace from views [\#54](https://github.com/solidusio-contrib/solidus_static_content/issues/54)
|
|
45
|
+
- Drag & drop ordering + general views updates [\#53](https://github.com/solidusio-contrib/solidus_static_content/pull/53) ([elia](https://github.com/elia))
|
|
46
|
+
- Use the same sidebar logic that Solidus uses [\#52](https://github.com/solidusio-contrib/solidus_static_content/pull/52) ([elia](https://github.com/elia))
|
|
47
|
+
- 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))
|
|
48
|
+
- 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))
|
|
49
|
+
- 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))
|
|
50
|
+
- CircleCI test results [\#43](https://github.com/solidusio-contrib/solidus_static_content/pull/43) ([elia](https://github.com/elia))
|
|
51
|
+
- General cleanup and updates [\#42](https://github.com/solidusio-contrib/solidus_static_content/pull/42) ([elia](https://github.com/elia))
|
|
52
|
+
- Gem structure refresh [\#39](https://github.com/solidusio-contrib/solidus_static_content/pull/39) ([elia](https://github.com/elia))
|
|
53
|
+
|
|
54
|
+
**Fixed bugs:**
|
|
55
|
+
|
|
56
|
+
- Could not find table 'spree\_pages' [\#30](https://github.com/solidusio-contrib/solidus_static_content/issues/30)
|
|
57
|
+
- Meta tag added to pages are added as well as the store ones [\#13](https://github.com/solidusio-contrib/solidus_static_content/issues/13)
|
|
58
|
+
- Page not found if store isn't mounted at the root [\#12](https://github.com/solidusio-contrib/solidus_static_content/issues/12)
|
|
59
|
+
- Add html code in static\_content [\#7](https://github.com/solidusio-contrib/solidus_static_content/issues/7)
|
|
60
|
+
- Add support for Solidus mounted on subpaths [\#55](https://github.com/solidusio-contrib/solidus_static_content/pull/55) ([elia](https://github.com/elia))
|
|
61
|
+
- Fix meta tags [\#50](https://github.com/solidusio-contrib/solidus_static_content/pull/50) ([elia](https://github.com/elia))
|
|
62
|
+
- Update the engine name to match migrations [\#49](https://github.com/solidusio-contrib/solidus_static_content/pull/49) ([elia](https://github.com/elia))
|
|
63
|
+
- Avoid adding the menu item multiple times [\#47](https://github.com/solidusio-contrib/solidus_static_content/pull/47) ([elia](https://github.com/elia))
|
|
64
|
+
- 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))
|
|
65
|
+
|
|
66
|
+
**Closed issues:**
|
|
67
|
+
|
|
68
|
+
- Couldn't find Spree::Page [\#33](https://github.com/solidusio-contrib/solidus_static_content/issues/33)
|
|
69
|
+
- Spree::PagesHelper doesn't have `render_snippet` method [\#25](https://github.com/solidusio-contrib/solidus_static_content/issues/25)
|
|
70
|
+
- admin menu item 'Pages' still appears after logout [\#9](https://github.com/solidusio-contrib/solidus_static_content/issues/9)
|
|
71
|
+
- Problem with solidus 2.1.0.beta1 and solidus\_static\_content [\#5](https://github.com/solidusio-contrib/solidus_static_content/issues/5)
|
|
72
|
+
- DB Migration not working [\#4](https://github.com/solidusio-contrib/solidus_static_content/issues/4)
|
|
73
|
+
- Migrations not running [\#3](https://github.com/solidusio-contrib/solidus_static_content/issues/3)
|
|
74
|
+
|
|
75
|
+
**Merged pull requests:**
|
|
76
|
+
|
|
77
|
+
- 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))
|
|
78
|
+
- Update extension template with solidus\_dev\_support [\#70](https://github.com/solidusio-contrib/solidus_static_content/pull/70) ([aldesantis](https://github.com/aldesantis))
|
|
79
|
+
- Adds Spree::PermissionSets for Pages [\#64](https://github.com/solidusio-contrib/solidus_static_content/pull/64) ([memotoro](https://github.com/memotoro))
|
|
80
|
+
- Relax solidus\_support dependency [\#63](https://github.com/solidusio-contrib/solidus_static_content/pull/63) ([kennyadsl](https://github.com/kennyadsl))
|
|
81
|
+
- Regenerate ext with solidus\_dev\_support [\#60](https://github.com/solidusio-contrib/solidus_static_content/pull/60) ([elia](https://github.com/elia))
|
|
82
|
+
- Fixes wrong labels, tabs and breadcrumbs [\#59](https://github.com/solidusio-contrib/solidus_static_content/pull/59) ([memotoro](https://github.com/memotoro))
|
|
83
|
+
- 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))
|
|
84
|
+
- 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))
|
|
85
|
+
- 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))
|
|
86
|
+
- 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))
|
|
87
|
+
- Relax sqlite gem dependency for Rails 6 compatibility [\#35](https://github.com/solidusio-contrib/solidus_static_content/pull/35) ([aldesantis](https://github.com/aldesantis))
|
|
88
|
+
- Patch store relationship saving [\#34](https://github.com/solidusio-contrib/solidus_static_content/pull/34) ([octoxan](https://github.com/octoxan))
|
|
89
|
+
- Switch from Travis to CircleCI [\#32](https://github.com/solidusio-contrib/solidus_static_content/pull/32) ([BravoSimone](https://github.com/BravoSimone))
|
|
90
|
+
- Update test files [\#28](https://github.com/solidusio-contrib/solidus_static_content/pull/28) ([jtapia](https://github.com/jtapia))
|
|
91
|
+
- Use dynamic attributes on factories [\#24](https://github.com/solidusio-contrib/solidus_static_content/pull/24) ([aitbw](https://github.com/aitbw))
|
|
92
|
+
- Extension maintenance [\#23](https://github.com/solidusio-contrib/solidus_static_content/pull/23) ([aitbw](https://github.com/aitbw))
|
|
93
|
+
- Fix specs [\#22](https://github.com/solidusio-contrib/solidus_static_content/pull/22) ([kennyadsl](https://github.com/kennyadsl))
|
|
94
|
+
- Remove versions past EOL from .travis.yml [\#19](https://github.com/solidusio-contrib/solidus_static_content/pull/19) ([jacobherrington](https://github.com/jacobherrington))
|
|
95
|
+
- Add Solidus 2.7 to .travis.yml [\#18](https://github.com/solidusio-contrib/solidus_static_content/pull/18) ([jacobherrington](https://github.com/jacobherrington))
|
|
96
|
+
- Relax Deface dependency [\#14](https://github.com/solidusio-contrib/solidus_static_content/pull/14) ([aldesantis](https://github.com/aldesantis))
|
|
97
|
+
- Fixes visibility hidden of Page menu before login [\#11](https://github.com/solidusio-contrib/solidus_static_content/pull/11) ([memotoro](https://github.com/memotoro))
|
|
98
|
+
|
|
99
|
+
## [v1.0.0](https://github.com/solidusio-contrib/solidus_static_content/tree/v1.0.0) (2016-09-22)
|
|
100
|
+
|
|
101
|
+
[Full Changelog](https://github.com/solidusio-contrib/solidus_static_content/compare/3ad3f010dcb5cb66d195abe0c6c9abdd05ccc76f...v1.0.0)
|
|
102
|
+
|
|
103
|
+
**Merged pull requests:**
|
|
104
|
+
|
|
105
|
+
- Support Solidus 2.0, test all versions [\#2](https://github.com/solidusio-contrib/solidus_static_content/pull/2) ([jhawthorn](https://github.com/jhawthorn))
|
|
106
|
+
- Solidus support [\#1](https://github.com/solidusio-contrib/solidus_static_content/pull/1) ([alexblackie](https://github.com/alexblackie))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
CHANGED
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
branch = ENV.fetch("SOLIDUS_BRANCH", "main")
|
|
7
|
+
gem "solidus", github: "solidusio/solidus", branch: branch
|
|
8
|
+
|
|
9
|
+
# The solidus_frontend gem has been pulled out since v3.2
|
|
10
|
+
if branch >= "v3.2"
|
|
11
|
+
gem "solidus_frontend"
|
|
12
|
+
elsif branch == "main"
|
|
13
|
+
gem "solidus_frontend", github: "solidusio/solidus_frontend"
|
|
14
|
+
else
|
|
15
|
+
gem "solidus_frontend", github: "solidusio/solidus", branch: branch
|
|
8
16
|
end
|
|
9
17
|
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
rails_version = ENV.fetch("RAILS_VERSION", "~> 7.0")
|
|
19
|
+
# CI passes bare versions such as "8.0", which Bundler reads as an exact
|
|
20
|
+
# requirement that no released gem satisfies. Treat them as pessimistic instead.
|
|
21
|
+
rails_version = "~> #{rails_version}.0" if rails_version.match?(/\A\d+\.\d+\z/)
|
|
22
|
+
gem "rails", rails_version
|
|
23
|
+
|
|
24
|
+
# Extract the minimum Rails version from the version requirement.
|
|
25
|
+
# For example, both "~> 7.0" and ">= 7.0" translate to a minimum of "7.0".
|
|
26
|
+
rails_req = Gem::Requirement.new(rails_version)
|
|
27
|
+
min_rails_version = rails_req.requirements.map(&:last).min || Gem::Version.new("0")
|
|
28
|
+
|
|
29
|
+
# Determine the sqlite3 version based on the minimum Rails version.
|
|
30
|
+
# If the minimum Rails version is less than 7.2, use "~> 1.4"; otherwise, use "~> 2.0".
|
|
31
|
+
sqlite_version =
|
|
32
|
+
if min_rails_version < Gem::Version.new("7.2")
|
|
33
|
+
"~> 1.4"
|
|
34
|
+
else
|
|
35
|
+
"~> 2.0"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
case ENV.fetch("DB", nil)
|
|
39
|
+
when "mysql"
|
|
40
|
+
gem "mysql2"
|
|
41
|
+
when "postgresql"
|
|
42
|
+
gem "pg"
|
|
43
|
+
else
|
|
44
|
+
gem "sqlite3", sqlite_version
|
|
45
|
+
end
|
|
12
46
|
|
|
13
47
|
gemspec
|
|
48
|
+
|
|
49
|
+
# Use a local Gemfile to include development dependencies that might not be
|
|
50
|
+
# relevant for the project or for other contributors, e.g. pry-byebug.
|
|
51
|
+
#
|
|
52
|
+
# We use `send` instead of calling `eval_gemfile` to work around an issue with
|
|
53
|
+
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
|
|
54
|
+
send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local"
|
data/Guardfile
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
guard "rspec", cmd: "bundle exec rspec" do
|
|
2
|
-
watch("spec/spec_helper.rb")
|
|
3
|
-
watch("config/routes.rb")
|
|
4
|
-
watch("app/controllers/application_controller.rb")
|
|
5
|
-
watch(%r{^spec/(.+)_spec\.rb$})
|
|
6
|
-
watch(%r{^app/(.+)_decorator\.rb$})
|
|
7
|
-
watch(%r{^(app|lib)/(.+)(\.rb|\.erb)$})
|
|
8
|
-
watch(%r{^app/controllers/(.+)_(controller)\.rb$})
|
|
4
|
+
watch("spec/spec_helper.rb") { "spec" }
|
|
5
|
+
watch("config/routes.rb") { "spec/controllers" }
|
|
6
|
+
watch("app/controllers/application_controller.rb") { "spec/controllers" }
|
|
7
|
+
watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
8
|
+
watch(%r{^app/(.+)_decorator\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
9
|
+
watch(%r{^(app|lib)/(.+)(\.rb|\.erb)$}) { |m| "spec/#{m[2]}_spec.rb" }
|
|
10
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb" }
|
|
9
11
|
end
|
data/README.md
CHANGED
|
@@ -1,105 +1,130 @@
|
|
|
1
1
|
# Solidus Static Content
|
|
2
2
|
|
|
3
|
-
[](https://github.com/solidusio-contrib/solidus_static_content/actions/workflows/test.yml)
|
|
4
4
|
|
|
5
|
-
A fork of the [Spree extension]
|
|
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
|
|
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
|
|
10
|
-
- Show a static page instead of existing dynamic pages such as the home page,
|
|
11
|
-
|
|
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
|
-
##
|
|
14
|
+
## Installation
|
|
14
15
|
|
|
15
|
-
Add to your
|
|
16
|
+
Add solidus_static_content to your Gemfile:
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
gem 'solidus_static_content', github: 'solidusio-contrib/solidus_static_content'
|
|
19
|
-
```
|
|
18
|
+
### Starter Frontend
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Bundle your dependencies and run the installation generator:
|
|
22
21
|
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
```shell
|
|
23
|
+
bundle
|
|
24
|
+
bin/rails generate solidus_static_content:install --frontend=starter
|
|
26
25
|
```
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Please, be aware that the installation only works with the default
|
|
28
|
+
implementation of the starter frontend. Any customization to the files that
|
|
29
|
+
will be modified by the installer might break the installation procedure.
|
|
30
|
+
If that happens, try to adapt the installed code on top of the customizations
|
|
31
|
+
of the store.
|
|
29
32
|
|
|
33
|
+
### Legacy Frontend
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
If you are using the legacy `solidus_frontend` gem, please run this command instead:
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
```shell
|
|
38
|
+
bin/rails generate solidus_static_content:install
|
|
39
|
+
```
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
## Usage
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
Using the 'Pages' option in the admin tab, you can add static pages to your Solidus store. The page
|
|
44
|
+
content can be pulled directly from the database, be a separate layout file or be rendered as a
|
|
45
|
+
partial.
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
the spree_application layout after it is pulled from the database.
|
|
47
|
+
In the admin tab, use the 'New page' option to create a new static page.
|
|
44
48
|
|
|
49
|
+
The title, slug, body, and meta fields will replace their respective page elements on load. The
|
|
50
|
+
title, slug and body element are all required fields.
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
Body text provided without a layout/partial being specified will be loaded in the
|
|
53
|
+
`spree_application` layout after it is pulled from the database.
|
|
47
54
|
|
|
48
|
-
|
|
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.
|
|
55
|
+
### Layout and partial rendering
|
|
51
56
|
|
|
52
|
-
To render
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
To render an entire page without the `spree_application` layout, specify a relative path to the
|
|
58
|
+
layout file (e.g. `spree/layouts/layout_file_name`). Note that the name of this file will not be
|
|
59
|
+
prefixed with an underscore as it is a layout, not a partial.
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
To render a partial, specify the path in the layout file name and check the 'Render layout as
|
|
62
|
+
partial' option. The path specified in the layout area will not have an underscore, but it will be
|
|
63
|
+
required in the filename.
|
|
64
|
+
|
|
65
|
+
Also note the availability of the `render_snippet` helper which finds a page by its slug and renders
|
|
66
|
+
the raw page body anywhere in your view.
|
|
58
67
|
|
|
59
68
|
### Options
|
|
60
69
|
|
|
61
|
-
Use the 'Show in' checkboxes to specify whether to display the page links in the
|
|
62
|
-
|
|
63
|
-
appear.
|
|
70
|
+
Use the 'Show in' checkboxes to specify whether to display the page links in the header, footer or
|
|
71
|
+
sidebar. The position setting alters the order in which they appear.
|
|
64
72
|
|
|
65
|
-
Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked,
|
|
66
|
-
|
|
73
|
+
Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked, the page will not
|
|
74
|
+
be available.
|
|
67
75
|
|
|
76
|
+
## Development
|
|
68
77
|
|
|
69
|
-
|
|
78
|
+
### Testing the extension
|
|
70
79
|
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
First bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy
|
|
81
|
+
app if it does not exist, then it will run specs. The dummy app can be regenerated by using
|
|
82
|
+
`bin/rake extension:test_app`.
|
|
73
83
|
|
|
74
|
-
|
|
84
|
+
```shell
|
|
85
|
+
bundle
|
|
86
|
+
bin/rake
|
|
87
|
+
```
|
|
75
88
|
|
|
76
|
-
|
|
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
|
|
89
|
+
To run [Standard](https://github.com/standardrb/standard) static code analysis run
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
```shell
|
|
92
|
+
bundle exec standardrb
|
|
93
|
+
```
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
When testing your application's integration with this extension you may use its factories.
|
|
96
|
+
Simply add this require statement to your spec_helper:
|
|
97
|
+
|
|
98
|
+
```ruby
|
|
99
|
+
require 'solidus_static_content/testing_support/factories'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Running the sandbox
|
|
103
|
+
|
|
104
|
+
To run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for
|
|
105
|
+
the sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands to
|
|
106
|
+
`sandbox/bin/rails`.
|
|
107
|
+
|
|
108
|
+
Here's an example:
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
$ bin/rails server
|
|
112
|
+
=> Booting Puma
|
|
113
|
+
=> Rails 6.0.2.1 application starting in development
|
|
114
|
+
* Listening on tcp://127.0.0.1:3000
|
|
115
|
+
Use Ctrl-C to stop
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Releasing new versions
|
|
119
|
+
|
|
120
|
+
Your new extension version can be released using `gem-release` like this:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release
|
|
124
|
+
```
|
|
96
125
|
|
|
97
|
-
|
|
126
|
+
## License
|
|
98
127
|
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
|
|
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/
|
|
128
|
+
Copyright (c) 2014 [Peter Berkenbosch](https://github.com/peterberkenbosch) and
|
|
129
|
+
[contributors](https://github.com/solidusio-contrib/solidus_static_content/graphs/contributors),
|
|
130
|
+
released under the New BSD License.
|
data/Rakefile
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Bundler::GemHelper.install_tasks
|
|
1
|
+
# frozen_string_literal: true
|
|
3
2
|
|
|
4
|
-
require
|
|
5
|
-
|
|
3
|
+
require "solidus_dev_support/rake_tasks"
|
|
4
|
+
SolidusDevSupport::RakeTasks.install
|
|
6
5
|
|
|
7
|
-
|
|
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"
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
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 */
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Spree
|
|
4
|
+
module PagesHelper
|
|
5
|
+
def render_snippet(slug)
|
|
6
|
+
page = Spree::Page.find_by(slug: slug)
|
|
7
|
+
raw page.body if page
|
|
8
|
+
end
|
|
5
9
|
end
|
|
6
|
-
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SolidusStaticContent
|
|
4
|
+
module PermissionSets
|
|
5
|
+
class PageDisplay < Spree::PermissionSets::Base
|
|
6
|
+
class << self
|
|
7
|
+
def privilege
|
|
8
|
+
:display
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def category
|
|
12
|
+
:page
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def activate!
|
|
17
|
+
can [:display, :admin], Spree::Page
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SolidusStaticContent
|
|
4
|
+
module PermissionSets
|
|
5
|
+
class PageManagement < Spree::PermissionSets::Base
|
|
6
|
+
class << self
|
|
7
|
+
def privilege
|
|
8
|
+
:management
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def category
|
|
12
|
+
:page
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def activate!
|
|
17
|
+
can :manage, Spree::Page
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|