From: Sandrine Caruso Date: Fri, 19 Jun 2020 14:19:28 +0000 (+0200) Subject: Bouton importer fichier avec jolie image et import tout de suite X-Git-Url: https://git.immae.eu/?p=perso%2FDenise%2Foms.git;a=commitdiff_plain;h=93ba28a72f0df1e113ad12736839b8c6e12de7ae;hp=9e4c51c76d337e1f8c757cd2f99a4eed615687b4 Bouton importer fichier avec jolie image et import tout de suite --- diff --git a/static/icons/import.png b/static/icons/import.png new file mode 100644 index 0000000..e184925 Binary files /dev/null and b/static/icons/import.png differ diff --git a/static/requetes.js b/static/requetes.js index b7e719a..4442470 100644 --- a/static/requetes.js +++ b/static/requetes.js @@ -103,3 +103,7 @@ function download_file(filename,mimetype,data) { document.body.removeChild(element); } + +function upload_file(data) { + document.getElementById('form_import_donnees').submit(); +} \ No newline at end of file diff --git a/static/style.css b/static/style.css index 97f20d9..e2d42ff 100644 --- a/static/style.css +++ b/static/style.css @@ -42,10 +42,40 @@ input[type="text"] { display: none; } -#import_donnees, #pref_graphique{ +#pref_graphique { 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; } diff --git a/templates/index.html b/templates/index.html index 3404f22..3ca5eac 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,19 +6,21 @@

Données de l'enfant

-

Importer un fichier

-
Afficher
+
-
+ - - - + + +
-