Merge branch 'master' into fresh-flow

Conflicts:
	app/assets/stylesheets/bootstrap_and_overrides.css.less
This commit is contained in:
wvengen 2013-12-18 17:03:26 +01:00
commit 2b511ee559
96 changed files with 1389 additions and 1556 deletions

View file

@ -84,8 +84,8 @@ module ApplicationHelper
i18nopts = options.select {|a| !['short'].include?(a) }
s = model.human_attribute_name(attribute, i18nopts)
if options[:short]
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({defaults: ''}))
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.empty?
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({fallback: true, default: ''}))
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.blank?
end
s
end

View file

@ -25,13 +25,4 @@ module DeliveriesHelper
return output.html_safe
end
def stock_article_price_hint(stock_article)
t('simple_form.hints.stock_article.edit_stock_article.price',
:stock_article_copy_link => link_to(t('.copy_stock_article'),
copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => stock_article.id),
:remote => true
)
)
end
end

View file

@ -7,13 +7,20 @@ module GroupOrdersHelper
}.join("\n")
end
def link_to_ordering(order, options = {})
path = if group_order = order.group_order(current_user.ordergroup)
edit_group_order_path(group_order, :order_id => order.id)
else
new_group_order_path(:order_id => order.id)
end
link_to order.name, path, options
# Returns a link to the page where a group_order can be edited.
# If the option :show is true, the link is for showing the group_order.
def link_to_ordering(order, options = {}, &block)
group_order = order.group_order(current_user.ordergroup)
path = if options[:show] and group_order
group_order_path(group_order)
elsif group_order
edit_group_order_path(group_order, :order_id => order.id)
else
new_group_order_path(:order_id => order.id)
end
options.delete(:show)
name = block_given? ? capture(&block) : order.name
path ? link_to(name, path, options) : name
end
# Return css class names for order result table
@ -36,4 +43,4 @@ module GroupOrdersHelper
{group_order_article: goa, quantity: quantity, tolerance: tolerance, result: result, sub_total: sub_total}
end
end
end

View file

@ -7,11 +7,20 @@ module StockitHelper
def link_to_stock_change_reason(stock_change)
if stock_change.delivery_id
link_to t('.delivery'), supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery)
link_to Delivery.model_name.human, supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery)
elsif stock_change.order_id
link_to t('.order'), order_path(stock_change.order)
link_to Order.model_name.human, order_path(stock_change.order)
elsif stock_change.stock_taking_id
link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking)
link_to StockTaking.model_name.human, stock_taking_path(stock_change.stock_taking)
end
end
def stock_article_price_hint(stock_article)
t('simple_form.hints.stock_article.edit_stock_article.price',
:stock_article_copy_link => link_to(t('.copy_stock_article'),
stock_article_copy_path(stock_article),
:remote => true
)
)
end
end

View file

@ -13,4 +13,8 @@ module TasksHelper
title: I18n.t('helpers.tasks.required_users', :count => task.still_required_users)
end
end
def task_title(task)
I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration)
end
end