diff --git a/.idea/sshConfigs.xml b/.idea/sshConfigs.xml index f34483b..ac25c23 100644 --- a/.idea/sshConfigs.xml +++ b/.idea/sshConfigs.xml @@ -2,9 +2,9 @@ - - - + + + \ No newline at end of file diff --git a/.idea/webServers.xml b/.idea/webServers.xml index 25e94f8..ca259e4 100644 --- a/.idea/webServers.xml +++ b/.idea/webServers.xml @@ -3,11 +3,10 @@ diff --git a/assets/css/components/messages.scss b/assets/css/components/messages.scss index bed6fb2..0473e99 100644 --- a/assets/css/components/messages.scss +++ b/assets/css/components/messages.scss @@ -1,3 +1,11 @@ #messages { display: none; +} +button.ui-dialog-titlebar-close { + &:focus { + outline: none; + } + &::-moz-focus-inner { + border: 0; + } } \ No newline at end of file diff --git a/assets/css/main.scss b/assets/css/main.scss deleted file mode 100644 index a3042b3..0000000 --- a/assets/css/main.scss +++ /dev/null @@ -1,8 +0,0 @@ -@import "~bootstrap/scss/bootstrap"; - -@import "base/fonts"; - -@import "components/messages"; - -@import "layouts/page"; -@import "layouts/header"; \ No newline at end of file diff --git a/assets/css/pages/main.scss b/assets/css/pages/main.scss new file mode 100644 index 0000000..61d8154 --- /dev/null +++ b/assets/css/pages/main.scss @@ -0,0 +1,8 @@ +@import "../../../node_modules/bootstrap/scss/bootstrap"; + +@import "../base/fonts"; + +@import "../components/messages"; + +@import "../layouts/page"; +@import "../layouts/header"; \ No newline at end of file diff --git a/assets/css/pages/security/sign-in.scss b/assets/css/pages/security/sign-in.scss new file mode 100644 index 0000000..1bb287f --- /dev/null +++ b/assets/css/pages/security/sign-in.scss @@ -0,0 +1,5 @@ +#sign-in { + display: inline-block; + border: 1px solid rgba(0, 0, 0, .25); + padding: 5px; +} \ No newline at end of file diff --git a/assets/js/forms.js b/assets/js/forms.js new file mode 100644 index 0000000..132a698 --- /dev/null +++ b/assets/js/forms.js @@ -0,0 +1,14 @@ +const $ = require('jquery'); + +$(function () { + /* Form validation */ + $('.form-validation').each(function (idx, form) { + $(form).on('submit', function (event) { + if (form.checkValidity() === false) { + event.preventDefault(); + event.stopPropagation(); + } + $(form).addClass('was-validated'); + }); + }); +}); \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index 7f26dbd..e0e8c66 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,5 +2,6 @@ require('bootstrap/dist/js/bootstrap.bundle.min'); require('@fortawesome/fontawesome-free/css/all.min.css'); -require('../css/main.scss'); -require('../js/messages.js'); \ No newline at end of file +require('../css/pages/main.scss'); +require('../js/messages.js'); +require('../js/forms.js'); \ No newline at end of file diff --git a/assets/js/security/sign-in.js b/assets/js/security/sign-in.js new file mode 100644 index 0000000..eaf0d08 --- /dev/null +++ b/assets/js/security/sign-in.js @@ -0,0 +1 @@ +require('../../css/pages/security/sign-in.scss'); \ No newline at end of file diff --git a/templates/security/sign-in.html.twig b/templates/security/sign-in.html.twig index 23f1690..c2b5165 100644 --- a/templates/security/sign-in.html.twig +++ b/templates/security/sign-in.html.twig @@ -3,29 +3,43 @@ {% block title %}{% trans %}sign.in{% endtrans %}{% endblock %} +{% block stylesheets %} + {{ parent() }} + {{ encore_entry_link_tags('security/sign-in') }} +{% endblock %} + {% block body %}

{% trans %}sign.in{% endtrans %}

-
-
+
+ -
- - +
+ + +
{% trans %}user.invalid.email{% endtrans %}
-
- - +
+ + +
{% trans %}user.invalid.password{% endtrans %}
-
- +
+
- +
+ +
{% endblock %} + +{% block javascripts %} + {{ parent() }} + {{ encore_entry_script_tags('security/sign-in') }} +{% endblock %} \ No newline at end of file diff --git a/translations/security+intl-icu.en.xlf b/translations/security+intl-icu.en.xlf index 052750f..5d02174 100644 --- a/translations/security+intl-icu.en.xlf +++ b/translations/security+intl-icu.en.xlf @@ -54,6 +54,22 @@ Password + + + + + + user.invalid.email + You must provide a valid email + + + + + user.invalid.password + You must provide a password + + + \ No newline at end of file diff --git a/translations/security+intl-icu.fr.xlf b/translations/security+intl-icu.fr.xlf index 868108f..8db3b92 100644 --- a/translations/security+intl-icu.fr.xlf +++ b/translations/security+intl-icu.fr.xlf @@ -55,6 +55,21 @@ Mot de passe + + + + + user.invalid.email + Vous devez renseigner une adresse mail valide + + + + + user.invalid.password + Vous devez renseigner un mot de passe + + + \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 3a126bc..06a513f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -44,8 +44,7 @@ Encore * and one CSS file (e.g. app.css) if your JavaScript imports CSS. */ .addEntry('main', './assets/js/main.js') - //.addEntry('page1', './assets/js/page1.js') - //.addEntry('page2', './assets/js/page2.js') + .addEntry('security/sign-in', './assets/js/security/sign-in.js') // When enabled, Webpack "splits" your files into smaller pieces for greater optimization. .splitEntryChunks()