Highlight created/updated stock_article in StockArticle#index view
This commit is contained in:
parent
012327dd7c
commit
cdb87a8389
4 changed files with 11 additions and 3 deletions
|
@ -105,6 +105,10 @@ table {
|
||||||
background-color: @tableBackgroundAccent;
|
background-color: @tableBackgroundAccent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
td.main_info {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
tr.selected td {
|
tr.selected td {
|
||||||
background-color: @successBackground;
|
background-color: @successBackground;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%td= link_to stock_article.name, stock_article
|
%td= link_to stock_article.name, stock_article
|
||||||
%td= stock_article.quantity
|
%td= stock_article.quantity
|
||||||
%td= stock_article.quantity_ordered
|
%td= stock_article.quantity_ordered
|
||||||
%th= stock_article.quantity_available
|
%td.main_info= stock_article.quantity_available
|
||||||
%td= stock_article.unit
|
%td= stock_article.unit
|
||||||
%td= stock_article.price
|
%td= stock_article.price
|
||||||
%td= number_to_percentage stock_article.tax
|
%td= number_to_percentage stock_article.tax
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
// Handle more advanced DOM update after AJAX database manipulation.
|
// Handle more advanced DOM update after AJAX database manipulation.
|
||||||
// See publish/subscribe design pattern in /doc.
|
// See publish/subscribe design pattern in /doc.
|
||||||
(function() {
|
(function() {
|
||||||
|
$('#articles-tbody tr').removeClass('success');
|
||||||
|
|
||||||
var stock_article_row = $('<%= j(render(
|
var stock_article_row = $('<%= j(render(
|
||||||
:partial => 'stock_article',
|
:partial => 'stock_article',
|
||||||
:locals => {
|
:locals => {
|
||||||
:stock_article => @stock_article
|
:stock_article => @stock_article
|
||||||
}
|
}
|
||||||
)) %>');
|
)) %>').addClass('success');
|
||||||
|
|
||||||
$('#articles-tbody').prepend(stock_article_row);
|
$('#articles-tbody').prepend(stock_article_row);
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
// Handle more advanced DOM update after AJAX database manipulation.
|
// Handle more advanced DOM update after AJAX database manipulation.
|
||||||
// See publish/subscribe design pattern in /doc.
|
// See publish/subscribe design pattern in /doc.
|
||||||
(function() {
|
(function() {
|
||||||
|
$('#articles-tbody tr').removeClass('success');
|
||||||
|
|
||||||
var stock_article_row = $('<%= j(render(
|
var stock_article_row = $('<%= j(render(
|
||||||
:partial => 'stock_article',
|
:partial => 'stock_article',
|
||||||
:locals => {
|
:locals => {
|
||||||
:stock_article => @stock_article
|
:stock_article => @stock_article
|
||||||
}
|
}
|
||||||
)) %>');
|
)) %>').addClass('success');
|
||||||
|
|
||||||
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
|
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue