From a86b28b2fac5e405868b6e2a0dc42fd41362efa7 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Wed, 5 Mar 2025 17:52:41 +0100 Subject: [PATCH] Show whether the running instance is for staging --- R/ui.R | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/R/ui.R b/R/ui.R index 0f3f57d..d93a7ef 100644 --- a/R/ui.R +++ b/R/ui.R @@ -1,6 +1,20 @@ #' Function for creating the main user interface. #' @noRd ui <- function(custom_dataset = NULL, show_api_docs = FALSE) { + title <- "Ubigen" + commit_text <- "" + + commit_file <- system.file("misc", "commit.txt", package = "ubigen") + if (file.exists(commit_file)) { + title <- "Ubigen (Staging)" + long_hash <- readLines(commit_file, warn = FALSE)[1] + short_hash <- substr(long_hash, 1, 7) + commit_text <- glue::glue( + ", commit {short_hash}" + ) + } + div( custom_css(), rclipboard::rclipboardSetup(), @@ -10,7 +24,7 @@ ui <- function(custom_dataset = NULL, show_api_docs = FALSE) { bootswatch = "united", primary = "#7d19bf" ), - title = "Ubigen", + title = title, tabPanel( "Explore", sidebarLayout( @@ -108,7 +122,8 @@ ui <- function(custom_dataset = NULL, show_api_docs = FALSE) { div( class = "footer", HTML(glue::glue( - "Ubigen version {packageVersion(\"ubigen\")}
Source code: ", + "Ubigen version {packageVersion(\"ubigen\")}{commit_text}
", + "Source code: ", "available online (GNU AGPL v3)
", "Citation: Manuscript in preparation"