forked from spree/spree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Dutil
authored and
Jeff Dutil
committed
Dec 1, 2014
1 parent
09d1fb7
commit 109180f
Showing
16 changed files
with
113 additions
and
202 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
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
## Spree 2.4.0 (unreleased) ## | ||
## Spree 3.0.0 (unreleased) ## | ||
|
||
Switched to Bootstrap |
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
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,54 @@ | ||
module Spree | ||
module FrontendHelper | ||
def breadcrumbs(taxon, separator=" ") | ||
return "" if current_page?("/") || taxon.nil? | ||
separator = raw(separator) | ||
crumbs = [content_tag(:li, content_tag(:span, link_to(Spree.t(:home), spree.root_path, itemprop: "url") + separator, itemprop: "title"), itemscope:"itemscope", itemtype:"http://data-vocabulary.org/Breadcrumb")] | ||
if taxon | ||
crumbs << content_tag(:li, content_tag(:span, link_to(Spree.t(:products), products_path, itemprop: "url") + separator, itemprop: "title"), itemscope:"itemscope", itemtype:"http://data-vocabulary.org/Breadcrumb") | ||
crumbs << taxon.ancestors.collect { |ancestor| content_tag(:li, content_tag(:span, link_to(ancestor.name , seo_url(ancestor), itemprop: "url") + separator, itemprop: "title"), itemscope:"itemscope", itemtype:"http://data-vocabulary.org/Breadcrumb") } unless taxon.ancestors.empty? | ||
crumbs << content_tag(:li, content_tag(:span, link_to(taxon.name , seo_url(taxon), itemprop: "url"), itemprop: "title"), class: 'active', itemscope:"itemscope", itemtype:"http://data-vocabulary.org/Breadcrumb") | ||
else | ||
crumbs << content_tag(:li, content_tag(:span, Spree.t(:products), itemprop: "title"), class: 'active', itemscope:"itemscope", itemtype:"http://data-vocabulary.org/Breadcrumb") | ||
end | ||
crumb_list = content_tag(:ol, raw(crumbs.flatten.map{|li| li.mb_chars}.join), class: 'breadcrumb') | ||
content_tag(:nav, crumb_list, id: 'breadcrumbs', class: 'col-md-12') | ||
end | ||
|
||
def flash_messages(opts = {}) | ||
ignore_types = ["order_completed"].concat(Array(opts[:ignore_types]).map(&:to_s) || []) | ||
|
||
flash.each do |msg_type, text| | ||
unless ignore_types.include?(msg_type) | ||
concat(content_tag :div, text, class: "alert alert-#{msg_type}") | ||
end | ||
end | ||
nil | ||
end | ||
|
||
def link_to_cart(text = nil) | ||
text = text ? h(text) : Spree.t('cart') | ||
css_class = nil | ||
|
||
if simple_current_order.nil? or simple_current_order.item_count.zero? | ||
text = "<span class='glyphicon glyphicon-shopping-cart'></span> #{text}: (#{Spree.t('empty')})" | ||
css_class = 'empty' | ||
else | ||
text = "<span class='glyphicon glyphicon-shopping-cart'></span> #{text}: (#{simple_current_order.item_count}) <span class='amount'>#{simple_current_order.display_total.to_html}</span>" | ||
css_class = 'full' | ||
end | ||
|
||
link_to text.html_safe, spree.cart_path, :class => "cart-info #{css_class}" | ||
end | ||
|
||
def taxons_tree(root_taxon, current_taxon, max_level = 1) | ||
return '' if max_level < 1 || root_taxon.children.empty? | ||
content_tag :div, class: 'list-group' do | ||
root_taxon.children.map do |taxon| | ||
css_class = (current_taxon && current_taxon.self_and_ancestors.include?(taxon)) ? 'list-group-item active' : 'list-group-item' | ||
link_to(taxon.name, seo_url(taxon), class: css_class) + taxons_tree(taxon, current_taxon, max_level - 1) | ||
end.join("\n").html_safe | ||
end | ||
end | ||
end | ||
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Spree | ||
class FrontendConfiguration < Preferences::Configuration | ||
preference :locale, :string, :default => Rails.application.config.i18n.default_locale | ||
preference :locale, :string, default: Rails.application.config.i18n.default_locale | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
...rap_frontend/install/install_generator.rb → ...ree_frontend/install/install_generator.rb
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
File renamed without changes.
File renamed without changes.
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.