This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
forked from pero-ict-solutions/spree-static-content
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix so specs pass. - Add more specs now 95%+ - Fix all locales and removed duplicate sub locales (tested with i18n_spec). - Add Swedish locale. - Moved generator.rb to sub "install” dir because it didn’t init. - Fix assets paths. - Admin pages tab moved to Configuration due to it made top menu items collapse, new layout same style as products for consistency. - Fixed hooks etc to correspond to Spree 2.1+ way.
- Loading branch information
Showing
56 changed files
with
841 additions
and
662 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ nbproject | |
**.gem | ||
Gemfile.lock | ||
spec/dummy/ | ||
.rvmrc | ||
tmp | ||
coverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
guard "rspec", cmd: "bundle exec rspec" do | ||
watch("spec/spec_helper.rb") { "spec" } | ||
watch("config/routes.rb") { "spec/controllers" } | ||
watch("app/controllers/application_controller.rb") { "spec/controllers" } | ||
watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb"} | ||
watch(%r{^app/(.+)_decorator\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^(app|lib)/(.+)(\.rb|\.erb)$}) { |m| "spec/#{m[2]}_spec.rb" } | ||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (c) 2014 Peter Berkenbosch and contributors. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name Spree nor the names of its contributors may be used to | ||
endorse or promote products derived from this software without specific | ||
prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,93 @@ | ||
# Spree Static Content | ||
|
||
[![Build Status](https://secure.travis-ci.org/spree/spree_static_content.png?branch=master)](http://travis-ci.org/spree/spree_static_content) | ||
[![Build Status](https://api.travis-ci.org/spree/spree_static_content.png?branch=master)](https://travis-ci.org/spree/spree_static_content) | ||
|
||
Good, clean content management of pages for Spree. You can use this to: | ||
|
||
- Add and manage static pages such as an 'About' page. | ||
- Show a static page instead of existing dynamic pages such as the home page, | ||
products pages, and taxon pages. | ||
|
||
## HowTo | ||
|
||
Using the 'Pages' option in the admin tab, you can add static pages to your Spree install. The page content can | ||
be pulled directly from the database, be a separate layout file or rendered as a partial. | ||
|
||
In the admin tab, use the 'New page' option to create a new static page. | ||
|
||
The title, slug, body, and meta fields will replace their respective page elements on load. The title, slug and | ||
The title, slug, body, and meta fields will replace their respective page elements on load. The title, slug and | ||
body element are all required fields. | ||
|
||
Body text provided without a layout / partial being specified will be loaded in the spree_application layout after | ||
it is pulled from the database. | ||
|
||
**Layout and Partial Rendering** | ||
|
||
To render an entire page without the spree_application layout, specify a relative path to the layout file (eg. | ||
spree/layouts/layout_file_name). This file will not be prefixed with an underscore as it is a layout, not a partial. | ||
To render an entire page without the spree_application layout, specify a relative path to the layout file (eg. | ||
`spree/layouts/layout_file_name`). This file will not be prefixed with an underscore as it is a layout, not a partial. | ||
|
||
To render a partial, specify the path in the layout file name and check the 'Render layout as partial' option. The | ||
path specified in the layout area will not have an underscore, but it will be required in the filename. | ||
|
||
Also note the availability of the render_snippet helper which finds a page by its slug and renders the raw page | ||
Also note the availability of the render_snippet helper which finds a page by its slug and renders the raw page | ||
body anywhere in your view. | ||
|
||
**Options** | ||
|
||
Use the 'Show in' checkboxes to specify whether to display the page links in the header, footer or sidebar. The | ||
Use the 'Show in' checkboxes to specify whether to display the page links in the header, footer or sidebar. The | ||
position setting alters the order in which they appear. | ||
|
||
Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked, the page will not be available. | ||
|
||
## Basic Installation | ||
|
||
**For Spree HEAD** | ||
|
||
1. Add the following to your Gemfile | ||
|
||
``` | ||
gem 'spree_static_content', :github => 'spree/spree_static_content' | ||
``` | ||
|
||
2. Run `bundle install` | ||
3. To copy and apply migrations run: `rails g spree_static_content:install` | ||
Add to your `Gemfile`: | ||
|
||
**For Spree 1.3.x** | ||
|
||
1. Add the following to your Gemfile | ||
|
||
``` | ||
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-3-stable' | ||
```ruby | ||
gem 'spree_static_content', github: 'spree/spree_static_content', branch: 'master' | ||
``` | ||
|
||
2. Run `bundle install` | ||
3. To copy and apply migrations run: `rails g spree_static_content:install` | ||
Run: | ||
|
||
bundle install | ||
rails g spree_static_content:install | ||
|
||
**For Spree 1.2.x** | ||
That's all! | ||
|
||
1. Add the following to your Gemfile | ||
|
||
``` | ||
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-2-stable' | ||
``` | ||
**NOTE: Check [Versionfile][1] for corresponding gem `branch` for your Spree version.** | ||
|
||
2. Run `bundle install` | ||
3. To copy and apply migrations run: `rails g spree_static_content:install` | ||
## Contributing | ||
|
||
In the spirit of [free software][2], **everyone** is encouraged to help improve this project. | ||
|
||
**For Spree 1.1.x** | ||
|
||
1. Add the following to your Gemfile | ||
|
||
``` | ||
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-1-stable' | ||
``` | ||
|
||
2. Run `bundle install` | ||
3. To copy and apply migrations run: `rails g spree_static_content:install` | ||
|
||
**For Spree 1.0.x** | ||
|
||
1. Add the following to your Gemfile | ||
|
||
``` | ||
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-0-stable' | ||
``` | ||
|
||
2. Run `bundle install` | ||
3. To copy and apply migrations run: `rails g spree_static_content:install` | ||
Here are some ways *you* can contribute: | ||
|
||
## Development | ||
* by using prerelease versions | ||
* by reporting [bugs][3] | ||
* by suggesting new features | ||
* by writing translations | ||
* by writing or editing documentation | ||
* by writing specifications | ||
* by writing code (*no patch is too small*: fix typos, add comments, clean up inconsistent whitespace) | ||
* by refactoring code | ||
* by resolving [issues][3] | ||
* by reviewing patches | ||
|
||
1. fork the repo here: https://github.com/spree/spree_static_content | ||
2. inside your fork run `bundle install` | ||
3. make sure the tests can run on your system run : `bundle exec rake test_app && bundle exec rspec spec` | ||
Starting point: | ||
|
||
You can also run `bundle exec rake test_app` and then to run the specs run `bundle exec rake` | ||
* Fork the repo | ||
* Clone your repo | ||
* Run `bundle install` | ||
* Run `bundle exec rake test_app` to create the test application in `spec/test_app` | ||
* Make your changes | ||
* Ensure specs pass by running `bundle exec rspec spec` | ||
* Submit your pull request | ||
|
||
### Fix bugs or add functionality | ||
Copyright (c) 2014 [Peter Berkenbosch][4] and [contributors][5], released under the [New BSD License][6] | ||
|
||
1. create a feature branch | ||
<pre> | ||
git checkout -b my-feature-branch | ||
</pre> | ||
2. Apply your changes and add specs. | ||
3. Push the feature branch to your fork: | ||
<pre> | ||
git push -u origin my-feature-branch | ||
</pre> | ||
4. Send a pull request from your feature branch in the forked repository on github. | ||
[1]: https://github.com/spree/spree_static_content/blob/master/Versionfile | ||
[2]: http://www.fsf.org/licensing/essays/free-sw.html | ||
[3]: https://github.com/spree/spree_static_content/issues | ||
[4]: https://github.com/peterberkenbosch | ||
[5]: https://github.com/spree/spree_static_content/graphs/contributors | ||
[6]: https://github.com/spree/spree_static_content/blob/master/LICENSE.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//= require spree/backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//= require spree/frontend |
Empty file.
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
app/assets/stylesheets/spree/backend/spree_static_content.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* | ||
*= require spree/backend | ||
*/ |
11 changes: 11 additions & 0 deletions
11
app/assets/stylesheets/spree/frontend/spree_static_content.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
*= require spree/frontend | ||
*/ | ||
|
||
/* Sidebar */ | ||
nav#pages .pages-root { | ||
text-transform: uppercase; | ||
border-bottom: 1px solid rgb(217, 217, 219); | ||
margin-bottom: 5px; | ||
font-size: 14px; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Deface::Override.new(virtual_path: "spree/admin/shared/_configuration_menu", | ||
name: "pages_admin_configurations_menu", | ||
insert_bottom: "[data-hook='admin_configurations_sidebar_menu'], #admin_configurations_sidebar_menu[data-hook]", | ||
text: "<%= configurations_sidebar_menu_item Spree.t(:pages), admin_pages_path %>", | ||
disabled: false) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.