Highlight created/updated stock_article in StockArticle#index view

This commit is contained in:
Julius 2013-12-07 17:10:40 +01:00
parent 012327dd7c
commit cdb87a8389
4 changed files with 11 additions and 3 deletions

View file

@ -105,6 +105,10 @@ table {
background-color: @tableBackgroundAccent;
}
td.main_info {
font-weight: bold;
}
tr.selected td {
background-color: @successBackground;
}

View file

@ -2,7 +2,7 @@
%td= link_to stock_article.name, stock_article
%td= stock_article.quantity
%td= stock_article.quantity_ordered
%th= stock_article.quantity_available
%td.main_info= stock_article.quantity_available
%td= stock_article.unit
%td= stock_article.price
%td= number_to_percentage stock_article.tax

View file

@ -1,12 +1,14 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function() {
$('#articles-tbody tr').removeClass('success');
var stock_article_row = $('<%= j(render(
:partial => 'stock_article',
:locals => {
:stock_article => @stock_article
}
)) %>');
)) %>').addClass('success');
$('#articles-tbody').prepend(stock_article_row);
})();

View file

@ -1,12 +1,14 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function() {
$('#articles-tbody tr').removeClass('success');
var stock_article_row = $('<%= j(render(
:partial => 'stock_article',
:locals => {
:stock_article => @stock_article
}
)) %>');
)) %>').addClass('success');
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
})();