+
add
- Ajouter une image
+ Ajouter un média
- Aucun medias n'ont été ajoutés pour l'instant
+ Aucun médias n'ont été ajoutés pour l'instant
-
+
Décaler vers la droite
+
+
+
+
+ stars
+
+
+ Choisir comme couverture
+
delete
@@ -124,14 +141,27 @@
+
+
+
+ {{ Math.ceil(value) }}%
+
+
+
@@ -172,7 +202,8 @@ export default {
uploadLoading: false,
files: [],
deleteMediaModal: false,
- mediaToDelete: {}
+ mediaToDelete: {},
+ uploadProgress: 50
}),
computed: {
@@ -225,7 +256,17 @@ export default {
const formData = new FormData()
results.forEach(r => formData.append(r[0], new Blob([new Uint8Array(r[1])]), r[2]))
- this.$apitator.post('/delegate/medias', formData, { withAuth: true }).then(res => {
+ this.$apitator.post('/delegate/medias', formData, {
+ withAuth: true,
+ onUploadProgress: (progressEvent) => {
+ console.log(progressEvent)
+ const totalLength = progressEvent.lengthComputable ? progressEvent.total : progressEvent.target.getResponseHeader('content-length') || progressEvent.target.getResponseHeader('x-decompressed-content-length')
+ console.log('onUploadProgress', totalLength)
+ if (totalLength !== null) {
+ this.uploadProgress = Math.round((progressEvent.loaded * 100) / totalLength)
+ }
+ }
+ }).then(res => {
this.$store.commit('SET_DATA', { gallery: res.data.data.gallery })
this.$store.commit('ADD_ALERT', {
color: 'success',
diff --git a/src/views/Delegate/Main.vue b/src/views/Delegate/Main.vue
index a1d37e6..a288cc2 100644
--- a/src/views/Delegate/Main.vue
+++ b/src/views/Delegate/Main.vue
@@ -1,46 +1,79 @@
-
-
-
-
-
-
-
-
-
- edit
-
- Changer le logo
-
-
-
+
+
+ Tout les champs indiqués ici sont obligatoire afin de publier votre page
+
+
+
+
+
+
+
+
+
+
+
+
+ edit
+
+ Changer le logo
+
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
({
+ formValid: true,
logoLoading: false,
rules: {
- descriptionShort: [v => v.length <= 200 || 'Au maximum 200 caractères'],
- logo: [v => !v || v.size < 2000000 || 'La taille du logo doit être inférieur à 2 Mega Octets!']
+ name: [
+ v => v.length >= 3 || 'Au minimum 3 caractères',
+ v => v.length <= 50 || 'Au maximum 50 caractères'
+ ],
+ descriptionShort: [
+ v => v.length >= 20 || 'Au minimum 20 caractères',
+ v => v.length <= 200 || 'Au maximum 200 caractères'
+ ],
+ email: [v => /.+@.+\..+/.test(v) || "L'email est requis et dois être valide"],
+ person: [v => v.length >= 4 || 'Au minimum 4 caractères']
}
}),
@@ -70,6 +112,14 @@ export default {
// })
// },
+ watch: {
+ '$store.state.validateMain' (val) {
+ if (val) {
+ this.$store.state.validateMainCallback(this.$refs.form.validate())
+ }
+ }
+ },
+
methods: {
handleAvatarEditorSubmitted: function (blob) {
const form = new FormData()
diff --git a/src/views/Home.vue b/src/views/Home.vue
index cefef89..9c6e697 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,58 +1,54 @@
-
-
-
- Vous êtes :
+
+ Vous êtes :
-
-
-
-
-
-
-
- {{ nav.icon }}
-
-
-
- {{ nav.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ nav.icon }}
+
+
+
+ {{ nav.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yarn.lock b/yarn.lock
index 8e8a116..1384a54 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9074,10 +9074,10 @@ vm-browserify@^1.0.1:
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
-vue-apitator@^0.0.16:
- version "0.0.16"
- resolved "https://registry.yarnpkg.com/vue-apitator/-/vue-apitator-0.0.16.tgz#4c59f617aa692e7f0d3fd059424c3938a9666bea"
- integrity sha512-k0hQS8jR10avPTd28vPHjTV+H7aW2pfSz4O3gJ4D1z5J/ne4l+ygNAqQofOzgGL9bKaiojc9Guxr2f34fnUvYg==
+vue-apitator@0.0.17:
+ version "0.0.17"
+ resolved "https://registry.yarnpkg.com/vue-apitator/-/vue-apitator-0.0.17.tgz#3fcd925effa833956f07c63c57eaf72523c2dc0f"
+ integrity sha512-xa3ChL3v2pq77x0KYQnSkrt5jSyYhvCGIKRsCQLAyvOqQqA1TPBYazBjQeEvP2FSFficIu9lJHlqp0gflkGy/A==
dependencies:
axios "^0.19.0"
vue "^2.5.17"