diff --git a/assets/css/styles.scss b/assets/css/styles.scss index 625fd3eb..183fa179 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -173,3 +173,45 @@ div.callout-caution .callout-icon::before { div.callout-important .callout-icon::before { background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgZmlsbD0iIzFjMjgzMyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjwhLS0hRm9udCBBd2Vzb21lIEZyZWUgNi41LjEgYnkgQGZvbnRhd2Vzb21lIC0gaHR0cHM6Ly9mb250YXdlc29tZS5jb20gTGljZW5zZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tL2xpY2Vuc2UvZnJlZSBDb3B5cmlnaHQgMjAyMyBGb250aWNvbnMsIEluYy4tLT48cGF0aCBkPSJNNDE2IDM5OC45YzU4LjUtNDEuMSA5Ni0xMDQuMSA5Ni0xNzQuOUM1MTIgMTAwLjMgMzk3LjQgMCAyNTYgMFMwIDEwMC4zIDAgMjI0YzAgNzAuNyAzNy41IDEzMy44IDk2IDE3NC45YzAgLjQgMCAuNyAwIDEuMXY2NGMwIDI2LjUgMjEuNSA0OCA0OCA0OGg0OFY0NjRjMC04LjggNy4yLTE2IDE2LTE2czE2IDcuMiAxNiAxNnY0OGg2NFY0NjRjMC04LjggNy4yLTE2IDE2LTE2czE2IDcuMiAxNiAxNnY0OGg0OGMyNi41IDAgNDgtMjEuNSA0OC00OFY0MDBjMC0uNCAwLS43IDAtMS4xek05NiAyNTZhNjQgNjQgMCAxIDEgMTI4IDBBNjQgNjQgMCAxIDEgOTYgMjU2em0yNTYtNjRhNjQgNjQgMCAxIDEgMCAxMjggNjQgNjQgMCAxIDEgMC0xMjh6Ii8+PC9zdmc+') !important; } + +/* table schedule */ + +.table-schedule { + font-size: 0.85em; + line-height: 1.8; +} + +.table-schedule tr:hover { + background-color: whitesmoke; +} + +.table-schedule table { + margin: 1em auto; +} + +.table-schedule .topic { + color: white; + font-weight: bold; + border-radius: 4px; + padding: 1px 4px; + background: #BDBDBD; +} + +.table-schedule .topic-dinner { + color: white; + font-weight: bold; + border-radius: 4px; + padding: 1px 4px; + background: #95b540; +} + +.table-schedule .marker { + color: $primary; + margin-left: 2px; + margin-right: 3px; +} + +.table-schedule td p { + margin-bottom: 0; + padding: 5px 0px; +} diff --git a/home_schedule.qmd b/home_schedule.qmd index c62773f7..6584fc52 100644 --- a/home_schedule.qmd +++ b/home_schedule.qmd @@ -24,8 +24,6 @@ library(readxl) library(here) schedule_message <- yaml::read_yaml(here("_quarto.yml"))$schedule_message -color_primary <- yaml::read_yaml(here("_quarto.yml"))$colors$primary - asst <- yaml::read_yaml("_quarto.yml")$assistant #' @description Add hover classes to assistants @@ -58,41 +56,37 @@ create_tooltip <- function(a, asst) { #| eval: true s <- readxl::read_xlsx("schedule.xlsx") %>% - # remove rows that are all NA - filter(if_any(everything(), ~ !is.na(.))) %>% - # missing values in date and room are filled - tidyr::fill(date, room, link_room, .direction = "down") %>% - # convert date characters to date objects - dplyr::mutate(date = format(as_datetime(date, format = "%d/%m/%Y"), "%d-%b-%Y")) %>% - dplyr::mutate(day = format(as_datetime(date, format = "%d-%b-%Y"), "%a")) %>% - dplyr::group_by(date) %>% - dplyr::mutate( - start_time = format(start_time, "%H:%M"), - # end_time = format(end_time, "%H:%M") - ) %>% - as.data.frame() %>% - dplyr::mutate(room = ifelse(is.na(link_room), room, paste0("", room, ""))) %>% - # create day label (with date, day, room) - dplyr::mutate(date = paste0("
",fa("fas fa-calendar"),"", date, "", "", day, "", "", fa("fas fa-location-dot"),"", room, "
")) %>% - # style topic - dplyr::mutate(topic = ifelse(tolower(topic) == "break" | tolower(topic) == "lunch", paste0("", topic, ""), topic)) %>% - dplyr::mutate(topic = ifelse(grepl("dinner",tolower(topic)), paste0("", topic, ""), topic)) %>% - dplyr::mutate(topic = ifelse(!startsWith(topic, "", topic, ""), topic)) %>% - # add links to topic - dplyr::mutate(topic = ifelse(is.na(link_slide), topic, paste0("", topic, "", fa("fas fa-file-powerpoint"), ""))) %>% - dplyr::mutate(topic = ifelse(is.na(link_lab), topic, paste0("", topic, "", fa("fas fa-file-lines"), ""))) %>% - dplyr::mutate(topic = ifelse(is.na(link_youtube), topic, paste0("", topic, "", fa("fab fa-youtube"),""))) %>% - dplyr::mutate(time = paste0(start_time, " - ", end_time)) %>% - dplyr::mutate(instructor = ifelse(is.na(instructor), "", instructor)) %>% - dplyr::mutate(assistant = ifelse(is.na(assistant), "", assistant)) %>% - dplyr::select(date, room, time, topic, instructor, assistant) + # remove rows that are all NA + filter(if_any(everything(), ~ !is.na(.))) %>% + # missing values in date and room are filled + tidyr::fill(date, room, link_room, .direction = "down") %>% + # convert date characters to date objects + dplyr::mutate(date = format(as_datetime(date, format = "%d/%m/%Y"), "%d-%b-%Y")) %>% + dplyr::mutate(day = format(as_datetime(date, format = "%d-%b-%Y"), "%a")) %>% + dplyr::group_by(date) %>% + dplyr::mutate(time = format(time, "%H:%M")) %>% + as.data.frame() %>% + dplyr::mutate(room = ifelse(is.na(link_room), room, paste0("", room, ""))) %>% + # create day label (with date, day, room) + dplyr::mutate(date = paste0("", fa("fas fa-calendar"), "", date, "", "", day, "", "", fa("fas fa-location-dot"), "", room, "
")) %>% + # style topic + dplyr::mutate(topic = ifelse(tolower(topic) == "break" | tolower(topic) == "lunch", paste0("", topic, ""), topic)) %>% + dplyr::mutate(topic = ifelse(grepl("dinner", tolower(topic)), paste0("", topic, ""), topic)) %>% + dplyr::mutate(topic = ifelse(!startsWith(topic, "", topic, ""), topic)) %>% + # add links to topic + dplyr::mutate(topic = ifelse(is.na(link_slide), topic, paste0("", topic, "", fa("fas fa-file-powerpoint"), ""))) %>% + dplyr::mutate(topic = ifelse(is.na(link_lab), topic, paste0("", topic, "", fa("fas fa-file-lines"), ""))) %>% + dplyr::mutate(topic = ifelse(is.na(link_youtube), topic, paste0("", topic, "", fa("fab fa-youtube"), ""))) %>% + dplyr::mutate(instructor = ifelse(is.na(instructor), "", instructor)) %>% + dplyr::mutate(assistant = ifelse(is.na(assistant), "", assistant)) %>% + dplyr::select(date, room, time, topic, instructor, assistant) if (all(is.na(s$assistant)) | all(s$assistant == "")) { - s$assistant <- NULL - cnames <- c("Time", "Topic", "Instructor") + s$assistant <- NULL + cnames <- c("Time", "Topic", "Instructor") } else { - s$assistant <- create_tooltip(s$assistant, asst) - cnames <- c("Time", "Topic", "Instructor", "Assistant") + s$assistant <- create_tooltip(s$assistant, asst) + cnames <- c("Time", "Topic", "Instructor", "Assistant") } ``` diff --git a/schedule.xlsx b/schedule.xlsx index d7cddff3..6b57659c 100644 Binary files a/schedule.xlsx and b/schedule.xlsx differ