]> git.immae.eu Git - perso/Denise/oms.git/commitdiff
Bouton importer fichier avec jolie image et import tout de suite
authorSandrine Caruso <sandrine.caruso@ens-cachan.org>
Fri, 19 Jun 2020 14:19:28 +0000 (16:19 +0200)
committerDenise sur Lya <sekhmet@lya>
Fri, 19 Jun 2020 14:28:00 +0000 (16:28 +0200)
static/icons/import.png [new file with mode: 0644]
static/requetes.js
static/style.css
templates/index.html

diff --git a/static/icons/import.png b/static/icons/import.png
new file mode 100644 (file)
index 0000000..e184925
Binary files /dev/null and b/static/icons/import.png differ
index b7e719abc713911494c624962df82ed33cd01c79..4442470ad43ad6d7fced5e2719e9535ac49ea28b 100644 (file)
@@ -103,3 +103,7 @@ function download_file(filename,mimetype,data) {
   document.body.removeChild(element);  
        
 }
   document.body.removeChild(element);  
        
 }
+
+function upload_file(data) {
+       document.getElementById('form_import_donnees').submit();
+}
\ No newline at end of file
index 97f20d92c0421fa70c403b6255b053bcb9a3926d..e2d42ffe63f4a848df7f07ce61d08fae3018e78c 100644 (file)
@@ -42,10 +42,40 @@ input[type="text"] {
        display: none;
 }
 
        display: none;
 }
 
-#import_donnees, #pref_graphique{
+#pref_graphique {
        display: none;
 }
 
        display: none;
 }
 
+#import_donnees label {
+    height: 128px;
+    display: inline-block;
+       cursor: pointer;
+       position: relative;
+}
+
+#import_donnees label img {
+    border-radius: 100%;
+    box-shadow: 0px 0px 10px #55f;
+}
+
+#import_donnees label .icon_legend {
+       position: absolute;
+       top: 50%;
+       left: 50%;
+       transform: translate(-50%,-50%);
+       width: 90%;
+       text-align: center;
+       opacity: 0.7;
+       line-height: 1.5;
+       background: rgba(256,256,256,0.5);
+}
+
+#import_donnees input {
+       opacity: 0;
+       position: absolute;
+       z-index: -1;
+}
+
 .bouton {
        text-decoration: underline;
 }
 .bouton {
        text-decoration: underline;
 }
index 3404f220895158c0c1cd123029d91e5049b42c90..3ca5eacf30f16bf0279f16e0839958d24a3c25b2 100644 (file)
@@ -6,19 +6,21 @@
 
 <h2>Données de l'enfant</h2>
 
 
 <h2>Données de l'enfant</h2>
 
-<h3>Importer un fichier </h3>
-<div class="bouton" onclick="affiche_cache('import_donnees',this)">Afficher</div>
+<!--<h3>Importer un fichier </h3>
+<div class="bouton" onclick="affiche_cache('import_donnees',this)">Afficher</div>-->
 <div id="import_donnees">
 <div id="import_donnees">
- <form action="/" method="post" enctype="multipart/form-data">
+ <form action="/" method="post" enctype="multipart/form-data" id="form_import_donnees">
 
 
 
 
 
 
-  <label for="fichier_donnees">Importer le fichier de données</label>
-  <input type="file" name="fichier_donnees">
-  <input type="submit" name="valider_fichier" value="Charger les données">
+  <label for="fichier_donnees">
+       <img src="static/icons/import.png">
+       <div class="icon_legend">Importer un fichier</div>
+  </label>
+  <input type="file" name="fichier_donnees" id="fichier_donnees" oninput="upload_file()">
+  <!--<input type="submit" name="valider_fichier" value="Charger les données">-->
 </form> 
 </div>
 </form> 
 </div>
-<hr>
 
 <form id="donnees_enfant">
        
 
 <form id="donnees_enfant">