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

38 lines
1.1 KiB
Text
Raw Permalink Normal View History

2013-10-03 23:21:53 +02:00
- title @stock_article.name
- content_for :javascript do
:javascript
$(function() {
// Subscribe to database changes.
// See publish/subscribe design pattern in /doc.
$(document).on('StockArticle#update', function(e) {
$.ajax({
url: '#{show_on_stock_article_update_stock_articles_path}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
});
2013-07-09 21:46:04 +02:00
2013-10-03 23:21:53 +02:00
.row-fluid
.span6
= render :partial => 'stock_article_details', :locals => {:stock_article => @stock_article}
2013-10-03 23:21:53 +02:00
.span6
%h2= t('.stock_changes')
%table.table.table-hover#stock_changes
%thead
%tr
%th= t '.datetime'
%th= t '.reason'
%th= t '.change_quantity'
%th= t '.new_quantity'
%tbody
- reversed_history = @stock_article.quantity_history.reverse
- @stock_changes.each_with_index do |stock_change, index|
%tr
%td= l stock_change.created_at
%td= link_to_stock_change_reason(stock_change)
%td= stock_change.quantity
%td= reversed_history[index]