Skip to content

Commit

Permalink
Intitulé sur plusieurs lignes grace à un vecteur dans le footer égale…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
jengelaere committed Aug 23, 2023
1 parent ff3758a commit 328ad1e
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 96 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Imports:
XML (>= 3.99.0.10)
Suggests:
desc (>= 1.4.1),
dplyr,
DT (>= 0.23),
knitr (>= 1.39),
readxl (>= 1.4.0),
Expand All @@ -46,7 +47,7 @@ Suggests:
withr (>= 2.5.0)
VignetteBuilder:
knitr
Config/fusen/version: 0.5.0.9001
Config/fusen/version: 0.5.1
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Expand Down
63 changes: 42 additions & 21 deletions R/footer_dsfr.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WARNING - Generated by {fusen} from /dev/flat_composants/flat_footer.Rmd: do not edit by hand
# WARNING - Generated by {fusen} from dev/flat_composants/flat_footer.Rmd: do not edit by hand

#' footer_dsfr

Expand All @@ -11,7 +11,7 @@
#'
#' Il est possible d'ajouter des url supplémentaires dans le corps et le bas du pied de page.
#'
#' @param intitule la partie "intitule" du bloc marque
#' @param intitule la partie "intitule" du bloc marque. Utiliser un `shiny::tags$span()`pour mettre l'intitulé sur plusieurs lignes ou un vecteur.
#' @param description un texte de présentation - optionnel
#' @param accessibilite le type d'accessibilité (non/partiellement/totalement conforme)
#' @param lien_accessibilite lien url vers l'accessibilite
Expand All @@ -30,7 +30,7 @@
#' shinyApp(
#' ui = fluidPage_dsfr(
#' footer = footer_dsfr(
#' intitule = "Territoire",
#' intitule = c("Territoire", "Service"),
#' description = "une description",
#' accessibilite = "non",
#' add_extra_url_body = footer_extra_url_body_dsfr(
Expand All @@ -46,7 +46,7 @@
#' )
#' ),
#' add_extra_url_bottom = footer_extra_url_bottom_dsfr(
#'
#'
#' footer_li_dsfr(
#' href = "https://siteinternet.fr",
#' titre = "siteinternet.fr.fr - nouvelle fenêtre",
Expand Down Expand Up @@ -81,8 +81,8 @@
#' )
#' }
footer_dsfr <- function(
intitule = NULL ,
description = NULL ,
intitule = NULL,
description = NULL,
accessibilite = "non",
lien_accessibilite = "#",
lien_mentions_legales = "#",
Expand All @@ -92,27 +92,30 @@ footer_dsfr <- function(
add_extra_url_bottom = NULL) {


if ( isFALSE(accessibilite %in% c("non", "partiellement", "totalement conforme"))){
stop("l accessibilite doit etre 'non', 'partiellement' ou 'totalement conforme'")
}

assertthat::assert_that(is.character(lien_accessibilite))
assertthat::assert_that(is.character(lien_mentions_legales))
assertthat::assert_that(is.character(lien_donnees_personnelles))
assertthat::assert_that(is.character(lien_gestion_cookies))


if ( isFALSE(accessibilite %in% c("non", "partiellement", "totalement conforme"))){
stop("l accessibilite doit etre 'non', 'partiellement' ou 'totalement conforme'")
}

assertthat::assert_that(is.character(lien_accessibilite))
assertthat::assert_that(is.character(lien_mentions_legales))
assertthat::assert_that(is.character(lien_donnees_personnelles))
assertthat::assert_that(is.character(lien_gestion_cookies))

if(is.vector(intitule) & length(intitule) > 1){
intitule <- span(HTML(paste0(intitule, collapse = "<br/>")))
}


footer_dsfr_template(
intitule = intitule,
description = description,
footer_body = add_extra_url_body,
footer_bottom = add_extra_url_bottom,
accessibilite = accessibilite,
lien_accessibilite = lien_accessibilite,
lien_mentions_legales = lien_mentions_legales,
lien_donnees_personnelles = lien_donnees_personnelles,
lien_gestion_cookies = lien_gestion_cookies
accessibilite = accessibilite,
lien_accessibilite = lien_accessibilite,
lien_mentions_legales = lien_mentions_legales,
lien_donnees_personnelles = lien_donnees_personnelles,
lien_gestion_cookies = lien_gestion_cookies
)
}

Expand All @@ -137,6 +140,24 @@ footer_extra_url_body_dsfr <- function(...) {



#' footer_extra_url_bottom_dsfr
#'
#' Permet d'ajouter des liends/url dans le bas du pied de page
#'
#' @param ... d'autre liens de références (voir `footer_li_dsfr()`)
#'
#' @return html
#' @rdname footer_dsfr
#' @export
#' @examples
#' footer_extra_url_bottom_dsfr(footer_li_dsfr(href = "http://siteinternet.fr", texte = "siteinternet.fr"))
footer_extra_url_bottom_dsfr <-
function(...) {
tagList(...)

}


#' footer_li_dsfr
#'
#' Permet de créer la balise html pour ajouter un lien en fonction de sa destination (body/bottom)
Expand Down
115 changes: 66 additions & 49 deletions dev/config_fusen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ flat_actionButton.Rmd:
inflate:
flat_file: dev/flat_composants/flat_actionButton.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_checkBoxInput.Rmd:
path: dev/flat_composants/flat_checkBoxInput.Rmd
Expand All @@ -38,9 +38,9 @@ flat_checkBoxInput.Rmd:
inflate:
flat_file: dev/flat_composants/flat_checkBoxInput.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_convert_to_dsfr.Rmd:
path: dev/tools/flat_convert_to_dsfr.Rmd
Expand All @@ -57,9 +57,9 @@ flat_convert_to_dsfr.Rmd:
inflate:
flat_file: dev/tools/flat_convert_to_dsfr.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_fluidpage.Rmd:
path: dev/flat_composants/flat_fluidpage.Rmd
Expand All @@ -81,9 +81,26 @@ flat_fluidpage.Rmd:
pkg: shinygouv
flat_file: dev/flat_composants/flat_fluidpage.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_footer.Rmd:
path: dev/flat_composants/flat_footer.Rmd
state: active
R:
- R/footer_dsfr.R
- R/footer_dsfr_template.R
tests:
- tests/testthat/test-footer_dsfr.R
- tests/testthat/test-footer_dsfr_template.R
vignettes: []
inflate:
flat_file: dev/flat_composants/flat_footer.Rmd
vignette_name: .na
open_vignette: false
check: false
document: true
overwrite: ask
flat_header.Rmd:
path: dev/flat_composants/flat_header.Rmd
Expand All @@ -98,9 +115,9 @@ flat_header.Rmd:
inflate:
flat_file: dev/flat_composants/flat_header.Rmd
vignette_name: .na
open_vignette: no
check: no
document: yes
open_vignette: false
check: false
document: true
overwrite: ask
flat_modal.Rmd:
path: dev/flat_composants/flat_modal.Rmd
Expand All @@ -115,9 +132,9 @@ flat_modal.Rmd:
inflate:
flat_file: dev/flat_composants/flat_modal.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_navbarPage.Rmd:
path: dev/flat_composants/flat_navbarPage.Rmd
Expand All @@ -129,9 +146,9 @@ flat_navbarPage.Rmd:
pkg: shinygouv
flat_file: dev/flat_composants/flat_navbarPage.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_numericInput.Rmd:
path: dev/flat_composants/flat_numericInput.Rmd
Expand All @@ -148,9 +165,9 @@ flat_numericInput.Rmd:
inflate:
flat_file: dev/flat_composants/flat_numericInput.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_panels.Rmd:
path: dev/flat_composants/flat_panels.Rmd
Expand All @@ -167,9 +184,9 @@ flat_panels.Rmd:
inflate:
flat_file: dev/flat_composants/flat_panels.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_radioButtons.Rmd:
path: dev/flat_composants/flat_radioButtons.Rmd
Expand All @@ -188,9 +205,9 @@ flat_radioButtons.Rmd:
inflate:
flat_file: dev/flat_composants/flat_radioButtons.Rmd
vignette_name: .na
open_vignette: no
check: no
document: yes
open_vignette: false
check: false
document: true
overwrite: 'yes'
flat_radioGroupButtons.Rmd:
path: dev/flat_composants/flat_radioGroupButtons.Rmd
Expand All @@ -209,9 +226,9 @@ flat_radioGroupButtons.Rmd:
inflate:
flat_file: dev/flat_composants/flat_radioGroupButtons.Rmd
vignette_name: .na
open_vignette: no
check: no
document: yes
open_vignette: false
check: false
document: true
overwrite: 'yes'
flat_selectInput.Rmd:
path: dev/flat_composants/flat_selectInput.Rmd
Expand All @@ -230,9 +247,9 @@ flat_selectInput.Rmd:
inflate:
flat_file: dev/flat_composants/flat_selectInput.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_slider.Rmd:
path: dev/flat_composants/flat_slider.Rmd
Expand All @@ -244,9 +261,9 @@ flat_slider.Rmd:
pkg: shinygouv
flat_file: dev/flat_composants/flat_slider.Rmd
vignette_name: .na
open_vignette: yes
check: yes
document: yes
open_vignette: true
check: true
document: true
overwrite: ask
flat_toggleswitch.Rmd:
path: dev/flat_composants/flat_toggleswitch.Rmd
Expand All @@ -262,9 +279,9 @@ flat_toggleswitch.Rmd:
inflate:
flat_file: dev/flat_composants/flat_toggleswitch.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: ask
flat_tools.Rmd:
path: dev/tools/flat_tools.Rmd
Expand All @@ -282,20 +299,20 @@ flat_tools.Rmd:
inflate:
flat_file: dev/tools/flat_tools.Rmd
vignette_name: .na
open_vignette: yes
check: no
document: yes
open_vignette: true
check: false
document: true
overwrite: 'yes'
flat_withSpinner.Rmd:
path: dev/flat_composants/flat_withSpinner.Rmd
state: active
R: R/withspinner_dsfr.R
tests: tests/testthat/test-withspinner_dsfr.R
vignettes: []
vignettes: []
inflate:
flat_file: dev/flat_composants/flat_withSpinner.Rmd
vignette_name: .na
open_vignette: no
check: no
document: yes
open_vignette: false
check: false
document: true
overwrite: 'yes'
Loading

0 comments on commit 328ad1e

Please sign in to comment.