foodsoft/app/views/orders/show.html.haml

101 lines
4.1 KiB
Text
Raw Normal View History

- title t('.title', name: @order.name)
2009-01-06 11:49:19 +01:00
- content_for :javascript do
:javascript
function activate_search(view, placeholder) {
new List(document.body, {
valueNames: ['name'],
engine: 'unlist',
plugins: [
['reset', {highlightClass: 'btn-primary'}],
['delay', {delayedSearchTime: 500}],
],
// make large pages work too (as we don't have paging)
page: 10000,
indexAsync: true
});
$('#query').attr('placeholder', placeholder);
}
$(function() {
activate_search('default', '#{j t('.search_placeholder.default')}');
});
.well
%button{type: "button", class: "close", data: {dismiss: 'alert'}}= t('ui.marks.close').html_safe
%p
#{@order.state.capitalize} order from
#{link_to @order.supplier.name, supplier_path(@order.supplier)}
created by #{show_user_link @order.created_by},
open from #{format_time @order.starts} until #{format_time @order.ends}.
%br
%abbr{title: @order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')}
#{@order.group_orders.count} #{Ordergroup.model_name.human count: @order.group_orders.count}
ordered #{@order.order_articles.ordered.count} articles with a total value of
#{number_to_currency(@order.sum(:net))} / #{number_to_currency(@order.sum(:gross))} (net / gross).
- if @note.present?
%p
= heading_helper(Order, :note) + ': '
= @order.note
-# Proposing to remove this warning, since there is a valid period when the order is not settled yet.
-# Perhaps when the pickup day has been, or when the order isn't settled a week after it has been
-# closed, this message could be shown.
-#- if @order.finished? and !@order.closed?
.alert.alert-warning
2013-12-18 16:04:30 +01:00
= t '.warn_not_closed'
.well.well-small
.btn-toolbar
.form-search.pull-right
.input-append
= text_field_tag :query, params[:query], class: 'search-query delayed-search resettable'
%button.add-on.btn.reset-search{:type => :button, :title => t('.search_reset')}
%i.icon.icon-remove
.btn-toolbar
.btn-group.view_buttons
= update_articles_link @order, t('.articles'), :default, class: 'btn active'
= update_articles_link @order, t('.sort_group'), :groups, class: 'btn'
= update_articles_link @order, t('.sort_article'), :articles, class: 'btn'
- unless @order.open?
.btn-group
= link_to '#', class: 'btn dropdown-toggle', data: {toggle: 'dropdown'} do
= t '.download.title'
%span.caret
%ul.dropdown-menu
%li= order_pdf(@order, :groups, t('.download.group_pdf'))
%li= order_pdf(@order, :articles, t('.download.article_pdf'))
%li= order_pdf(@order, :matrix, t('.download.matrix_pdf'))
%li= order_pdf(@order, :fax, t('.download.fax_pdf'))
%li= link_to t('.download.fax_txt'), order_path(@order, format: :txt), {title: t('.download.download_file')}
- if @order.open?
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
confirm: t('.confirm_end', order: @order.name)
= link_to t('ui.edit'), edit_order_path(@order), class: 'btn'
- elsif not @order.closed? and not @order.stockit?
-# TODO btn-success class only if not received before
= link_to t('orders.index.action_receive'), receive_order_path(@order), class: 'btn btn-success'
- unless @order.closed?
= link_to t('ui.delete'), @order, confirm: t('.confirm_delete'), method: :delete,
class: 'btn btn-danger'
-# unless @order.open?
%ul.nav.nav-pills
%li= update_articles_link(@order, t('.articles'), :default)
%li= update_articles_link(@order, t('.sort_group'), :groups)
%li= update_articles_link(@order, t('.sort_article'), :articles)
%li= link_to t('.comments_link'), '#comments'
%section#articles_table
= render 'articles', order: @order
2009-01-06 11:49:19 +01:00
%h2= t '.comments.title'
#comments
= render partial: 'shared/comments', locals: { comments: @order.comments }
#new_comment= render partial: 'order_comments/form', locals: { order_comment: @order.comments.build(user: current_user)}
= link_to_top