update receive delta column + responsive css
This commit is contained in:
parent
56bd527a8b
commit
90c81de872
4 changed files with 36 additions and 13 deletions
|
|
@ -27,14 +27,27 @@ module OrdersHelper
|
|||
end
|
||||
|
||||
# can be article or article_price
|
||||
def pkg_helper(article, icon=true)
|
||||
# icon: `false` to not show the icon
|
||||
# soft_uq: `true` to hide unit quantity specifier on small screens
|
||||
# sensible in tables with multiple columns calling `pkg_helper`
|
||||
def pkg_helper(article, options={})
|
||||
return nil if article.unit_quantity == 1
|
||||
if icon
|
||||
"<i class='package'> × #{article.unit_quantity}</i>".html_safe
|
||||
uq_text = "× #{article.unit_quantity}"
|
||||
uq_text = "<span class='hidden-phone'>#{uq_text}</span>" if options[:soft_uq]
|
||||
if options[:icon].nil? or options[:icon]
|
||||
pkg_helper_icon(uq_text).html_safe
|
||||
else
|
||||
"<span class='package'> × #{article.unit_quantity}</span>".html_safe
|
||||
pkg_helper_icon(uq_text, tag: 'span').html_safe
|
||||
end
|
||||
end
|
||||
def pkg_helper_icon(c=nil, options={})
|
||||
options = {tag: 'i', class: ''}.merge(options)
|
||||
if c.nil?
|
||||
c = " "
|
||||
options[:class] += " icon-only"
|
||||
end
|
||||
"<#{options[:tag]} class='package #{options[:class]}'>#{c}</#{options[:tag]}>"
|
||||
end
|
||||
|
||||
def article_price_change_hint(order_article, gross=false)
|
||||
return nil if order_article.article.price == order_article.price.price
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue