Fixed setting of colors for special JO rows. #674
This commit is contained in:
parent
fe0243a4cc
commit
a67ec1ec11
2 changed files with 104 additions and 99 deletions
|
|
@ -157,13 +157,13 @@ span.has-danger,
|
|||
|
||||
.m-table__row--is_vip td {
|
||||
background-color: #ffff00 !important;
|
||||
color: #fff !important;
|
||||
color: #414a4c !important;
|
||||
}
|
||||
|
||||
.m-table__row--is_vip td > span,
|
||||
.m-table__row--is_vip td > span a,
|
||||
.m-table__row--is_vip td > span a i {
|
||||
color: #fff !important;
|
||||
color: #414a4c !important;
|
||||
}
|
||||
|
||||
.m-table__row--is_emergency td {
|
||||
|
|
|
|||
|
|
@ -67,24 +67,11 @@
|
|||
},
|
||||
rows: {
|
||||
beforeTemplate: function (row, data, index) {
|
||||
// TODO: create function getRowColor that will return
|
||||
// what class to display
|
||||
if (data.is_vip) {
|
||||
console.log('is vip');
|
||||
$(row).addClass('m-table__row--is_vip');
|
||||
}
|
||||
if ($(row).hasClass('m-table__row--is_vip') == false) {
|
||||
if (data.flag_advance) {
|
||||
$(row).addClass('m-table__row--danger');
|
||||
}
|
||||
|
||||
if (data.is_mobile) {
|
||||
$(row).addClass('m-table__row--is_mobile');
|
||||
}
|
||||
if (data.is_emergency) {
|
||||
console.log('is emergency');
|
||||
$(row).addClass('m-table__row--is_emergency');
|
||||
}
|
||||
var attribute = getRowAttribute(data);
|
||||
// check if we have to apply a background color for the row
|
||||
if (attribute) {
|
||||
var row_class = "m-table__row--" + attribute;
|
||||
$(row).addClass(row_class);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -146,5 +133,23 @@
|
|||
table.reload();
|
||||
}, {{ table_refresh_rate }});
|
||||
});
|
||||
|
||||
function getRowAttribute(data) {
|
||||
if (data.is_vip) {
|
||||
return 'is_vip';
|
||||
}
|
||||
if (data.is_emergency) {
|
||||
return 'is_emergency';
|
||||
}
|
||||
if (data.flag_advance) {
|
||||
return 'danger';
|
||||
}
|
||||
if (data.is_mobile) {
|
||||
return 'is_mobile';
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue