diff --git a/DESCRIPTION b/DESCRIPTION index 0f5db81..ed2149b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,6 +14,9 @@ License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 +Imports: + shiny (>= 1.9.1), + bslib (>= 0.8.0) Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 6ae9268..636c8ad 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,5 @@ # Generated by roxygen2: do not edit by hand +export(run) +import(bslib) +import(shiny) diff --git a/R/ADSPlanner-package.R b/R/ADSPlanner-package.R new file mode 100644 index 0000000..5212db8 --- /dev/null +++ b/R/ADSPlanner-package.R @@ -0,0 +1,6 @@ +# This file is used to define the imports that will be updated by roxygen2 when running `devtools::document()`. + +#' @import shiny +#' @import bslib +NULL +#> NULL \ No newline at end of file diff --git a/R/main.R b/R/main.R deleted file mode 100644 index ee59e04..0000000 --- a/R/main.R +++ /dev/null @@ -1 +0,0 @@ -print("Bonjour INSA !") \ No newline at end of file diff --git a/R/run.R b/R/run.R new file mode 100644 index 0000000..477c703 --- /dev/null +++ b/R/run.R @@ -0,0 +1,12 @@ +library(shiny) + +source("R/ui.R") +source("R/server.R") + +#' @export +run <- function() { + runApp(shinyApp( + ui = ui, + server = server + )) +} \ No newline at end of file diff --git a/R/server.R b/R/server.R new file mode 100644 index 0000000..deab7d2 --- /dev/null +++ b/R/server.R @@ -0,0 +1,10 @@ +library(shiny) + +server <- function(input, output) { + output$download <- downloadHandler( + filename = "affectations.xlsx", + content = function(file) { + write("Not implemented yet.", file) + } + ) +} \ No newline at end of file diff --git a/R/ui.R b/R/ui.R new file mode 100644 index 0000000..83a9ddd --- /dev/null +++ b/R/ui.R @@ -0,0 +1,26 @@ +library(bslib) + +ui <- page_sidebar( + title = "ADS-Planner", + sidebar = sidebar( + width = 350, + card( + fileInput("file", "Résultats du sondage", accept = c(".xlsx", ".ods"), buttonLabel = "Parcourir...", placeholder = "Aucun fichier", multiple = FALSE), + ), + downloadButton("download", "Télécharger affectations"), + ), + navset_tab( + nav_panel( + "Visualisation des choix", + "Not implemented yet.", + ), + nav_panel( + "Sans réponse", + "Not implemented yet.", + ), + nav_panel( + "Affectations", + "Not implemented yet.", + ), + ), +) \ No newline at end of file diff --git a/README.md b/README.md index 88af7ee..24cddd8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,24 @@ A tool to distribute INSA students into ADS sessions. +## Installing & Running + +To install (or update) the ADS-Planner R package, simply clone this repo, start an interactive R session from the root folder and run : + +```R +install.packages(".",repos=NULL) +``` + +And to run the app : + +```R +ADSPlanner::run() +``` + +The web interface should open automatically. If it doesn't, you can open the link next to `Browsing` in the command output. + +For development purposes, the app can be started more simply by running `shiny::runApp("R")` from the root of the repo. + ## ADS ADS (Action Découverte des Spécialités) is a teaching module aimed at presenting the specialties of the engineering program at INSA to students in the preparatory program. This module consists of three sessions. Each student is asked to rank the specialties by preference to assign them to the three half-day sessions.