Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor.

- Code cleanup and formatting.
- Updated gem engine.
- Simplecov and database_cleaner.
- Refactor all locales so they have same pattern based on english intl.
- Fixed spanish and portuguese translations and added i18n-spec tests.
  • Loading branch information...
commit 15a6eed986ef87e82965ac51922e1a62d6a8e946 1 parent fccb460
Tobias Bohwalli futhr authored JDutil committed
Showing with 809 additions and 485 deletions.
  1. +14 −3 .gitignore
  2. +1 −1  .rspec
  3. +0 −1  .travis.yml
  4. +2 −1  CONTRIBUTORS.textile
  5. +3 −3 Gemfile
  6. +5 −5 README.md
  7. +8 −10 Rakefile
  8. +1 −1  VERSION
  9. +9 −9 Versionfile
  10. +1 −3 app/controllers/spree/admin/pages_controller.rb
  11. +3 −4 app/controllers/spree/static_content_controller.rb
  12. +7 −7 app/models/spree/page.rb
  13. +5 −5 app/overrides/pages_in_footer.rb
  14. +5 −5 app/overrides/pages_in_header.rb
  15. +5 −5 app/overrides/pages_in_sidebar.rb
  16. +5 −5 app/overrides/static_content_admin_tab.rb
  17. +11 −12 app/views/spree/admin/pages/_form.html.erb
  18. +5 −5 app/views/spree/admin/pages/edit.html.erb
  19. +14 −14 app/views/spree/admin/pages/index.html.erb
  20. +5 −5 app/views/spree/admin/pages/new.html.erb
  21. +1 −1  app/views/spree/static_content/_static_content_footer.html.erb
  22. +1 −1  app/views/spree/static_content/_static_content_header.html.erb
  23. +2 −2 app/views/spree/static_content/_static_content_list.html.erb
  24. +2 −2 app/views/spree/static_content/_static_content_sidebar.html.erb
  25. +9 −10 app/views/spree/static_content/show.html.erb
  26. +31 −14 config/locales/de-CH.yml
  27. +14 −11 config/locales/de.yml
  28. +30 −13 config/locales/en-AU.yml
  29. +30 −13 config/locales/en-GB.yml
  30. +15 −14 config/locales/en.yml
  31. +27 −26 config/locales/es-ES.yml
  32. +26 −25 config/locales/es.yml
  33. +20 −12 config/locales/et.yml
  34. +32 −15 config/locales/fr-FR.yml
  35. +24 −16 config/locales/it.yml
  36. +31 −14 config/locales/nl-BE.yml
  37. +31 −15 config/locales/nl-NL.yml
  38. +31 −12 config/locales/pl.yml
  39. +33 −8 config/locales/pt-BR.yml
  40. +18 −17 config/locales/pt-PT.yml
  41. +20 −13 config/locales/ru.yml
  42. +40 −0 config/locales/sv-SE.yml
  43. +40 −0 config/locales/sv.yml
  44. +2 −3 config/routes.rb
  45. +3 −3 db/migrate/20081216193152_create_pages.rb
  46. +8 −10 db/migrate/20090625125735_extend_pages.rb
  47. +5 −6 db/migrate/20090814113100_add_visible_to_pages.rb
  48. +4 −4 db/migrate/20090814142845_add_default_true_to_visible_for_page.rb
  49. +4 −5 db/migrate/20090829000527_add_index_for_page.rb
  50. +2 −2 db/migrate/20091219021134_add_meta_fields_to_pages.rb
  51. +2 −2 db/migrate/20100204105222_add_layout_to_pages.rb
  52. +3 −3 db/migrate/20100323085528_add_show_in_sidebar_option_to_pages.rb
  53. +2 −2 db/migrate/20110717103112_add_meta_title_to_page.rb
  54. +1 −1  db/migrate/20120723144115_add_render_as_partial_for_layout_for_spree_pages.rb
  55. +28 −0 lib/generators/spree_static_content/install/install_generator.rb
  56. +0 −18 lib/generators/spree_static_content/install_generator.rb
  57. +11 −4 lib/spree_static_content/engine.rb
  58. +5 −0 script/rails
  59. +16 −0 spec/integration/locale_spec.rb
  60. +16 −0 spec/models/locale_spec.rb
  61. +4 −5 spec/models/page_spec.rb
  62. +20 −21 spec/requests/static_content_spec.rb
  63. +35 −26 spec/spec_helper.rb
  64. +4 −0 spec/support/database.yml
  65. +17 −12 spree_static_content.gemspec
