Show whether the running instance is for staging

This commit is contained in:
Elias Projahn 2025-03-05 17:52:41 +01:00
parent 414dba5693
commit a86b28b2fa

19
R/ui.R
View file

@ -1,6 +1,20 @@
#' Function for creating the main user interface. #' Function for creating the main user interface.
#' @noRd #' @noRd
ui <- function(custom_dataset = NULL, show_api_docs = FALSE) { 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 <a href=\"https://gitlab.uni-rostock.de/ep135/ubigen/-/commit/",
"{long_hash}\" target=\"_blank\"><code>{short_hash}</code></a>"
)
}
div( div(
custom_css(), custom_css(),
rclipboard::rclipboardSetup(), rclipboard::rclipboardSetup(),
@ -10,7 +24,7 @@ ui <- function(custom_dataset = NULL, show_api_docs = FALSE) {
bootswatch = "united", bootswatch = "united",
primary = "#7d19bf" primary = "#7d19bf"
), ),
title = "Ubigen", title = title,
tabPanel( tabPanel(
"Explore", "Explore",
sidebarLayout( sidebarLayout(
@ -108,7 +122,8 @@ ui <- function(custom_dataset = NULL, show_api_docs = FALSE) {
div( div(
class = "footer", class = "footer",
HTML(glue::glue( HTML(glue::glue(
"Ubigen version {packageVersion(\"ubigen\")}<br>Source code: ", "Ubigen version {packageVersion(\"ubigen\")}{commit_text}<br>",
"Source code: ",
"<a href=\"https://gitlab.uni-rostock.de/ep135/ubigen/\" ", "<a href=\"https://gitlab.uni-rostock.de/ep135/ubigen/\" ",
"target=\"blank\">available online</a> (GNU AGPL v3)<br>", "target=\"blank\">available online</a> (GNU AGPL v3)<br>",
"Citation: Manuscript in preparation" "Citation: Manuscript in preparation"