Skip to content

Commit

Permalink
Fix venues table hyperlink
Browse files Browse the repository at this point in the history
  • Loading branch information
angelina-momin authored Sep 24, 2024
1 parent 6a763dc commit d93dcec
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions R/utils_render_table_venues.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ add_all_venues_hyperlink <- function(table){
!!col_names[["Venue"]] := paste0(
"[", !!sym(col_names[["Venue"]]), "](",
CONFIG$HYPERLINKS[["venues"]],
!!sym(col_names[["Type"]]), "/",
# Retrieving the plural venue types
CONFIG$VENUE_SUBCAT_PLURAL[[!!sym(col_names[["Type"]])]], "/",
venue_slug, "/)"
),

Expand All @@ -103,15 +104,17 @@ add_all_venues_hyperlink <- function(table){
!!sym(col_names[["no_codechecks"]]),
" [(see all checks)](",
CONFIG$HYPERLINKS[["venues"]],
!!sym(col_names[["Type"]]), "/",
# Retrieving the plural venue types
CONFIG$VENUE_SUBCAT_PLURAL[[!!sym(col_names[["Type"]])]], "/",
venue_slug, "/)"
),

# Generate venue type hyperlink
!!col_names[["Type"]] := paste0(
"[", stringr::str_to_title(!!sym(col_names[["Type"]])),
"](", CONFIG$HYPERLINKS[["venues"]],
!!sym(col_names[["Type"]]), "/)"
# Retrieving the plural venue types
CONFIG$VENUE_SUBCAT_PLURAL[[!!sym(col_names[["Type"]])]], "/)"
)
)

Expand Down Expand Up @@ -183,6 +186,9 @@ add_venue_type_hyperlink <- function(table, venue_type) {

venue_col_name <- paste(stringr::str_to_title(venue_type), "name")

# Making the venue type plural for consistency in URL
venue_type <- CONFIG$VENUE_SUBCAT_PLURAL[[venue_type]]

# Ensure slug_name exists (if not, generate it from the Venue column)
if (!"venue_slug" %in% colnames(table)) {
table <- table %>%
Expand Down

0 comments on commit d93dcec

Please sign in to comment.