diff options
-rw-r--r-- | static/icons/import.png | bin | 0 -> 19119 bytes | |||
-rw-r--r-- | static/requetes.js | 4 | ||||
-rw-r--r-- | static/style.css | 32 | ||||
-rw-r--r-- | templates/index.html | 16 |
4 files changed, 44 insertions, 8 deletions
diff --git a/static/icons/import.png b/static/icons/import.png new file mode 100644 index 0000000..e184925 --- /dev/null +++ b/static/icons/import.png | |||
Binary files 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) { | |||
103 | document.body.removeChild(element); | 103 | document.body.removeChild(element); |
104 | 104 | ||
105 | } | 105 | } |
106 | |||
107 | function upload_file(data) { | ||
108 | document.getElementById('form_import_donnees').submit(); | ||
109 | } \ 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"] { | |||
42 | display: none; | 42 | display: none; |
43 | } | 43 | } |
44 | 44 | ||
45 | #import_donnees, #pref_graphique{ | 45 | #pref_graphique { |
46 | display: none; | 46 | display: none; |
47 | } | 47 | } |
48 | 48 | ||
49 | #import_donnees label { | ||
50 | height: 128px; | ||
51 | display: inline-block; | ||
52 | cursor: pointer; | ||
53 | position: relative; | ||
54 | } | ||
55 | |||
56 | #import_donnees label img { | ||
57 | border-radius: 100%; | ||
58 | box-shadow: 0px 0px 10px #55f; | ||
59 | } | ||
60 | |||
61 | #import_donnees label .icon_legend { | ||
62 | position: absolute; | ||
63 | top: 50%; | ||
64 | left: 50%; | ||
65 | transform: translate(-50%,-50%); | ||
66 | width: 90%; | ||
67 | text-align: center; | ||
68 | opacity: 0.7; | ||
69 | line-height: 1.5; | ||
70 | background: rgba(256,256,256,0.5); | ||
71 | } | ||
72 | |||
73 | #import_donnees input { | ||
74 | opacity: 0; | ||
75 | position: absolute; | ||
76 | z-index: -1; | ||
77 | } | ||
78 | |||
49 | .bouton { | 79 | .bouton { |
50 | text-decoration: underline; | 80 | text-decoration: underline; |
51 | } | 81 | } |
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 @@ | |||
6 | 6 | ||
7 | <h2>Données de l'enfant</h2> | 7 | <h2>Données de l'enfant</h2> |
8 | 8 | ||
9 | <h3>Importer un fichier </h3> | 9 | <!--<h3>Importer un fichier </h3> |
10 | <div class="bouton" onclick="affiche_cache('import_donnees',this)">Afficher</div> | 10 | <div class="bouton" onclick="affiche_cache('import_donnees',this)">Afficher</div>--> |
11 | <div id="import_donnees"> | 11 | <div id="import_donnees"> |
12 | <form action="/" method="post" enctype="multipart/form-data"> | 12 | <form action="/" method="post" enctype="multipart/form-data" id="form_import_donnees"> |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | <label for="fichier_donnees">Importer le fichier de données</label> | 16 | <label for="fichier_donnees"> |
17 | <input type="file" name="fichier_donnees"> | 17 | <img src="static/icons/import.png"> |
18 | <input type="submit" name="valider_fichier" value="Charger les données"> | 18 | <div class="icon_legend">Importer un fichier</div> |
19 | </label> | ||
20 | <input type="file" name="fichier_donnees" id="fichier_donnees" oninput="upload_file()"> | ||
21 | <!--<input type="submit" name="valider_fichier" value="Charger les données">--> | ||
19 | </form> | 22 | </form> |
20 | </div> | 23 | </div> |
21 | <hr> | ||
22 | 24 | ||
23 | <form id="donnees_enfant"> | 25 | <form id="donnees_enfant"> |
24 | 26 | ||