Skip to content

Commit

Permalink
some fixes and gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Jan 7, 2019
1 parent 354614e commit 97e1979
Show file tree
Hide file tree
Showing 396 changed files with 1,087 additions and 447 deletions.
25 changes: 16 additions & 9 deletions R/cards.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#' @param zoomable Whether the card is zoomable. TRUE by default.
#' @param width Card width. 6 by default. See Bootstrap grid system. If NULL, the card is
#' full width.
#' @param overflow Whether to set up a x and y overflow. FALSE by default.
#' Useful in case the card contains large tables.
#'
#' @examples
#' if(interactive()){
Expand Down Expand Up @@ -51,7 +53,7 @@
tablerCard <- function(..., title = NULL, options = NULL, footer = NULL,
status = NULL, statusSide = c("top", "left"),
collapsible = TRUE, collapsed = FALSE, closable = TRUE,
zoomable = TRUE, width = 6) {
zoomable = TRUE, width = 6, overflow = FALSE) {

statusSide <- match.arg(statusSide)

Expand All @@ -67,6 +69,7 @@ tablerCard <- function(..., title = NULL, options = NULL, footer = NULL,

cardTag <- shiny::tags$div(
class = cardCl,
style = if (overflow) "max-height: 500px; overflow-y: auto;" else NULL,
if (!is.null(status)) shiny::tags$div(class = statusCl),
# header
if (!is.null(title)) {
Expand All @@ -77,7 +80,9 @@ tablerCard <- function(..., title = NULL, options = NULL, footer = NULL,
# card toolbox and other elements such as buttons, ...
shiny::tags$div(
class = "card-options",
if (!is.null(options)) options,
if (!is.null(options)) {
lapply(options, shiny::tagAppendAttributes, class = "mx-1")
},
if (collapsible) {
shiny::tags$a(
href = "#",
Expand Down Expand Up @@ -409,13 +414,15 @@ tablerBlogCard <- function(..., title = NULL, author = NULL, date = NULL, href =
class = "d-flex align-items-center pt-5 mt-auto",
shiny::tags$div(
class = "d-flex align-items-center px-2",
shiny::tagAppendAttributes(
tablerAvatar(
url = avatarUrl,
size = "md"
),
class = "mr-3"
),
if (!is.null(avatarUrl)) {
shiny::tagAppendAttributes(
tablerAvatar(
url = avatarUrl,
size = "md"
),
class = "mr-3"
)
},
shiny::tags$div(
shiny::tags$div(author),
htmltools::tags$small(class = "d-block text-muted", date)
Expand Down
2 changes: 1 addition & 1 deletion R/dashboardFooter.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tablerDashFooter <- function(..., copyrights = NULL) {
class = "col-auto ml-lg-auto",
shiny::tags$div(
class = "row align-items-center",
...
lapply(list(...), shiny::tagAppendAttributes, class = "mx-2")
)
)
)
Expand Down
44 changes: 26 additions & 18 deletions R/dashboardNavbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
tablerDashNav <- function(id, ..., src = NULL, navMenu) {
tablerDashNav <- function(id, ..., src = NULL, navMenu = NULL) {

headerTag <- shiny::tags$div(
class = "header py-4",
Expand All @@ -25,34 +25,42 @@ tablerDashNav <- function(id, ..., src = NULL, navMenu) {
shiny::img(src = src, class = "header-brand-img")
),
# navbar content
shiny::tags$div(class = "d-flex order-lg-2 ml-auto", ...),
shiny::tags$div(
class = "d-flex order-lg-2 ml-auto",
lapply(list(...), shiny::tagAppendAttributes, class = "mx-2")
),
# header toggle
shiny::tags$a(
href = "#",
class = "header-toggler d-lg-none ml-3 ml-lg-0",
`data-toggle` = "collapse",
`data-target` = paste0("#", id),
shiny::tags$span(class="header-toggler-icon")
)
if (!is.null(navMenu)) {
shiny::tags$a(
href = "#",
class = "header-toggler d-lg-none ml-3 ml-lg-0",
`data-toggle` = "collapse",
`data-target` = paste0("#", id),
shiny::tags$span(class="header-toggler-icon")
)
}
)
)
)

navTag <- shiny::tags$div(
class = "header collapse d-lg-flex p-0",
id = id,
navTag <- if (!is.null(navMenu)) {
shiny::tags$div(
class = "container",
class = "header collapse d-lg-flex p-0",
id = id,
shiny::tags$div(
class = "row align-items-center",
# navigation
class = "container",
shiny::tags$div(
class = "col-lg order-lg-first",
navMenu
class = "row align-items-center",
# navigation
shiny::tags$div(
class = "col-lg order-lg-first",
navMenu
)
)
)
)
)
}

shiny::tagList(headerTag, navTag)
}

Expand Down
Loading

0 comments on commit 97e1979

Please sign in to comment.