diff --git a/readme.md b/readme.md index 63a8e99..fb65969 100644 --- a/readme.md +++ b/readme.md @@ -1,31 +1,44 @@ ## Info -### Documentation de riot : + +### Probleme connu +```text +Section : Ingenieur, Ecole de commerce, Tout ce qui commence par "Formation" +Raison : Le model d'envoie de donnees ne prends pas en charge plus de 3 sections (changer les fonctions getDataN() ``` + +### IMPORTANT +```text +Si ca ne s'affiche pas dans la milli seconde, pas besoin de forcer le boutton, +faut juste attendre que le MVC receptionne les donnees. +``` + +### Documentation de riot : +```http request https://riot.js.org/documentation/ ``` ### Git -``` +```http request https://dwarves.iut-fbleau.fr/gitiut/boudjeml/ParcoursupAnalytics ``` ## Pour compiler: ### Installer node js -``` +```http request https://nodejs.org/en/download/ ``` ### Run le serveur -``` +```shell npm start ``` ### Si vous avez des erreurs vous disant qu'un package n'est pas installé,
faites Structure : -``` +```shell npm install {nom_du_package} --save-dev ``` Exemple : -``` +```shell npm install webpack --save-dev ``` \ No newline at end of file diff --git a/src/components/global/api/View.js b/src/components/global/api/View.js index 3b5fb18..e9afada 100644 --- a/src/components/global/api/View.js +++ b/src/components/global/api/View.js @@ -1,11 +1,12 @@ import log from "./log"; +import * as riot from "riot"; export default class View { constructor() { this.title = document.getElementById("selector-top-title") this.zone = document.getElementById("selector-list-zone") - this.path = document.getElementById("location") - this.etab = document.getElementById("etab") + this.path = document.getElementById("loc") + this.etab = document.getElementById("etablanalytics-list") this.btn = document.getElementById("selector-top-btn") this.btn.onclick = () => { this.updateMenu(" ", "previous") @@ -29,25 +30,18 @@ export default class View { if(title || data) { data.forEach((e) => { - let li = document.createElement("li") - li.className = "selector-list-inner" - li.onclick = () => { + let elem = document.createElement("selectorfragment") + elem.onclick = () => { this.updateMenu(document.getElementById(`menu0-${e.name}`).innerText, "next") } - let name = document.createElement("a") - name.innerText = e.name - name.id = `menu0-${e.name}` - name.className = "selector-list-names" + this.zone.appendChild(elem) - let count = document.createElement("span") - count.innerText = e.count - count.className = "selector-list-counts" - - li.appendChild(name) - li.appendChild(count) - - this.zone.appendChild(li) + riot.mount(elem, { + name: e.name, + count: e.count, + idd: `menu0-${e.name}` + }, "selectorfragment") }) } @@ -59,7 +53,14 @@ export default class View { * @param { string[] } path Chemin courant. * */ renderPath(path) { - this.path.innerText = `${path[0]} / ${path[1]} / ${path[2]}` + this.path.innerHTML = "" + let elem = document.createElement("locfragment") + this.path.appendChild(elem) + + riot.mount(elem, { + msg: path.filter(Boolean).join(" ► ") + }, "locfragment") + log("Loc->View", `Chemin change ${path}`) } @@ -69,13 +70,13 @@ export default class View { * */ renderEtab(data) { this.etab.innerHTML = - "" + + "" + " Nom" + " Ville" + - " Dept" + + " Departement" + " Moyenne" + " Selectivite" + - "" + "" data.forEach((e) => { let etab = e.fields.g_ea_lib_vx diff --git a/src/components/global/etablanalytics/etablanalytics.riot b/src/components/global/etablanalytics/etablanalytics.riot index 1febc39..1464c46 100644 --- a/src/components/global/etablanalytics/etablanalytics.riot +++ b/src/components/global/etablanalytics/etablanalytics.riot @@ -1,6 +1,6 @@ -
- +
+
- + diff --git a/src/components/global/generalytics/generalytics.riot b/src/components/global/generalytics/generalytics.riot index d2e9962..0d9fd20 100644 --- a/src/components/global/generalytics/generalytics.riot +++ b/src/components/global/generalytics/generalytics.riot @@ -2,6 +2,7 @@ - +
+ + \ No newline at end of file diff --git a/src/components/global/loc/locfragment.riot b/src/components/global/loc/locfragment.riot new file mode 100644 index 0000000..5d1bee9 --- /dev/null +++ b/src/components/global/loc/locfragment.riot @@ -0,0 +1,18 @@ + + + + { this.props.msg } + + + \ No newline at end of file diff --git a/src/components/global/selector/selector.riot b/src/components/global/selector/selector.riot index 96935a5..ea4f488 100644 --- a/src/components/global/selector/selector.riot +++ b/src/components/global/selector/selector.riot @@ -53,58 +53,6 @@ display: flex; flex-direction: column; } - - #selector - #selector-list-container - #selector-list-zone - .selector-list-inner { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - justify-content: space-between; - font-weight: bold; - list-style-type: none; - } - - #selector - #selector-list-container - #selector-list-zone - .selector-list-inner - .selector-list-names { - text-decoration: none; - color: white; - justify-self: center; - padding: 4px; - } - - #selector - #selector-list-container - #selector-list-zone - .selector-list-inner - .selector-list-names:hover { - background: #344D59; - cursor: pointer; - transition: 0.5s; - transform: scale(1.05); - } - - #selector - #selector-list-container - #selector-list-zone - .selector-list-inner - .selector-list-counts { - display: flex; - justify-content: center; - align-items: center; - color: white; - background: green; - padding: 3px; - text-align: center; - border-radius: 4px; - width: 4vw; - height: 2vw; - }
@@ -118,8 +66,7 @@
-
    -
+
\ No newline at end of file diff --git a/src/components/global/selector/selectorfragment.riot b/src/components/global/selector/selectorfragment.riot new file mode 100644 index 0000000..84bb5d3 --- /dev/null +++ b/src/components/global/selector/selectorfragment.riot @@ -0,0 +1,53 @@ + + + +
  • + { this.props.name } + { this.props.count } +
  • + + +
    \ No newline at end of file diff --git a/src/pages/home.riot b/src/pages/home.riot index c4deace..d692702 100644 --- a/src/pages/home.riot +++ b/src/pages/home.riot @@ -1,25 +1,25 @@ - - -
    +
    @@ -62,4 +46,15 @@
    + +
    Nom VilleDeptDepartement Moyenne Selectivite