supplier improvements

This commit is contained in:
2013-03-09 14:18:21 +01:00
parent 730f910881
commit cc13797f5a
53 changed files with 819 additions and 156 deletions
+19 -2
View File
@@ -58,14 +58,29 @@ module ApplicationHelper
current_user.try(:active_list_id)
end
def week_days
@week_days ||= %w[sunday monday tuesday wednesday thursday friday saturday].freeze # Do not allow changing this value
end
def current_supplier
#@current_supplier ||= ActiveDecorator::Decorator.instance.decorate(super)
@current_supplier ||= super
ActiveDecorator::Decorator.instance.decorate @current_supplier
@current_supplier
end
def no_content_given(model)
t('helpers.list.no_records')
content_tag(:p, t('helpers.list.no_records'), data: {t: 'helpers.list.no_records'})
end
def slider_image
image_tag('spinner.gif')
end
def spinner
image_tag('spinner.gif')
end
def show_boolean(bool)
t("general.boolean.boolean_#{bool.present? ? 'yes' : 'no'}")
end
@@ -90,7 +105,9 @@ module ApplicationHelper
script += (buffer.presence || value).to_s
end
script = script.call if script.respond_to?(:call)
script.present? ? (@onload_javascripts ||= []) << script : (@onload_javascripts || []).join(';')
script.sub!(/^<script[^>]+>/,'') if script
script.sub!(/<\/script>$/, '') if script
script.present? ? (@onload_javascripts ||= []) << script : (@onload_javascripts || []).join(';').html_safe
end
def mustache_template(template)