17 .gitignore
View
@@ -1,5 +1,16 @@
+\#*
+*~
+.#*
.DS_Store
-nbproject
-**.gem
+.idea
+.project
+.sass-cache
+coverage
Gemfile.lock
-spec/dummy/
+tmp
+nbproject
+pkg
+*.swp
+spec/dummy
+spec/test
+.rvmrc
2  .rspec
View
@@ -1,3 +1,3 @@
--colour
--format
-progress
+documentation
1  .travis.yml
View
@@ -1,6 +1,5 @@
language: ruby
rvm:
- - 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
3  CONTRIBUTORS.textile
View
@@ -4,4 +4,5 @@ h2. Contributors list - Thanks guys!
|Marcin Raczkowski|http://github.com/swistak|
|Roman Smirnov|http://github.com/romul|
|Eliot Sykes|http://github.com/eliotsykes|
-|Oliver Azevedo Barnes|http://github.com/oliverbarnes|
+|Oliver Azevedo Barnes|http://github.com/oliverbarnes|
+|Tobias Bohwalli|http://github.com/futhr|
6 Gemfile
View
@@ -1,4 +1,4 @@
-source 'http://rubygems.org/'
-# Remove once there is a gem release for spree 2.0.x
-gem 'spree', github: 'spree/spree'
+source 'https://rubygems.org/'
+
+gem 'spree', github: 'spree/spree' # remove once there is a gem release for spree 2.0.x
gemspec
10 README.md
View
@@ -7,7 +7,7 @@ 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
@@ -15,7 +15,7 @@ be pulled directly from the database, be a separate layout file or rendered as a
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
@@ -23,18 +23,18 @@ 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.
+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.
18 Rakefile
View
@@ -1,24 +1,22 @@
-# encoding: utf-8
require 'bundler'
+
Bundler::GemHelper.install_tasks
-Bundler.setup
require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new
-
require 'spree/testing_support/common_rake'
-desc "Default Task"
-task :default => [ :spec ]
+RSpec::Core::RakeTask.new
+
+task default: [:spec]
namespace :test_app do
- desc 'Rebuild test and cucumber databases'
- task :rebuild_dbs do
- system("cd spec/test_app && rake db:drop db:migrate RAILS_ENV=test && rake db:drop db:migrate RAILS_ENV=cucumber")
+ desc 'Rebuild test database'
+ task :rebuild_db do
+ system('cd spec/test_app && rake db:drop db:migrate RAILS_ENV=test')
end
end
-desc "Generates a dummy app for testing"
+desc 'Generates a dummy app for testing'
task :test_app do
ENV['LIB_NAME'] = 'spree_static_content'
Rake::Task['common:test_app'].invoke
2  VERSION
View
@@ -1 +1 @@
-1.1.0.beta
+1.1.1.beta
18 Versionfile
View
@@ -1,9 +1,9 @@
-"2.0.x" => { :branch => 'master' }
-"1.3.x" => { :branch => '1-3-stable' }
-"1.2.x" => { :branch => '1-2-stable' }
-"1.1.x" => { :branch => '1-1-stable', :version => '1.1' }
-"1.0.x" => { :branch => '1-0-stable', :version => '1.0.1' }
-"0.70.x" => { :version => '0.70.3', :ref => '1861f4cd08c0ffa9940f0c81e69ea29b4541dbbd' }
-"0.60.x" => { :tag => "v0.60.2", :version => '0.60.2'}
-"0.50.x" => { :version => '0.40.2', :ref => '45b0050b96809c8fb0f21940f9407e9012a6d420' }
-"0.40.x" => { :version => '0.40.2', :ref => '45b0050b96809c8fb0f21940f9407e9012a6d420' }
+"2.0.x" => { :branch => "master" }
+"1.3.x" => { :branch => "1-3-stable" }
+"1.2.x" => { :branch => "1-2-stable" }
+"1.1.x" => { :branch => "1-1-stable", :version => "1.1" }
+"1.0.x" => { :branch => "1-0-stable", :version => "1.0.1" }
+"0.70.x" => { :version => "0.70.3", :ref => "1861f4cd08c0ffa9940f0c81e69ea29b4541dbbd" }
+"0.60.x" => { :tag => "v0.60.2", :version => "0.60.2" }
+"0.50.x" => { :version => "0.40.2", :ref => "45b0050b96809c8fb0f21940f9407e9012a6d420" }
+"0.40.x" => { :version => "0.40.2", :ref => "45b0050b96809c8fb0f21940f9407e9012a6d420" }
4 app/controllers/spree/admin/pages_controller.rb
View
@@ -1,3 +1 @@
-class Spree::Admin::PagesController < Spree::Admin::ResourceController
-
-end
+class Spree::Admin::PagesController < Spree::Admin::ResourceController; end
7 app/controllers/spree/static_content_controller.rb
View
@@ -1,12 +1,12 @@
class Spree::StaticContentController < Spree::StoreController
- helper "spree/products"
+ helper 'spree/products'
layout :determine_layout
def show
path = case params[:path]
when Array
- '/' + params[:path].join("/")
+ '/' + params[:path].join('/')
when String
'/' + params[:path]
when nil
@@ -18,7 +18,7 @@ def show
end
end
- private
+private
def determine_layout
return @page.layout if @page and @page.layout.present? and not @page.render_layout_as_partial?
@@ -28,5 +28,4 @@ def determine_layout
def accurate_title
@page ? (@page.meta_title.present? ? @page.meta_title : @page.title) : nil
end
-
end
14 app/models/spree/page.rb
View
@@ -1,14 +1,14 @@
class Spree::Page < ActiveRecord::Base
- default_scope :order => "position ASC"
+ default_scope order: 'position ASC'
validates_presence_of :title
validates_presence_of [:slug, :body], :if => :not_using_foreign_link?
validates_presence_of :layout, :if => :render_layout_as_partial?
- scope :visible, where(:visible => true)
- scope :header_links, where(:show_in_header => true).visible
- scope :footer_links, where(:show_in_footer => true).visible
- scope :sidebar_links, where(:show_in_sidebar => true).visible
+ scope :visible, where(visible: true)
+ scope :header_links, where(show_in_header: true).visible
+ scope :footer_links, where(show_in_footer: true).visible
+ scope :sidebar_links, where(show_in_sidebar: true).visible
before_save :update_positions_and_slug
@@ -38,9 +38,9 @@ def update_positions_and_slug
unless new_record?
return unless prev_position = Spree::Page.find(self.id).position
if prev_position > self.position
- Spree::Page.update_all("position = position + 1", ["? <= position AND position < ?", self.position, prev_position])
+ Spree::Page.update_all('position = position + 1', ['? <= position AND position < ?', self.position, prev_position])
elsif prev_position < self.position
- Spree::Page.update_all("position = position - 1", ["? < position AND position <= ?", prev_position, self.position])
+ Spree::Page.update_all('position = position - 1', ['? < position AND position <= ?', prev_position, self.position])
end
end
10 app/overrides/pages_in_footer.rb
View
@@ -1,5 +1,5 @@
-Deface::Override.new(:virtual_path => "spree/shared/_footer",
- :name => "pages_in_footer",
- :insert_bottom => "#footer-right",
- :partial => "spree/static_content/static_content_footer",
- :disabled => false)
+Deface::Override.new(virtual_path: "spree/shared/_footer",
+ name: "pages_in_footer",
+ insert_bottom: "#footer-right",
+ partial: "spree/static_content/static_content_footer",
+ disabled: false)
10 app/overrides/pages_in_header.rb
View
@@ -1,5 +1,5 @@
-Deface::Override.new(:virtual_path => "spree/shared/_main_nav_bar",
- :name => "pages_in_header",
- :insert_bottom => "#main-nav-bar",
- :partial => "spree/static_content/static_content_header",
- :disabled => false)
+Deface::Override.new(virtual_path: "spree/shared/_main_nav_bar",
+ name: "pages_in_header",
+ insert_bottom: "#main-nav-bar",
+ partial: "spree/static_content/static_content_header",
+ disabled: false)
10 app/overrides/pages_in_sidebar.rb
View
@@ -1,5 +1,5 @@
-Deface::Override.new(:virtual_path => "spree/shared/_sidebar",
- :name => "pages_in_sidebar",
- :insert_bottom => "#sidebar",
- :partial => "spree/static_content/static_content_sidebar",
- :disabled => false)
+Deface::Override.new(virtual_path: "spree/shared/_sidebar",
+ name: "pages_in_sidebar",
+ insert_bottom: "#sidebar",
+ partial: "spree/static_content/static_content_sidebar",
+ disabled: false)
10 app/overrides/static_content_admin_tab.rb
View
@@ -1,5 +1,5 @@
-Deface::Override.new(:virtual_path => "spree/layouts/admin",
- :name => "static_content_admin_tab",
- :insert_bottom => "[data-hook='admin_tabs']",
- :text => "<%= tab(:pages, :icon => 'icon-file') %>",
- :disabled => false)
+Deface::Override.new(virtual_path: "spree/layouts/admin",
+ name: "static_content_admin_tab",
+ insert_bottom: "[data-hook='admin_tabs']",
+ text: "<%= tab(:pages, icon: 'icon-file') %>",
+ disabled: false)
23 app/views/spree/admin/pages/_form.html.erb
View
@@ -2,55 +2,55 @@
<div class="alpha ten columns">
<%= f.field_container :title do %>
<%= f.label :title %> <span class="required">*</span><br />
- <%= f.text_field :title, :class => 'fullwidth title' %>
+ <%= f.text_field :title, class: 'fullwidth title' %>
<%= f.error_message_on :title %>
<% end %>
<%= f.field_container :slug do %>
<%= f.label :slug %> <span class="required">*</span><br />
- <%= f.text_field :slug, :class => 'fullwidth title' %>
+ <%= f.text_field :slug, class: 'fullwidth title' %>
<%= f.error_message_on :slug %>
<% end %>
<%= f.field_container :body do %>
<%= f.label :body %><span class="required">*</span><br />
- <%= f.text_area :body, {:class => 'fullwidth'} %>
+ <%= f.text_area :body, {class: 'fullwidth'} %>
<%= f.error_message_on :body %>
<% end %>
</div>
-
+
<div class="omega six columns">
<%= f.field_container :meta_title do %>
<%= f.label :meta_title %><br />
- <%= f.text_field :meta_title, :class => 'fullwidth title' %>
+ <%= f.text_field :meta_title, class: 'fullwidth title' %>
<%= f.error_message_on :meta_title %>
<% end %>
<%= f.field_container :meta_keywords do %>
<%= f.label :meta_keywords %><br />
- <%= f.text_field :meta_keywords, :class => 'fullwidth title' %>
+ <%= f.text_field :meta_keywords, class: 'fullwidth title' %>
<%= f.error_message_on :meta_keywords %>
<% end %>
<%= f.field_container :meta_description do %>
<%= f.label :meta_description %><br />
- <%= f.text_field :meta_description, :class => 'fullwidth title' %>
+ <%= f.text_field :meta_description, class: 'fullwidth title' %>
<%= f.error_message_on :meta_description %>
<% end %>
-
+
<%= f.field_container :layout do %>
<%= f.label :layout %><br />
- <%= f.text_field :layout, :class => 'fullwidth title' %>
+ <%= f.text_field :layout, class: 'fullwidth title' %>
<% end %>
<%= f.field_container :foreign_link do %>
<%= f.label :foreign_link %><br />
- <%= f.text_field :foreign_link, :class => 'fullwidth title' %>
+ <%= f.text_field :foreign_link, class: 'fullwidth title' %>
<% end %>
<%= f.field_container :position do %>
<%= f.label :position %><br />
- <%= f.number_field :position, :min => 0 %>
+ <%= f.number_field :position, min: 0 %>
<% end %>
<ul id="static_page_options">
@@ -75,6 +75,5 @@
<%= f.label :render_layout_as_partial %>
</li>
</ul>
-
</div>
</div>
10 app/views/spree/admin/pages/edit.html.erb
View
@@ -1,16 +1,16 @@
<% content_for :page_title do %>
- <%= t("static_content.static_pages") %> <i class="icon-arrow-right"></i> <%= t("static_content.editing_page") %> "<%= @page.title%>"
+ <%= t('static_content.static_pages') %> <i class="icon-arrow-right"></i> <%= t('static_content.editing_page') %> "<%= @page.title %>"
<% end %>
<% content_for :page_actions do %>
- <li><%= button_link_to t(:back_to_static_pages_list), spree.admin_pages_url, :icon => 'icon-arrow-left' %></li>
+ <li><%= button_link_to t(:back_to_static_pages_list), spree.admin_pages_url, icon: 'icon-arrow-left' %></li>
<% end %>
-<%= render "spree/shared/error_messages", :target => @page %>
+<%= render partial: 'spree/shared/error_messages', target: @page %>
<%= form_for [:admin, @page] do |f| %>
<fieldset class="no-border-top">
- <%= render :partial => 'form', :locals => { :f => f } %>
- <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
+ <%= render partial: 'form', f: f %>
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
</fieldset>
<% end %>
28 app/views/spree/admin/pages/index.html.erb
View
@@ -1,27 +1,27 @@
-<% content_for :page_actions do %>
- <li><%= button_link_to t("static_content.new_page"), new_object_url, :icon => 'icon-plus' %></li>
+<% content_for :page_actions do %>
+ <li><%= button_link_to t('static_content.new_page'), new_object_url, icon: 'icon-plus' %></li>
<% end %>
<% content_for :page_title do %>
- <%= t("static_content.static_pages") %>
+ <%= t('static_content.static_pages') %>
<% end %>
<table class="index">
<colgroup>
- <col style="width: 40%" />
- <col style="width: 40%" />
- <col style="width: 10%" />
- <col style="width: 10%" />
+ <col style="width:40%" />
+ <col style="width:40%" />
+ <col style="width:10%" />
+ <col style="width:10%" />
</colgroup>
<thead>
<tr>
<th><%= Spree::Page.human_attribute_name(:title) %></th>
- <th><%= t("static_content.link") %></th>
+ <th><%= t('static_content.link') %></th>
<th><%= Spree::Page.human_attribute_name(:visible) %></th>
<th class="actions"></th>
</tr>
</thead>
-
+
<tbody>
<% @pages.each do |page| %>
<tr class="<%= cycle('odd', 'even') %>" id="<%= dom_id page %>">
@@ -29,16 +29,16 @@
<%= page.title %>
</td>
<td>
- <%= link_to page.link, page.link, :target => '_blank' %>
+ <%= link_to page.link, page.link, target: '_blank' %>
</td>
<td class="align-center">
- <%= content_tag(:i, '', :class => 'icon-ok green') if page.visible %>
+ <%= content_tag(:i, '', class: 'icon-ok green') if page.visible %>
</td>
<td class="actions">
- <%= link_to_edit page, :no_text => true %>
- <%= link_to_delete page, :no_text => true %>
+ <%= link_to_edit page, no_text: true %>
+ <%= link_to_delete page, no_text: true %>
</td>
</tr>
<% end %>
</tbody>
-</table>
+</table>
10 app/views/spree/admin/pages/new.html.erb
View
@@ -1,14 +1,14 @@
<% content_for :page_title do %>
- <%= t("static_content.static_pages") %> <i class="icon-arrow-right"></i> <%= t("static_content.new_page") %>
+ <%= t('static_content.static_pages') %> <i class="icon-arrow-right"></i> <%= t('static_content.new_page') %>
<% end %>
<% content_for :page_actions do %>
- <li><%= button_link_to t(:back_to_static_pages_list), spree.admin_pages_url, :icon => 'icon-arrow-left' %></li>
+ <li><%= button_link_to t(:back_to_static_pages_list), spree.admin_pages_url, icon: 'icon-arrow-left' %></li>
<% end %>
-<%= render "spree/shared/error_messages", :target => @page %>
+<%= render 'spree/shared/error_messages', target: @page %>
<%= form_for [:admin, @page] do |f| %>
- <%= render :partial => 'form', :locals => { :f => f } %>
- <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
+ <%= render partial: 'form', f: f %>
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
<% end %>
2  app/views/spree/static_content/_static_content_footer.html.erb
View
@@ -1,3 +1,3 @@
<nav id="footer-pages">
- <ul><%= render :partial => "spree/static_content/static_content_list", :collection => Spree::Page.visible.footer_links, :as => :page %></ul>
+ <ul><%= render partial: 'spree/static_content/static_content_list', collection: Spree::Page.visible.footer_links, as: :page %></ul>
</nav>
2  app/views/spree/static_content/_static_content_header.html.erb
View
@@ -1 +1 @@
-<%= render :partial => "spree/static_content/static_content_list", :collection => Spree::Page.visible.header_links, :as => :page %>
+<%= render partial: 'spree/static_content/static_content_list', collection: Spree::Page.visible.header_links, as: :page %>
4 app/views/spree/static_content/_static_content_list.html.erb
View
@@ -1,7 +1,7 @@
<% if page.foreign_link.present? %>
- <li class='not'><%= link_to page.title, page.foreign_link, {:target => "_blank"} %></li>
+ <li class="not"><%= link_to page.title, page.foreign_link, target: '_blank' %></li>
<% else %>
<% page_uri = Rails.application.routes.named_routes[:spree].path.spec.to_s == '/' ? page.slug : Rails.application.routes.named_routes[:spree].path.spec.to_s + page.slug %>
- <li class=<%=(request.fullpath.gsub('//','/') == page_uri) ? 'current' : 'not'%>><%= link_to page.title, page_uri %></li>
+ <li class="<%=(request.fullpath.gsub('//','/') == page_uri) ? 'current' : 'not'%>"><%= link_to page.title, page_uri %></li>
<% end %>
4 app/views/spree/static_content/_static_content_sidebar.html.erb
View
@@ -1,6 +1,6 @@
<% if Spree::Page.visible.sidebar_links.any? %>
<nav id="sidebar-pages-menu" class="sidebar-item">
- <h6 class="page-navigation-title"><%= t("static_content.page_navigation_title")%></h6>
- <ul><%= render :partial => "spree/static_content/static_content_list", :collection => Spree::Page.visible.sidebar_links, :as => :page %></ul>
+ <h6 class="page-navigation-title"><%= t('static_content.page_navigation_title') %></h6>
+ <ul><%= render partial: 'spree/static_content/static_content_list', collection: Spree::Page.visible.sidebar_links, as: :page %></ul>
</nav>
<% end %>
19 app/views/spree/static_content/show.html.erb
View
@@ -1,26 +1,25 @@
<% if @page.layout.present? and @page.render_layout_as_partial? %>
- <%= render :partial => @page.layout %>
+ <%= render partial: @page.layout %>
<% else %>
<% content_for :head do -%>
<%- if @page.meta_title.present? -%>
- <meta name="title" content="<%=@page.meta_title%>">
+ <meta name="title" content="<%= @page.meta_title %>">
<%- else -%>
- <meta name="title" content="<%=@page.title%>">
+ <meta name="title" content="<%= @page.title %>">
<%- end -%>
- <meta name="keywords" content="<%=@page.meta_keywords%>">
- <meta name="description" content="<%=@page.meta_description%>">
+ <meta name="keywords" content="<%= @page.meta_keywords %>">
+ <meta name="description" content="<%= @page.meta_description %>">
<% end -%>
<% content_for :sidebar do %>
- <% if "products" == @current_controller && @taxon %>
- <%= render :partial => "spree/shared/filters" %>
+ <% if 'products' == @current_controller && @taxon %>
+ <%= render partial: 'spree/shared/filters' %>
<% else %>
- <%= render :partial => "spree/shared/taxonomies" %>
+ <%= render partial: 'spree/shared/taxonomies' %>
<% end %>
<% end %>
- <h1><%= @page.title %></h1>
<div id="page_content">
<%= raw @page.body %>
</div>
-<% end %>
+<% end %>
45 config/locales/de-CH.yml
View
@@ -1,23 +1,40 @@
---
de-CH:
+ page: Seite
pages: Seiten
static_content:
static_pages: Statische Seiten
- static_pages_desc: Manage static page with WYSIWYG editor.
- title: Titel
- slug: Slug
- body: Body
+ static_pages_desc: Verwaltung statischer Seiten mit einem WYSIWYG-Editor.
new_page: Neue Seite
editing_page: Seite bearbeiten
- foreign_link: Externer Link (URL)
- show_in_sidebar: In der Sidebar anzeigen
- show_in_header: Im Header anzeigen
- show_in_footer: Im Footer anzeigen
- position: Position
- visible: Sichtbar
confirm_delete: Bist du sicher?
link: Link
- meta_title: Meta-Titel
- meta_keywords: Meta-Schl&uuml;sselw&ouml;rter
- meta_description: Meta-Beschreibung
- layout: Layout
+ page_navigation_title: Seiten
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Titel
+ slug: Pfad
+ body: Inhalt
+ foreign_link: Externer Link (URL)
+ show_in_sidebar: In der 'Sidebar' anzeigen
+ show_in_header: Im 'Header' anzeigen
+ show_in_footer: Im 'Footer' anzeigen
+ position: Position
+ visible: Sichtbar
+ meta_title: Meta-Titel
+ meta_keywords: Meta-Schlüsselwörter
+ meta_description: Meta-Beschreibung
+ layout: Layout
+ models:
+ spree/page:
+ one: Seite
+ other: "%{count} Seiten"
+ few: Seiten
+ many: Seiten
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
25 config/locales/de.yml
View
@@ -1,5 +1,16 @@
---
de:
+ page: Seite
+ pages: Seiten
+ static_content:
+ static_pages: Statische Seiten
+ static_pages_desc: Verwaltung statischer Seiten mit einem WYSIWYG-Editor.
+ new_page: Neue Seite
+ editing_page: Seite bearbeiten
+ confirm_delete: Sind Sie sicher?
+ link: Link
+ page_navigation_title: Seiten
+
activerecord:
attributes:
spree/page: &page_labels
@@ -12,26 +23,18 @@ de:
show_in_footer: Im 'Footer' anzeigen
position: Position
visible: Sichtbar
+ meta_title: Meta-Titel
meta_keywords: Meta-Schlüsselwörter
meta_description: Meta-Beschreibung
- meta_title: Meta-Titel
layout: Layout
models:
spree/page:
one: Seite
+ other: "%{count} Seiten"
+ few: Seiten
many: Seiten
helpers:
label:
page:
<<: *page_labels
-
- page: Seite
- pages: Seiten
- static_content:
- static_pages: Statische Seiten
- static_pages_desc: Verwaltung statischer Seiten mit einem WYSIWYG-Editor
- new_page: Neue Seite
- editing_page: Seite bearbeiten
- confirm_delete: Sind Sie sicher?
- link: Link
43 config/locales/en-AU.yml
View
@@ -1,23 +1,40 @@
---
en-AU:
+ page: Page
pages: Pages
static_content:
static_pages: Static pages
static_pages_desc: Manage static page with WYSIWYG editor.
- title: Title
- slug: Slug
- body: Body
new_page: New page
editing_page: Editing page
- foreign_link: Foreign link (URL)
- show_in_sidebar: Show in sidebar
- show_in_header: Show in header
- show_in_footer: Show in footer
- position: Position
- visible: Visible
confirm_delete: Are you sure?
link: Link
- meta_title: Meta Title
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- layout: Layout
+ page_navigation_title: Pages
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Title
+ slug: Slug
+ body: Body
+ foreign_link: Foreign link (URL)
+ show_in_sidebar: Show in sidebar
+ show_in_header: Show in header
+ show_in_footer: Show in footer
+ position: Position
+ visible: Visible
+ meta_title: Meta Title
+ meta_keywords: Meta Keywords
+ meta_description: Meta Description
+ layout: Layout
+ models:
+ spree/page:
+ one: Page
+ other: "%{count} Pages"
+ few: Pages
+ many: Pages
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
43 config/locales/en-GB.yml
View
@@ -1,23 +1,40 @@
---
en-GB:
+ page: Page
pages: Pages
static_content:
static_pages: Static pages
static_pages_desc: Manage static page with WYSIWYG editor.
- title: Title
- slug: Slug
- body: Body
new_page: New page
editing_page: Editing page
- foreign_link: Foreign link (URL)
- show_in_sidebar: Show in sidebar
- show_in_header: Show in header
- show_in_footer: Show in footer
- position: Position
- visible: Visible
confirm_delete: Are you sure?
link: Link
- meta_title: Meta Title
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- layout: Layout
+ page_navigation_title: Pages
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Title
+ slug: Slug
+ body: Body
+ foreign_link: Foreign link (URL)
+ show_in_sidebar: Show in sidebar
+ show_in_header: Show in header
+ show_in_footer: Show in footer
+ position: Position
+ visible: Visible
+ meta_title: Meta Title
+ meta_keywords: Meta Keywords
+ meta_description: Meta Description
+ layout: Layout
+ models:
+ spree/page:
+ one: Page
+ other: "%{count} Pages"
+ few: Pages
+ many: Pages
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
29 config/locales/en.yml
View
@@ -1,5 +1,16 @@
---
en:
+ page: Page
+ pages: Pages
+ static_content:
+ static_pages: Static pages
+ static_pages_desc: Manage static page with WYSIWYG editor.
+ new_page: New page
+ editing_page: Editing page
+ confirm_delete: Are you sure?
+ link: Link
+ page_navigation_title: Pages
+
activerecord:
attributes:
spree/page: &page_labels
@@ -12,28 +23,18 @@ en:
show_in_footer: Show in footer
position: Position
visible: Visible
+ meta_title: Meta Title
meta_keywords: Meta Keywords
meta_description: Meta Description
- meta_title: Meta Title
layout: Layout
models:
- page:
+ spree/page:
one: Page
+ other: "%{count} Pages"
+ few: Pages
many: Pages
helpers:
label:
page:
<<: *page_labels
-
- page: Page
- pages: Pages
- static_content:
- static_pages: Static pages
- static_pages_desc: Manage static page with WYSIWYG editor.
- new_page: New page
- editing_page: Editing page
- confirm_delete: Are you sure ?
- link: Link
- meta_title: Meta Title
- page_navigation_title: "Pages"
53 config/locales/es-ES.yml
View
@@ -1,39 +1,40 @@
---
es-ES:
+ page: Página
+ pages: Páginas
+ static_content:
+ static_pages: Páginas estáticas
+ static_pages_desc: Administrar página estática con el 'editor WYSIWYG'.
+ new_page: Nueva página
+ editing_page: Edición de página
+ confirm_delete: ¿Estás seguro?
+ link: Enlace
+ page_navigation_title: Páginas
+
activerecord:
attributes:
spree/page: &page_labels
title: Título
slug: Slug
body: Cuerpo
- foreign_link: Link externo (URL)
- show_in_sidebar: Mostrar en el sidebar
- show_in_header: Mostrar en el header
- show_in_footer: Mostrar en el footer
+ foreign_link: Enlace externo (URL)
+ show_in_sidebar: Mostrar en el 'sidebar'
+ show_in_header: Mostrar en la cabecera
+ show_in_footer: Mostrar en el pie de página
position: Posición
visible: Visible
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- meta_title: Meta Title
- layout: Layout
+ meta_title: Meta Título
+ meta_keywords: Meta Palabras
+ meta_description: Meta Descripción
+ layout: Disposición
models:
- page:
+ spree/page:
one: Página
+ other: "%{count} Páginas"
+ few: Páginas
many: Páginas
-
- pages: Páginas
- static_content:
- static_pages: Páginas estáticas
- static_pages_desc: Administrar página estática con el editor WYSIWYG.
- title: Título
- slug: Slug
- body: Cuerpo
- new_page: Nueva página
- editing_page: Edición de página
- foreign_link: Enlace externo (URL)
- show_in_header: Mostrar en la cabecera
- show_in_footer: Mostrar en el pie de página
- position: Posición
- visible: Visible
- confirm_delete: ¿Estás seguro?
- link: Enlace
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
51 config/locales/es.yml
View
@@ -1,39 +1,40 @@
---
es:
+ page: Página
+ pages: Páginas
+ static_content:
+ static_pages: Páginas estáticas
+ static_pages_desc: Administrar página estática con el 'editor WYSIWYG'.
+ new_page: Nueva página
+ editing_page: Edición de página
+ confirm_delete: ¿Estás seguro?
+ link: Enlace
+ page_navigation_title: Páginas
+
activerecord:
attributes:
spree/page: &page_labels
title: Título
slug: Slug
body: Cuerpo
- foreign_link: Link externo (URL)
- show_in_sidebar: Mostrar en el sidebar
- show_in_header: Mostrar en el header
- show_in_footer: Mostrar en el footer
+ foreign_link: Enlace externo (URL)
+ show_in_sidebar: Mostrar en el 'sidebar'
+ show_in_header: Mostrar en la cabecera
+ show_in_footer: Mostrar en el pie de página
position: Posición
visible: Visible
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- meta_title: Meta Title
- layout: Layout
+ meta_title: Meta Título
+ meta_keywords: Meta Palabras
+ meta_description: Meta Descripción
+ layout: Disposición
models:
- page:
+ spree/page:
one: Página
+ other: "%{count} Páginas"
+ few: Páginas
many: Páginas
- pages: Páginas
- static_content:
- static_pages: Páginas estáticas
- static_pages_desc: Administrar página estática con el editor WYSIWYG.
- title: Título
- slug: Slug
- body: Cuerpo
- new_page: Nueva página
- editing_page: Edición de página
- foreign_link: Enlace externo (URL)
- show_in_header: Mostrar en la cabecera
- show_in_footer: Mostrar en el pie de página
- position: Posición
- visible: Visible
- confirm_delete: ¿Estás seguro?
- link: Enlace
+ helpers:
+ label:
+ page:
+ <<: *page_labels
32 config/locales/et.yml
View
@@ -1,8 +1,19 @@
---
et:
+ page: Lehekülg
+ pages: Leheküljed
+ static_content:
+ static_pages: Leheküljed
+ static_pages_desc: Staatiliste lehekülgede haldamine WYSIWYG editori abil.
+ new_page: Uus lehekülg
+ editing_page: Muudan lehekülge
+ confirm_delete: Oled kindel?
+ link: Link
+ page_navigation_title: Leheküljed
+
activerecord:
attributes:
- spree/page:
+ spree/page: &page_labels
title: Pealkiri
slug: Püsiviide
body: Sisu
@@ -12,21 +23,18 @@ et:
show_in_footer: Kuva lehekülg jaluses
position: Positsioon
visible: Nähtav
+ meta_title: Meta pealkiri
meta_keywords: Meta võtmesõnad
meta_description: Meta kirjeldus
layout: Layout
models:
- page:
+ spree/page:
one: Lehekülg
+ other: "%{count} Leheküljed"
+ few: Leheküljed
many: Leheküljed
- page: Lehekülg
- pages: Leheküljed
- static_content:
- static_pages: Leheküljed
- static_pages_desc: Staatiliste lehekülgede haldamine WYSIWYG editori abil.
- new_page: Uus lehekülg
- editing_page: Muudan lehekülge
- confirm_delete: Oled kindel?
- link: Link
- meta_title: Meta pealkiri
+ helpers:
+ label:
+ page:
+ <<: *page_labels
47 config/locales/fr-FR.yml
View
@@ -1,23 +1,40 @@
---
fr-FR:
+ page: Page
pages: Pages
static_content:
static_pages: Pages statiques
- static_pages_desc: "Gérer les pages statiques avec l'éditeur WYSIWYG."
- title: Titre
- slug: Slug
- body: Corps
+ static_pages_desc: Gérer les pages statiques avec l'éditeur WYSIWYG.
new_page: Nouvelle page
editing_page: Edition de la page
- foreign_link: Lien extérieur (URL)
- show_in_sidebar: Visible dans la sidebar
- show_in_header: Visible en entête
- show_in_footer: Visible en pied de page
- position: Position
- visible: Visible
- confirm_delete: êtes-vous sûr ?
+ confirm_delete: êtes-vous sûr?
link: Lien
- meta_title: Meta Titre
- meta_keywords: Meta Mots-clés
- meta_description: Meta Description
- layout: Layout
+ page_navigation_title: Pages
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Titre
+ slug: Slug
+ body: Corps
+ foreign_link: Lien extérieur (URL)
+ show_in_sidebar: Visible dans la sidebar
+ show_in_header: Visible en entête
+ show_in_footer: Visible en pied de page
+ position: Position
+ visible: Visible
+ meta_title: Meta Titre
+ meta_keywords: Meta Mots-clés
+ meta_description: Meta Description
+ layout: Layout
+ models:
+ spree/page:
+ one: Page
+ other: "%{count} Pages"
+ few: Pages
+ many: Pages
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
40 config/locales/it.yml
View
@@ -1,32 +1,40 @@
---
it:
+ page: Pagina
+ pages: Pagine
+ static_content:
+ static_pages: Pagine statiche
+ static_pages_desc: Gestisce le pagine statiche con un editor WYSIWYG.
+ new_page: Nuova pagina
+ editing_page: Modifica pagina
+ confirm_delete: Sei sicuro?
+ link: Legame
+ page_navigation_title: Pagine
+
activerecord:
attributes:
- spree/page:
+ spree/page: &page_labels
title: Titolo
slug: Slug
body: Testo
- foreign_link: Link esterno (URL)
+ foreign_link: Legame esterno (URL)
show_in_sidebar: Mostra nella sidebar
show_in_header: Mostra nell'header
show_in_footer: Mostra nel footer
position: Posizione
visible: Visibile
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- layout: Layout
+ meta_title: Meta Titolo
+ meta_keywords: Meta Parole Chiave
+ meta_description: Meta Descrizione
+ layout: Progetto
models:
- page:
+ spree/page:
one: Pagina
+ other: "%{count} Pagine"
+ few: Pagine
many: Pagine
- page: Pagina
- pages: Pagine
- static_content:
- static_pages: Pagine statiche
- static_pages_desc: Gestisce le pagine statiche con un editor WYSIWYG.
- new_page: Nuova pagina
- editing_page: Modifica pagina
- confirm_delete: Sei sicuro?
- link: Link
- meta_title: Meta Title
+ helpers:
+ label:
+ page:
+ <<: *page_labels
45 config/locales/nl-BE.yml
View
@@ -1,23 +1,40 @@
---
nl-BE:
+ page: Page
pages: Statische pagina's
static_content:
static_pages: Statische pagina's
static_pages_desc: Beheer statische pagina's met een WYSIWYG editor.
- title: Titel
- slug: Slug
- body: Body
new_page: Nieuwe pagina
editing_page: Pagina bewerken
- foreign_link: Externe link (URL)
- show_in_header: Toon in header
- show_in_footer: Toon in footer
- position: Positie
- visible: Zichtbaar?
- confirm_delete: Weet u zeker dat u deze pagina wilt verwijderen ?
+ confirm_delete: Weet u zeker dat u deze pagina wilt verwijderen?
link: Link
- meta_title: Meta Titel
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- layout: Layout
- show_in_sidebar: Toon in zijbalk?
+ page_navigation_title: Pagina's
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Titel
+ slug: Slug
+ body: Body
+ foreign_link: Externe link (URL)
+ show_in_sidebar: Toon in zijbalk?
+ show_in_header: Toon in header?
+ show_in_footer: Toon in footer?
+ position: Positie
+ visible: Zichtbaar?
+ meta_title: Meta Title
+ meta_keywords: Meta Keywords
+ meta_description: Meta Description
+ layout: Layout
+ models:
+ spree/page:
+ one: Page
+ other: "%{count} Statische pagina's"
+ few: Statische pagina's
+ many: Statische pagina's
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
46 config/locales/nl-NL.yml
View
@@ -1,24 +1,40 @@
---
nl-NL:
+ page: Page
pages: Statische pagina's
static_content:
static_pages: Statische pagina's
static_pages_desc: Beheer statische pagina's met een WYSIWYG editor.
- title: Titel
- slug: Slug
- body: Body
new_page: Nieuwe pagina
editing_page: Pagina bewerken
- foreign_link: Externe link (URL)
- show_in_header: Toon in header
- show_in_footer: Toon in footer
- position: Positie
- visible: Zichtbaar?
- confirm_delete: Weet u zeker dat u deze pagina wilt verwijderen ?
+ confirm_delete: Weet u zeker dat u deze pagina wilt verwijderen?
link: Link
- meta_title: Meta Titel
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- layout: Layout
- show_in_sidebar: Toon in zijbalk?
- page_navigation_title: "Pagina's"
+ page_navigation_title: Pagina's
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Titel
+ slug: Slug
+ body: Body
+ foreign_link: Externe link (URL)
+ show_in_sidebar: Toon in zijbalk?
+ show_in_header: Toon in header?
+ show_in_footer: Toon in footer?
+ position: Positie
+ visible: Zichtbaar?
+ meta_title: Meta Title
+ meta_keywords: Meta Keywords
+ meta_description: Meta Description
+ layout: Layout
+ models:
+ spree/page:
+ one: Page
+ other: "%{count} Statische pagina's"
+ few: Statische pagina's
+ many: Statische pagina's
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
43 config/locales/pl.yml
View
@@ -1,21 +1,40 @@
---
pl:
+ page: Page
pages: Strony statyczne
static_content:
static_pages: Strony statyczne
static_pages_desc: Zarządzaj stronami statycznymi.
- title: Tytuł
- slug: Skrót
- body: Zawartość
new_page: Nowa strona
editing_page: Edycja strony
- foreign_link: Odnośnik zewnętrzny
- show_in_header: Pokaż w nagłówku
- show_in_footer: Pokaż w stopce
- position: Pozycja
- visible: Widoczna
- confirm_delete: Jesteś pewien ?
+ confirm_delete: Jesteś pewien?
link: Odnośnik
- meta_title: Tytół (w nagłówku przeglądarki)
- meta_keywords: Słowa kluczowe (SEO)
- meta_description: Skrócony opis (SEO)
+ page_navigation_title: Strony statyczne
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Tytuł
+ slug: Skrót
+ body: Zawartość
+ foreign_link: Odnośnik zewnętrzny
+ show_in_sidebar: Show in sidebar
+ show_in_header: Pokaż w nagłówku
+ show_in_footer: Pokaż w stopce
+ position: Pozycja
+ visible: Widoczna
+ meta_title: Tytół (w nagłówku przeglądarki)
+ meta_keywords: Słowa kluczowe (SEO)
+ meta_description: Skrócony opis (SEO)
+ layout: Layout
+ models:
+ spree/page:
+ one: Page
+ other: "%{count} Strony statyczne"
+ few: Strony statyczne
+ many: Strony statyczne
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
41 config/locales/pt-BR.yml
View
@@ -1,15 +1,40 @@
---
pt-BR:
+ page: Página
pages: Páginas
static_content:
static_pages: Páginas estáticas
- static_pages_desc: Administrar página estática com editor visual (WYSIWYG).
- title: Título
- slug: Slug
- body: Corpo
+ static_pages_desc: Administrar página estática com 'editor WYSIWYG'.
new_page: Nova página
editing_page: Editando página
- foreign_link: Link externo (URL)
- show_in_header: Mostrar no cabeçalho
- show_in_footer: Mostrar no rodapé
- position: Posição
+ confirm_delete: Você tem certeza?
+ link: Link
+ page_navigation_title: Páginas
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Título
+ slug: Slug
+ body: Corpo
+ foreign_link: Link externo (URL)
+ show_in_sidebar: Mostrar na barra lateral
+ show_in_header: Mostrar no cabeçalho
+ show_in_footer: Mostrar no rodapé
+ position: Posição
+ visible: Visível
+ meta_title: Meta Título
+ meta_keywords: Meta Palavras
+ meta_description: Meta Descrição
+ layout: Traçado
+ models:
+ spree/page:
+ one: Página
+ other: "%{count} Páginas"
+ few: Páginas
+ many: Páginas
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
35 config/locales/pt-PT.yml
View
@@ -1,5 +1,16 @@
---
pt-PT:
+ page: Página
+ pages: Páginas
+ static_content:
+ static_pages: Páginas estáticas
+ static_pages_desc: Gere páginas estáticas com um 'editor WYSIWYG'.
+ new_page: Nova página
+ editing_page: Editar página
+ confirm_delete: Tem a certeza?
+ link: Link
+ page_navigation_title: Páginas
+
activerecord:
attributes:
spree/page: &page_labels
@@ -12,28 +23,18 @@ pt-PT:
show_in_footer: Mostrar no rodapé
position: Posição
visible: Visível
- meta_keywords: Meta Keywords
- meta_description: Meta Description
- meta_title: Meta Title
- layout: Layout
+ meta_title: Meta Título
+ meta_keywords: Meta Palavras
+ meta_description: Meta Descrição
+ layout: Traçado
models:
- page:
+ spree/page:
one: Página
+ other: "%{count} Páginas"
+ few: Páginas
many: Páginas
helpers:
label:
page:
<<: *page_labels
-
- page: Página
- pages: Páginas
- static_content:
- static_pages: Páginas estáticas
- static_pages_desc: Gere páginas estáticas com um editor WYSIWYG.
- new_page: Nova página
- editing_page: Editar página
- confirm_delete: Tem a certeza?
- link: Link
- meta_title: Meta Title
- page_navigation_title: "Páginas"
33 config/locales/ru.yml
View
@@ -1,33 +1,40 @@
---
ru:
+ page: "Страница"
+ pages: "Страницы"
+ static_content:
+ static_pages: "Статические страницы"
+ static_pages_desc: "Управление статическими страницами"
+ new_page: "Новая страница"
+ editing_page: "Редактирование страницы"
+ confirm_delete: "Вы уверены, что хотите удалить страницу?"
+ link: "Ссылка"
+ page_navigation_title: "Страницы"
+
activerecord:
attributes:
- spree/page:
+ spree/page: &page_labels
title: Заголовок
slug: Постоянная ссылка
body: Основной текст
foreign_link: "Внешняя ссылка (URL)"
+ show_in_sidebar: "Отображать в боковом меню"
show_in_header: "Отображать в верхнем меню"
show_in_footer: "Отображать в нижнем меню"
- show_in_sidebar: "Отображать в боковом меню"
position: "Позиция в меню"
visible: "Публиковать"
+ meta_title: "Мета заголовок"
meta_keywords: "Ключевые слова"
meta_description: "Описание"
layout: "Макет"
models:
- page:
+ spree/page:
one: Страница
+ other: "%{count} Страницы"
few: Страницы
many: Страниц
- page: "Страница"
- pages: "Страницы"
- static_content:
- static_pages: "Статические страницы"
- static_pages_desc: "Управление статическими страницами"
- new_page: "Новая страница"
- editing_page: "Редактирование страницы"
- confirm_delete: "Вы уверены, что хотите удалить страницу?"
- link: "Ссылка"
- meta_title: "Мета заголовок"
+ helpers:
+ label:
+ page:
+ <<: *page_labels
40 config/locales/sv-SE.yml
View
@@ -0,0 +1,40 @@
+---
+sv:
+ page: Sida
+ pages: Sidor
+ static_content:
+ static_pages: Statiska sidor
+ static_pages_desc: Hantera statiska sidor med 'WYSIWYG editor'.
+ new_page: Ny sida
+ editing_page: Editera sidan
+ confirm_delete: Är du säker?
+ link: Länk
+ page_navigation_title: Sidor
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Titel
+ slug: Slug
+ body: Body
+ foreign_link: Extern länk (URL)
+ show_in_sidebar: Visa i 'sidebar'
+ show_in_header: Visa i 'header'
+ show_in_footer: Visa i 'footer'
+ position: Position
+ visible: Synlig
+ meta_title: Meta Titel
+ meta_keywords: Meta Keywords
+ meta_description: Meta Beskrivning
+ layout: Layout
+ models:
+ spree/page:
+ one: Sida
+ other: "%{count} Sidor"
+ few: Sidor
+ many: Sidor
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
40 config/locales/sv.yml
View
@@ -0,0 +1,40 @@
+---
+sv:
+ page: Sida
+ pages: Sidor
+ static_content:
+ static_pages: Statiska sidor
+ static_pages_desc: Hantera statiska sidor med 'WYSIWYG editor'.
+ new_page: Ny sida
+ editing_page: Editera sidan
+ confirm_delete: Är du säker?
+ link: Länk
+ page_navigation_title: Sidor
+
+ activerecord:
+ attributes:
+ spree/page: &page_labels
+ title: Titel
+ slug: Slug
+ body: Body
+ foreign_link: Extern länk (URL)
+ show_in_sidebar: Visa i 'sidebar'
+ show_in_header: Visa i 'header'
+ show_in_footer: Visa i 'footer'
+ position: Position
+ visible: Synlig
+ meta_title: Meta Titel
+ meta_keywords: Meta Keywords
+ meta_description: Meta Beskrivning
+ layout: Layout
+ models:
+ spree/page:
+ one: Sida
+ other: "%{count} Sidor"
+ few: Sidor
+ many: Sidor
+
+ helpers:
+ label:
+ page:
+ <<: *page_labels
5 config/routes.rb
View
@@ -21,16 +21,15 @@ def self.matches?(request)
end
Spree::Core::Engine.routes.prepend do
-
namespace :admin do
resources :pages
end
constraints(Spree::StaticRoot) do
- match '/', :to => 'static_content#show', :via => :get, :as => 'static'
+ match '/', to: 'static_content#show', via: :get, as: 'static'
end
constraints(Spree::StaticPage) do
- match '/*path', :to => 'static_content#show', :via => :get, :as => 'static'
+ match '/*path', to: 'static_content#show', via: :get, as: 'static'
end
end
6 db/migrate/20081216193152_create_pages.rb
View
@@ -1,15 +1,15 @@
class CreatePages < ActiveRecord::Migration
- def self.up
+ def up
create_table :pages do |t|
t.string :title
- t.text :body
+ t.text :body
t.string :slug
t.timestamps
end
end
- def self.down
+ def down
drop_table :pages
end
end
18 db/migrate/20090625125735_extend_pages.rb
View
@@ -1,23 +1,21 @@
class ExtendPages < ActiveRecord::Migration
- class Page < ActiveRecord::Base
- end
+ class Page < ActiveRecord::Base; end
- def self.up
+ def up
change_table :pages do |t|
- t.boolean :show_in_header, :default => false, :null => false
- t.boolean :show_in_footer, :default => false, :null => false
+ t.boolean :show_in_header, default: false, null: false
+ t.boolean :show_in_footer, default: false, null: false
t.string :foreign_link
- t.integer :position, :default => 1, :null => false
+ t.integer :position, default: 1, null: false
if Page.table_exists?
- Page.all(:order => "updated_at ASC").each_with_index{|page,x| page.update_attribute(:position, x+1)}
+ Page.all(order: 'updated_at ASC').each_with_index{|page,x| page.update_attribute(:position, x+1)}
else
- Spree::Page.all(:order => "updated_at ASC").each_with_index{|page,x| page.update_attribute(:position, x+1)}
+ Spree::Page.all(order: 'updated_at ASC').each_with_index{|page,x| page.update_attribute(:position, x+1)}
end
-
end
end
- def self.down
+ def down
change_table :pages do |t|
t.remove :show_in_header
t.remove :show_in_footer
11 db/migrate/20090814113100_add_visible_to_pages.rb
View
@@ -1,17 +1,16 @@
class AddVisibleToPages < ActiveRecord::Migration
- class Page < ActiveRecord::Base
- end
+ class Page < ActiveRecord::Base; end
- def self.up
+ def up
add_column :pages, :visible, :boolean
if Page.table_exists?
- Page.update_all :visible => true
+ Page.update_all visible: true
else
- Spree::Page.update_all :visible => true
+ Spree::Page.update_all visible: true
end
end
- def self.down
+ def down
remove_column :pages, :visible
end
end
8 db/migrate/20090814142845_add_default_true_to_visible_for_page.rb
View
@@ -1,8 +1,8 @@
class AddDefaultTrueToVisibleForPage < ActiveRecord::Migration
- def self.up
- change_column :pages, :visible, :boolean, :default=> true
+ def up
+ change_column :pages, :visible, :boolean, default: true
end
- def self.down
+ def down
end
-end
+end
9 db/migrate/20090829000527_add_index_for_page.rb
View
@@ -1,10 +1,9 @@
class AddIndexForPage < ActiveRecord::Migration
- def self.up
- add_index(:pages, :slug)
+ def up
+ add_index :pages, :slug
end
- def self.down
- remove_index(:pages, :slug)
+ def down
+ remove_index :pages, :slug
end
end
-
4 db/migrate/20091219021134_add_meta_fields_to_pages.rb
View
@@ -1,9 +1,9 @@
class AddMetaFieldsToPages < ActiveRecord::Migration
- def self.up
+ def up
add_column :pages, :meta_keywords, :string
add_column :pages, :meta_description, :string
end
- def self.down
+ def down
end
end
4 db/migrate/20100204105222_add_layout_to_pages.rb
View
@@ -1,9 +1,9 @@
class AddLayoutToPages < ActiveRecord::Migration
- def self.up
+ def up
add_column :pages, :layout, :string
end
- def self.down
+ def down
remove_column :pages, :layout
end
end
6 db/migrate/20100323085528_add_show_in_sidebar_option_to_pages.rb
View
@@ -1,9 +1,9 @@
class AddShowInSidebarOptionToPages < ActiveRecord::Migration
- def self.up
- add_column :pages, :show_in_sidebar, :boolean, :default=> false, :null=>false
+ def up
+ add_column :pages, :show_in_sidebar, :boolean, default: false, null: false
end
- def self.down
+ def down
remove_column :pages, :show_in_sidebar
end
end
4 db/migrate/20110717103112_add_meta_title_to_page.rb
View
@@ -1,9 +1,9 @@
class AddMetaTitleToPage < ActiveRecord::Migration
- def self.up
+ def up
add_column :pages, :meta_title, :string
end
- def self.down
+ def down
remove_column :pages, :meta_title
end
end
2  db/migrate/20120723144115_add_render_as_partial_for_layout_for_spree_pages.rb
View
@@ -1,7 +1,7 @@
class AddRenderAsPartialForLayoutForSpreePages < ActiveRecord::Migration
def up
unless column_exists? :spree_pages, :render_layout_as_partial
- add_column :spree_pages, :render_layout_as_partial, :boolean, :default => false
+ add_column :spree_pages, :render_layout_as_partial, :boolean, default: false
end
end
28 lib/generators/spree_static_content/install/install_generator.rb
View
@@ -0,0 +1,28 @@
+module SpreeStaticContent
+ module Generators
+ class InstallGenerator < Rails::Generators::Base
+ def add_javascripts
+ append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_static_content\n"
+ append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_static_content\n"
+ end
+
+ def add_stylesheets
+ inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_static_content\n", before: /\*\//, verbose: true
+ inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_static_content\n", before: /\*\//, verbose: true
+ end
+
+ def add_migrations
+ run 'bundle exec rake railties:install:migrations FROM=spree_static_content'
+ end
+
+ def run_migrations
+ res = ask 'Would you like to run the migrations now? [Y/n]'
+ if res == '' || res.downcase == 'y'
+ run 'bundle exec rake db:migrate'
+ else
+ puts 'Skipping rake db:migrate, don\'t forget to run it!'
+ end
+ end
+ end
+ end
+end
18 lib/generators/spree_static_content/install_generator.rb
View
@@ -1,18 +0,0 @@
-module SpreeStaticContent
- module Generators
- class InstallGenerator < Rails::Generators::Base
- def add_migrations
- run 'rake railties:install:migrations FROM=spree_static_content'
- end
-
- def run_migrations
- res = ask "Would you like to run the migrations now? [Y/n]"
- if res == "" || res.downcase == "y"
- run 'rake db:migrate'
- else
- puts "Skiping rake db:migrate, don't forget to run it!"
- end
- end
- end
- end
-end
15 lib/spree_static_content/engine.rb
View
@@ -1,14 +1,21 @@
module SpreeStaticContent
class Engine < Rails::Engine
+ require 'spree/core'
+ isolate_namespace Spree
engine_name 'spree_static_content'
+ config.autoload_paths += %W(#{config.root}/lib)
+
+ config.generators do |g|
+ g.test_framework :rspec
+ end
+
def self.activate
- Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c|
- Rails.application.config.cache_classes ? require(c) : load(c)
+ Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
+ Rails.configuration.cache_classes ? require(c) : load(c)
end
end
config.to_prepare &method(:activate).to_proc
- config.autoload_paths += %W(#{config.root}/lib)
end
-end
+end
5 script/rails
View
@@ -0,0 +1,5 @@
+ENGINE_ROOT = File.expand_path('../..', __FILE__)
+ENGINE_PATH = File.expand_path('../../lib/spree_static_content/engine', __FILE__)
+
+require 'rails/all'
+require 'rails/engine/commands'
16 spec/integration/locale_spec.rb
View
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe "I18n.available_locales" do
+ Dir.glob("config/locales/*.yml").each do |locale_file|
+ context locale_file do
+ it { should be_parseable }
+ it { should have_valid_pluralization_keys }
+ it { should_not have_missing_pluralization_keys }
+ it { should have_one_top_level_namespace }
+ it { should_not have_legacy_interpolations }
+ it { should have_a_valid_locale }
+ it { should be_a_complete_translation_of "config/locales/en.yml" }
+ it { should be_a_subset_of 'config/locales/en.yml' }
+ end
+ end
+end
16 spec/models/locale_spec.rb
View
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe "I18n.available_locales" do
+ Dir.glob("config/locales/*.yml").each do |locale_file|
+ context locale_file do
+ it { should be_parseable }
+ it { should have_valid_pluralization_keys }
+ it { should_not have_missing_pluralization_keys }
+ it { should have_one_top_level_namespace }
+ it { should_not have_legacy_interpolations }
+ it { should have_a_valid_locale }
+ it { should be_a_complete_translation_of "config/locales/en.yml" }
+ it { should be_a_subset_of 'config/locales/en.yml' }
+ end
+ end
+end
9 spec/models/page_spec.rb
View
@@ -1,16 +1,15 @@
require 'spec_helper'
describe Spree::Page do
- before(:each) do
+ before do
@page = Spree::Page.create(
- :title => 'test page',
- :slug => 'test-page',
- :body => 'this is a test page'
+ title: "test page",
+ slug: "test-page",
+ body: "this is a test page"
)
end
it "should be valid" do
@page.should be_valid
end
-
end
41 spec/requests/static_content_spec.rb
View
@@ -1,34 +1,33 @@
require 'spec_helper'
-describe 'Static Content Page' do
- it 'should render page when there is a query string' do
- Spree::Page.create(:slug => '/page', :title => 'Test Page', :body => 'Test page body')
- visit '/page?test'
- page.should have_content('Test page body')
+describe "Static Content Page" do
+ it "should render page when there is a query string" do
+ Spree::Page.create(slug: "/page", title: "Test Page", body: "Test page body")
+ visit "/page?test"
+ page.should have_content("Test page body")
end
- it 'should render page with a slug not starting by /' do
- Spree::Page.create(:slug => 'page2', :title => 'Test Page 2', :body => 'Test page body 2')
- visit '/page2'
- page.should have_content('Test page body 2')
+ it "should render page with a slug not starting by /" do
+ Spree::Page.create(slug: "page2", title: "Test Page 2", body: "Test page body 2")
+ visit "/page2"
+ page.should have_content("Test page body 2")
end
- it 'should render page with a slug with multiple /' do
- Spree::Page.create(:slug => '/t/categories/page3', :title => 'Test Page 3', :body => 'Test page body 3')
- visit '/t/categories/page3'
- page.should have_content('Test page body 3')
+ it "should render page with a slug with multiple /" do
+ Spree::Page.create(slug: "/t/categories/page3", title: "Test Page 3", body: "Test page body 3")
+ visit "/t/categories/page3"
+ page.should have_content("Test page body 3")
end
it "should render a custom root page" do
- Spree::Page.create(:slug => '/', :title => 'Root Page', :body => 'Root Body')
- visit '/'
- page.should have_content('Root Body')
+ Spree::Page.create(slug: "/", title: "Root Page", body: "Root Body")
+ visit "/"
+ page.should have_content("Root Body")
end
it "should not effect the rendering of the rest of the site" do
- p = FactoryGirl.create :product
- visit spree.product_path(p)
- page.should have_content(p.name)
+ product = create(:product)
+ visit spree.product_path(product)
+ page.should have_content(product.name)
end
-
-end
+end
61 spec/spec_helper.rb
View
@@ -1,39 +1,48 @@
-# Configure Rails Environment
-ENV["RAILS_ENV"] = "test"
+require 'simplecov'
+SimpleCov.start do
+ add_group 'Controllers', 'app/controllers'
+ add_group 'Helpers', 'app/helpers'
+ add_group 'Mailers', 'app/mailers'
+ add_group 'Models', 'app/models'
+ add_group 'Views', 'app/views'
+ add_group 'Libraries', 'lib'
+end
-require File.expand_path("../dummy/config/environment.rb", __FILE__)
+ENV["RAILS_ENV"] = 'test'
-require 'ffaker'
+require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
+require 'ffaker'
+require 'database_cleaner'
+require 'i18n-spec'
# Run any available migration
-ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
+ActiveRecord::Migrator.migrate File.expand_path('../dummy/db/migrate/', __FILE__)
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
-# Requires factories defined in spree_core
require 'spree/testing_support/factories'
require 'spree/testing_support/url_helpers'
RSpec.configure do |config|
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
- #
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
-
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
-
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, remove the following line or assign false
- # instead of true.
- config.use_transactional_fixtures = true
-
+ config.include FactoryGirl::Syntax::Methods
config.include Spree::TestingSupport::UrlHelpers
+
+ config.color = true
+ config.mock_with :rspec
+ config.use_transactional_fixtures = false
+ config.fail_fast = ENV['FAIL_FAST'] || false
+
+ config.before do
+ if example.metadata[:js]
+ DatabaseCleaner.strategy = :truncation
+ else
+ DatabaseCleaner.strategy = :transaction
+ end
+ DatabaseCleaner.start
+ end
+
+ config.after do
+ DatabaseCleaner.clean
+ end
end
4 spec/support/database.yml
View
@@ -0,0 +1,4 @@
+test: &test
+ adapter: sqlite3
+ encoding: utf8
+ database: ":memory:"
29 spree_static_content.gemspec
View
@@ -1,25 +1,30 @@
-version = File.read(File.expand_path("../VERSION", __FILE__)).strip
+version = File.read(File.expand_path('../VERSION', __FILE__)).strip
Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = 'spree_static_content'
- s.version = version
- s.summary = 'Extention to manage the static pages for your Spree shop.'
+ s.platform = Gem::Platform::RUBY
+ s.name = 'spree_static_content'
+ s.version = version
+ s.summary = 'Extention to manage static pages for Spree'
+ s.description = 'Extention to manage static pages for Spree'
s.required_ruby_version = '>= 1.9.3'
- s.authors = [%q{Peter Berkenbosch}, %q{Roman Smirnov}]
- s.email = 'peter@pero-ict.nl'
- s.homepage = 'http://spreecommerce.com/extensions/139-static-content'
+ s.authors = [%q{Peter Berkenbosch}, %q{Roman Smirnov}]
+ s.email = 'peter@pero-ict.nl'
+ s.homepage = 'http://spreecommerce.com/extensions/139-static-content'
- s.files = Dir['CHANGELOG', 'README.md', 'LICENSE', 'lib/**/*', 'app/**/*']
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {spec}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
s.add_dependency 'spree_core', '~> 2.0.0.beta'
- s.add_development_dependency 'capybara', '1.0.1'
+ s.add_development_dependency 'capybara', '~> 1.0.1'
s.add_development_dependency 'factory_girl', '~> 4.2'
s.add_development_dependency 'ffaker'
- s.add_development_dependency 'rspec-rails', '~> 2.7'
- s.add_development_dependency 'sqlite3'
+ s.add_development_dependency 'rspec-rails', '~> 2.13'
+ s.add_development_dependency 'sqlite3', '~> 1.3.7'
+ s.add_development_dependency 'simplecov', '~> 0.7.1'
+ s.add_development_dependency 'database_cleaner'
+ s.add_development_dependency 'i18n-spec'
end
Please sign in to comment.