Commit c23be78c authored by Jérémie Passerat's avatar Jérémie Passerat

Ajout de tag libre via glisser déposer

parent 6205615d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "volet_navigation",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@popperjs/core": "^2.9.2", "@popperjs/core": "^2.9.2",
...@@ -7539,9 +7540,9 @@ ...@@ -7539,9 +7540,9 @@
"dev": true "dev": true
}, },
"node_modules/dns-packet": { "node_modules/dns-packet": {
"version": "1.3.1", "version": "1.3.4",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz",
"integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ip": "^1.1.0", "ip": "^1.1.0",
...@@ -15344,9 +15345,9 @@ ...@@ -15344,9 +15345,9 @@
} }
}, },
"node_modules/path-parse": { "node_modules/path-parse": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"node_modules/path-to-regexp": { "node_modules/path-to-regexp": {
...@@ -15527,9 +15528,9 @@ ...@@ -15527,9 +15528,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "7.0.35", "version": "7.0.36",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz",
"integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
...@@ -19153,9 +19154,9 @@ ...@@ -19153,9 +19154,9 @@
} }
}, },
"node_modules/url-parse": { "node_modules/url-parse": {
"version": "1.5.1", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"querystringify": "^2.1.1", "querystringify": "^2.1.1",
...@@ -20669,9 +20670,9 @@ ...@@ -20669,9 +20670,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "6.2.1", "version": "6.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
...@@ -27024,9 +27025,9 @@ ...@@ -27024,9 +27025,9 @@
"dev": true "dev": true
}, },
"dns-packet": { "dns-packet": {
"version": "1.3.1", "version": "1.3.4",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz",
"integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==",
"dev": true, "dev": true,
"requires": { "requires": {
"ip": "^1.1.0", "ip": "^1.1.0",
...@@ -33141,9 +33142,9 @@ ...@@ -33141,9 +33142,9 @@
"dev": true "dev": true
}, },
"path-parse": { "path-parse": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"path-to-regexp": { "path-to-regexp": {
...@@ -33282,9 +33283,9 @@ ...@@ -33282,9 +33283,9 @@
"dev": true "dev": true
}, },
"postcss": { "postcss": {
"version": "7.0.35", "version": "7.0.36",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz",
"integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
...@@ -36327,9 +36328,9 @@ ...@@ -36327,9 +36328,9 @@
} }
}, },
"url-parse": { "url-parse": {
"version": "1.5.1", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"querystringify": "^2.1.1", "querystringify": "^2.1.1",
...@@ -37568,9 +37569,9 @@ ...@@ -37568,9 +37569,9 @@
} }
}, },
"ws": { "ws": {
"version": "6.2.1", "version": "6.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
"dev": true, "dev": true,
"requires": { "requires": {
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
that.$emit("contenuAjoute", {contenu: nouveauContenu}) that.$emit("contenuAjoute", {contenu: nouveauContenu})
that.contenuSaisi = '' that.contenuSaisi = ''
that.retourArriere(true) that.retourArriere(true)
that.isCreation = false that.isCreation = true
} }
) )
}, },
......
...@@ -35,7 +35,9 @@ export default { ...@@ -35,7 +35,9 @@ export default {
// provenance du contenu // provenance du contenu
contenuCliqueProvenance: {}, contenuCliqueProvenance: {},
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {} darktheme: {},
// Récupération d'un tag libre ajouté
tagLibreAssocie: {}
}, },
methods:{ methods:{
/** /**
...@@ -106,6 +108,21 @@ export default { ...@@ -106,6 +108,21 @@ export default {
}) })
}) })
}, },
/**
* @vuese
* Traitement d'un tag associé via drag&dro
*/
tagLibreAssocie: function () {
//alert(this.auteur)
//alert(this.tagLibreAssocie)
let that = this
Service.recupererTagLibre(this.auteur).then(function (response) {
that.tagsDeAuteur = response.data
Service.recupererTagLibreContenu(JSON.stringify(that.tagLibreAssocie), that.auteur).then(function (response) {
that.tagsLibres = response.data
})
})
}
}, },
computed: { computed: {
/** /**
...@@ -125,6 +142,10 @@ ul { ...@@ -125,6 +142,10 @@ ul {
} }
li {
margin-left: -1.5vw;
}
/*#pageTagLibre { /*#pageTagLibre {
margin-left: 20%; margin-left: 20%;
margin-right: 20%; margin-right: 20%;
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<p v-show="filtre_choisi.length === 0">{{ texte }}</p> <p v-show="filtre_choisi.length === 0">{{ texte }}</p>
<Filtre_Tag v-show="filtre_choisi === 'tags officiels'" @creer_filtre="creer_filtre"/> <Filtre_Tag v-show="filtre_choisi === 'tags officiels'" @creer_filtre="creer_filtre"/>
<Filtre_Tag_Libre v-bind:darktheme="darktheme" v-show="filtre_choisi === 'tags libres' " v-bind:filtreChoisi="filtre_choisi" v-bind:auteur="auteur" @creer_filtre="creer_filtre"/> <Filtre_Tag_Libre v-bind:darktheme="darktheme" v-show="filtre_choisi === 'tags libres' " v-bind:filtreChoisi="filtre_choisi"
v-bind:auteur="auteur" @creer_filtre="creer_filtre" v-bind:checkes="checkes" @lignesDropped="lignesDropped"
@actionTagLibre="actionTagLibre"/>
<Filtre_Auteur v-bind:panierChoisi="panierChoisi" v-show="filtre_choisi === 'auteur'" v-bind:auteur="auteur" @creer_filtre="creer_filtre"/> <Filtre_Auteur v-bind:panierChoisi="panierChoisi" v-show="filtre_choisi === 'auteur'" v-bind:auteur="auteur" @creer_filtre="creer_filtre"/>
<Filtre_Date v-show="filtre_choisi === 'date' " @creer_filtre="creer_filtre"/> <Filtre_Date v-show="filtre_choisi === 'date' " @creer_filtre="creer_filtre"/>
<Filtre_Note_Popularite v-show="filtre_choisi === 'note' " @creer_filtre="creer_filtre" v-bind:deconnexion="deconnexion"/> <Filtre_Note_Popularite v-show="filtre_choisi === 'note' " @creer_filtre="creer_filtre" v-bind:deconnexion="deconnexion"/>
...@@ -24,7 +26,6 @@ import Filtre_Tag_Libre from "@/components/filtres/Filtre_Tag_Libre"; ...@@ -24,7 +26,6 @@ import Filtre_Tag_Libre from "@/components/filtres/Filtre_Tag_Libre";
import Filtre_Recherche from "@/components/filtres/Filtre_Recherche"; import Filtre_Recherche from "@/components/filtres/Filtre_Recherche";
export default { export default {
name: "Detail_Contenu", name: "Detail_Contenu",
components: { components: {
...@@ -49,6 +50,8 @@ export default { ...@@ -49,6 +50,8 @@ export default {
deconnexion: {}, deconnexion: {},
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// lignes cochées
checkes: {}
}, },
methods: { methods: {
/** /**
...@@ -59,6 +62,20 @@ export default { ...@@ -59,6 +62,20 @@ export default {
// Transmet la création d'un filtre // Transmet la création d'un filtre
// @arg filtre le filtre créé // @arg filtre le filtre créé
this.$emit("creer_filtre", {filtre: event}) this.$emit("creer_filtre", {filtre: event})
},
/**
* @vuese
* Permet de savoir si les lignes sélectionnées ont été déposées sur un tag
*/
lignesDropped: function () {
this.$emit("lignesDropped")
},
/**
* @vuese
* Permet de remonter l'info pour un tag libre associé via drag&drop
*/
actionTagLibre: function (event) {
this.$emit("actionTagLibre", {creation: event.creation, id_contenu: event.id_contenu})
} }
}, },
data: function () { data: function () {
...@@ -66,11 +83,11 @@ export default { ...@@ -66,11 +83,11 @@ export default {
texte: "Ajoutez des filtres pour restreindre les contenus de la banque ou du panier en sélectionnant le filtre à appliquer dans la zone de choix ci dessus" texte: "Ajoutez des filtres pour restreindre les contenus de la banque ou du panier en sélectionnant le filtre à appliquer dans la zone de choix ci dessus"
} }
} }
/* watch: { /* watch: {
modeFiltre: function () { modeFiltre: function () {
this.filtre_choisi = "" this.filtre_choisi = ""
} }
},*/ },*/
} }
</script> </script>
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<mavon-editor :language="'fr'" style="position: static; height: 79vh; margin-top: -0.5%" v-model="texteDuContenu"/> <mavon-editor :language="'fr'" style="position: static; height: 79vh; margin-top: -0.5%" v-model="texteDuContenu"/>
</div> </div>
<TagsLibres v-show="isModeTag" v-bind:contenu="this.contenuClique" v-bind:auteur="auteur" @actionTagLibre="actionTagLibre" <TagsLibres v-show="isModeTag" v-bind:contenu="this.contenuClique" v-bind:auteur="auteur" @actionTagLibre="actionTagLibre"
style="position: static; height: 79vh; margin-top: -0.5%" v-bind:darktheme="darktheme" @chargerTagsLibres="chargerTagsLibres"></TagsLibres> style="position: static; height: 79vh; margin-top: -0.5%" v-bind:darktheme="darktheme" @chargerTagsLibres="chargerTagsLibres" v-bind:tagLibreAssocie="tagLibreAssocie"></TagsLibres>
<div class="markdown"> <div class="markdown">
<br> <br>
<button id="validerModif" v-on:click="action('valider')">modifier </button> <button id="validerModif" v-on:click="action('valider')">modifier </button>
...@@ -95,6 +95,8 @@ export default { ...@@ -95,6 +95,8 @@ export default {
contenuClique: {}, contenuClique: {},
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// Récupération d'un tag libre ajouté
tagLibreAssocie: {}
}, },
data: function () { data: function () {
return { return {
...@@ -252,13 +254,17 @@ export default { ...@@ -252,13 +254,17 @@ export default {
this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse'); this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse');
if (this.contenuCliqueProvenance === 'perso'){ if (this.contenuCliqueProvenance === 'perso'){
this.versionMax = this.contenuClique.versionEnCours.numero this.versionMax = this.contenuClique.versionEnCours.numero
this.versionChoisie = this.versionMax this.versionChoisie = this.versionMax
} else {
this.versionChoisie = this.contenuClique.version
} }
let that = this let that = this
Service.recupererNoteContenu(JSON.stringify(this.contenuClique._id), this.auteur, this.contenuClique.version).then(function (result) { Service.recupererNoteContenu(JSON.stringify(this.contenuClique._id), this.auteur, this.versionChoisie).then(function (result) {
let nombre = result.data let nombre = result.data
if (nombre !== '-1'){ if (nombre !== '-1'){
nombre = JSON.parse(nombre) nombre = JSON.parse(nombre)
...@@ -273,7 +279,8 @@ export default { ...@@ -273,7 +279,8 @@ export default {
*/ */
versionChoisie: function () { versionChoisie: function () {
this.noteContenu = this.calculerNoteContenu this.noteContenu = this.calculerNoteContenu
} },
} }
} }
......
This diff is collapsed.
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
</div> </div>
<div id = "detailContenu"> <div id = "detailContenu">
<Detail_Contenu v-bind:panierChoisi="panierChoisi" v-bind:filtre_choisi="filtre_choisi" <Detail_Contenu v-bind:panierChoisi="panierChoisi" v-bind:filtre_choisi="filtre_choisi"
v-bind:auteur="auteur" v-bind:darktheme="darktheme" @creer_filtre="creer_filtre" v-bind:deconnexion="deconnexion"/> v-bind:auteur="auteur" v-bind:darktheme="darktheme" @creer_filtre="creer_filtre"
v-bind:deconnexion="deconnexion" v-bind:checkes="checkes" @lignesDropped="lignesDropped"
@actionTagLibre="actionTagLibre"/>
</div> </div>
<div id="detailChoixMode"> <div id="detailChoixMode">
<Choix_Mode v-show="!variante" v-bind:darktheme="darktheme" @mode_choisi="ajusterMode" v-bind:razModeVariante="razModeVariante" /> <Choix_Mode v-show="!variante" v-bind:darktheme="darktheme" @mode_choisi="ajusterMode" v-bind:razModeVariante="razModeVariante" />
...@@ -41,7 +43,9 @@ export default { ...@@ -41,7 +43,9 @@ export default {
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// Signal de deconnexion // Signal de deconnexion
deconnexion: {} deconnexion: {},
// lignes cochées
checkes: {}
}, },
methods: { methods: {
...@@ -74,6 +78,20 @@ export default { ...@@ -74,6 +78,20 @@ export default {
// @arg les filtres choisis // @arg les filtres choisis
this.$emit("filtresChoisis", {filtres: event.filtres}) this.$emit("filtresChoisis", {filtres: event.filtres})
},
/**
* @vuese
* Permet de savoir si les lignes sélectionnées ont été déposées sur un tag
*/
lignesDropped: function () {
this.$emit("lignesDropped")
},
/**
* @vuese
* Permet de remonter l'info pour un tag libre associé via drag&drop
*/
actionTagLibre: function (event) {
this.$emit("actionTagLibre", {creation: event.creation, id_contenu: event.id_contenu})
} }
}, },
data: function () { data: function () {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment