Skip to content

Commit 3548b4e

Browse files
Fix hyperlinks postfix (#72)
* FIx non register hyperlinks * Bump version to 0.10.1
1 parent d93dcec commit 3548b4e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: codecheck
22
Title: Helper Functions for CODECHECK Project
3-
Version: 0.10.0
3+
Version: 0.10.1
44
Authors@R:
55
c(person(given = "Stephen",
66
family = "Eglen",

R/utils_render_register_htmls.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ generate_href <- function(filter, table_details, href_type) {
104104

105105
# Setting href for filters with subcategories
106106
if ("subcat" %in% names(table_details)){
107-
return(paste0(base_url, filter, "/", table_details[["subcat"]], "/", table_details[["slug_name"]], "/register", href_details$ext))
107+
subcat <- table_details[["subcat"]]
108+
# If subcat is venue type, we pluralize the venue names
109+
if (subcat %in% names(CONFIG$VENUE_SUBCAT_PLURAL)){
110+
subcat <- CONFIG$VENUE_SUBCAT_PLURAL[[subcat]]
111+
}
112+
return(paste0(base_url, filter, "/", subcat, "/", table_details[["slug_name"]], "/register", href_details$ext))
108113
}
109114

110115
# For filters without subcategories

0 commit comments

Comments
 (0)