Use different color for online/offline sessions (#1398)

* Use different color for online/offline sessions
* Compatible with night mode
This commit is contained in:
Raymond Nook 2020-04-30 05:09:31 -07:00 committed by GitHub
parent 4be9cea58b
commit 36a556ce06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,8 @@ function loadPlayerdeaths(json, error) {
}
function createAccordionTitle(i, session) {
return `<tr id="session_h_` + i + `" aria-controls="session_t_` + i + `" aria-expanded="false" class="clickable collapsed bg-teal" data-target="#session_t_` + i + `" data-toggle="collapse"><td>`
let style = session.start.includes("Online") ? 'bg-teal' : (window.localStorage.getItem('nightMode') == 'true' ? '' : 'bg-white');
return `<tr id="session_h_` + i + `" aria-controls="session_t_` + i + `" aria-expanded="false" class="clickable collapsed ` + style + `" data-target="#session_t_` + i + `" data-toggle="collapse"><td>`
+ session.name + (session.first_session ? ` <i title="Registered (First session)" class="far fa-calendar-plus"></i>` : ``) + `</td>`
+ `<td>` + session.start + `</td>`
+ `<td>` + session.length + `</td>`