Bug 40036: Add reason back to status column and add classes/data attributes

To test:
0. APPLY PATCH
1. Make a few AVs for SUGGEST ( reason ) and SUGGEST_STATUS ( status ).
2. Make some new suggestions and give them new statues w/ a reason.
3. The reason should display, in parentheses, in the status column.
4. There should be a status class and a reason class for each.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 35baa3ec46)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Lucas Gass 2025-05-30 14:28:23 +00:00 committed by Paul Derscheid
parent ca2ff9b46b
commit c5ff343c2c
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 13 additions and 8 deletions

View File

@ -1490,14 +1490,19 @@
searchable: false,
orderable: true,
render: function (data, type, row, meta) {
if(row.status === 'ASKED') return '<span>%s</span>'.format(_("Pending"));
if(row.status === 'ACCEPTED') return '<span>%s</span>'.format(_("Accepted"));
if(row.status === 'ORDERED') return '<span>%s</span>'.format(_("Ordered"));
if(row.status === 'REJECTED') return '<span>%s</span>'.format(_("Rejected"));
if(row.status === 'CHECKED') return '<span>%s</span>'.format(_("Checked"));
if(row.status === 'AVAILABLE') return '<span>%s</span>'.format(_("Available"));
if(row._strings.status.str) return '<span>%s</span>'.format(row._strings.status.str);
return '<span>%s</span>'.format(_("Status unknown"));
let node = '';
if(row.status === 'ASKED') node += '<span class="status asked">%s</span>'.format(_("Pending"));
else if(row.status === 'ACCEPTED') node += '<span class="status accepted">%s</span>'.format(_("Accepted"));
else if(row.status === 'ORDERED') node += '<span class="status ordered">%s</span>'.format(_("Ordered"));
else if(row.status === 'REJECTED') node += '<span class="status rejected">%s</span>'.format(_("Rejected"));
else if(row.status === 'CHECKED') node += '<span class="status checked">%s</span>'.format(_("Checked"));
else if(row.status === 'AVAILABLE') node += '<span class="status available">%s</span>'.format(_("Available"));
else if(row._strings.status.str) node += '<span class="status '+ row.status +'">%s</span>'.format(row._strings.status.str);
else node += '<span class="status unknown">%s</span>'.format(_("Status unknown"));
if ( row.reason ) {
node += '<div class="reason" data-reason="'+row.reason+'">('+ row.reason +')</div>';
}
return node;
},
},
{