#' catch_area_site UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny NS tagList tags br uiOutput renderUI br div img
#' @importFrom shinydashboardPlus boxPlus
mod_catch_area_site_ui <- function(id) {
tagList(
br(),
br(),
uiOutput(NS(id, "catch_area_site"))
)
tagList(
br(),
br(),
boxPlus(
title = "Select dates and creel locations",
closable = FALSE,
solidHeader = FALSE,
collapsible = TRUE,
collapsed = FALSE,
width = 12,
enable_sidebar = TRUE,
sidebar_width = 25,
sidebar_start_open = TRUE,
sidebar_content = tags$div(
div(id = "rockfish_image", img(src = "www/copper_rockfish.png", width = "100%")),
br(),
br(),
br(),
mod_date_area_ui(NS(id, "date_area_ui")),
br(),
mod_creel_site_ui(NS(id,"creel_site_ui")),
br(),
mod_site_date_ui(NS(id, "site_date_ui"))
)#,
#leaflet::leafletOutput("site_map", height = "800px")
)
)
}
#' catch_area_site Server Function
#'
#' @noRd
mod_catch_area_site_server <- function(id, yrmn, site, sdate) {
moduleServer(id, function(input, output, session) {
ns <- session$ns
yrmn = mod_date_area_server("date_area_ui")
site = mod_creel_site_server("creel_site_ui", yrmn)
sdate = mod_site_date_server("site_date_ui", yrmn, site)
})
# Creel site select
output$catch_area_site = renderUI({
boxPlus(ns("catch_area_site"),
label = "Select the creel site(s)",
multiple = TRUE,
choices = creel_site_list(),
selected = creel_site_list()[1],
width = "100%",
options = pickerOptions(actionsBox = TRUE))
})
}
## To be copied in the UI
# mod_catch_area_site_ui("catch_area_site_ui_1")
## To be copied in the server
# callModule(mod_catch_area_site_server, "catch_area_site_ui_1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.