This repository was archived by the owner on May 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 11< div class ="width100 cursorDefault positionWrapper <% if(ob.status == 0){ %>hideableChild<% } %> ">
2- < % if (ob.unread) { %>
2+ < %
3+ var flagStatus = false;
4+ if(ob.transactionType == "purchases"){
5+ flagStatus = ob.status == 2 || ob.status > 3;
6+ } else if(ob.transactionType == "sales") {
7+ flagStatus = ob.status == 1 || ob.status > 2;
8+ } else {
9+ flagStatus = true;
10+ }
11+ if (ob.unread || flagStatus && ob.status_changed) { %>
312 < div class ="highlightRow "> </ div >
413 < % } %>
514 < div class ="rowItem padding20 ">
Original file line number Diff line number Diff line change @@ -287,8 +287,21 @@ module.exports = pageVw.extend({
287287
288288 if ( ! filterBy || filterBy == "all" ) {
289289 tabCollection . comparator = function ( model ) {
290- //add 1 so unread:zero doesn't get dropped from the front of the string when it's changed to a number by the -
291- return - ( String ( model . get ( "unread" ) + 1 ) + String ( model . get ( "timestamp" ) ) ) ;
290+ //order the collection so items that are unread or have status updates are first
291+ var status = model . get ( "status" ) ,
292+ flagStatus = false ;
293+
294+ //only use the status_changed if the status matters to that tab
295+ if ( tabName == "purchases" ) {
296+ flagStatus = status == 2 || status > 3 ;
297+ } else if ( tabName == "sales" ) {
298+ flagStatus = status == 1 || status > 2 ;
299+ } else {
300+ flagStatus = true ;
301+ }
302+
303+ var attentionVal = model . get ( "unread" ) > 0 || model . get ( "status_changed" ) && flagStatus ? "2" : "1" ;
304+ return - ( String ( attentionVal ) + model . get ( "timestamp" ) ) ;
292305 } ;
293306 tabCollection . sort ( ) ;
294307 }
You can’t perform that action at this time.
0 commit comments