|
|
|
@ -4,6 +4,21 @@ this.getStatusMeta = (status) => {
|
|
|
|
|
else return status; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const getOrderString = function(order) { |
|
|
|
|
return order ? 'asc' : 'desc'; |
|
|
|
|
} |
|
|
|
|
this.createSortableTitle = function(item, display, defaultOrder) { |
|
|
|
|
const isCurrent = curSort === item; |
|
|
|
|
console.log(isCurrent ? (!curOrder) : defaultOrder) |
|
|
|
|
const url = syzoj.utils.makeUrl(req, |
|
|
|
|
Object.assign({}, req.query, { |
|
|
|
|
sort: item, |
|
|
|
|
order: getOrderString(isCurrent ? (!curOrder) : defaultOrder) |
|
|
|
|
})); |
|
|
|
|
const triangle = isCurrent ? `<i class="${curOrder ? "angle up" : "angle down"} icon"></i>` : ""; |
|
|
|
|
return `<a href="${url}">${display}${triangle}</a>`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.isPending = (status) => { |
|
|
|
|
let pending = [ |
|
|
|
|
'Waiting', |
|
|
|
|