diff --git a/babel.cfg b/babel.cfg index 97ebeb8..a5056fe 100644 --- a/babel.cfg +++ b/babel.cfg @@ -1,2 +1,5 @@ +[extractors] +jinja2 = jinja2.ext:babel_extract + [python: partitioncloud/**.py] [jinja2: partitioncloud/templates/**.html] \ No newline at end of file diff --git a/partitioncloud/static/style/style.css b/partitioncloud/static/style/style.css index 49fccd5..53eb692 100644 --- a/partitioncloud/static/style/style.css +++ b/partitioncloud/static/style/style.css @@ -718,3 +718,44 @@ midi-player { border-radius: 5px; background-color: var(--color-crust); } + +/** Input[file] */ +.file-area { + position: relative; +} +.file-area input[type=file] { + position: absolute; + height: 100%; + top: 0; + left: 0; + right: 0; + bottom: 0; + opacity: 0; + cursor: pointer; +} + +.file-area .file-dummy { + padding: 30px; + background: var(--color-mantle); + border: 2px dashed var(--color-red); + text-align: center; + transition: background 0.3s ease-in-out; +} + +.file-area .file-dummy .success { + display: none; +} + +.file-area:hover > .file-dummy { + background: var(--color-surface0); +} + +.file-area input[type=file]:valid + .file-dummy { + border-color: var(--color-green); +} +.file-area input[type=file]:valid + .file-dummy .success { + display: inline-block; +} +.file-area input[type=file]:valid + .file-dummy .default { + display: none; +} \ No newline at end of file diff --git a/partitioncloud/templates/components/add_partition.html b/partitioncloud/templates/components/add_partition.html index 71567e8..b59f95e 100644 --- a/partitioncloud/templates/components/add_partition.html +++ b/partitioncloud/templates/components/add_partition.html @@ -7,7 +7,7 @@ {% if partition_uuid %} {% else %} -
+ {% include 'components/input_file.html' %} {% endif %} \ No newline at end of file diff --git a/partitioncloud/templates/components/input_file.html b/partitioncloud/templates/components/input_file.html new file mode 100644 index 0000000..669bc5d --- /dev/null +++ b/partitioncloud/templates/components/input_file.html @@ -0,0 +1,7 @@ +
+ +
+
{{ _("Your file is selected.") }}
+
{{ _("Select or drag & drop your file (pdf).") }}
+
+
\ No newline at end of file diff --git a/partitioncloud/translations/en/LC_MESSAGES/messages.po b/partitioncloud/translations/en/LC_MESSAGES/messages.po index 8bdb775..9930bc2 100644 --- a/partitioncloud/translations/en/LC_MESSAGES/messages.po +++ b/partitioncloud/translations/en/LC_MESSAGES/messages.po @@ -532,6 +532,14 @@ msgstr "lyrics" msgid "Add" msgstr "Add" +#: partitioncloud/templates/components/input_file.html:4 +msgid "Your file is selected." +msgstr "Your file is selected." + +#: partitioncloud/templates/components/input_file.html:5 +msgid "Select or drag & drop your file (pdf)." +msgstr "Select or drag & drop your file (pdf)." + #: partitioncloud/templates/groupe/index.html:8 #, python-format msgid "Add an album to group %(name)s" diff --git a/partitioncloud/translations/fr/LC_MESSAGES/messages.po b/partitioncloud/translations/fr/LC_MESSAGES/messages.po index 4b941b4..f9a4bc0 100644 --- a/partitioncloud/translations/fr/LC_MESSAGES/messages.po +++ b/partitioncloud/translations/fr/LC_MESSAGES/messages.po @@ -538,6 +538,14 @@ msgstr "paroles" msgid "Add" msgstr "Ajouter" +#: partitioncloud/templates/components/input_file.html:4 +msgid "Your file is selected." +msgstr "Fichier sélectionné." + +#: partitioncloud/templates/components/input_file.html:5 +msgid "Select or drag & drop your file (pdf)." +msgstr "Sélectionner ou déposer un fichier (pdf)." + #: partitioncloud/templates/groupe/index.html:8 #, python-format msgid "Add an album to group %(name)s"