Commit 134126a8 authored by Jérémie Passerat's avatar Jérémie Passerat

Récupération du contenu d'un fichier ok

parent 65198158
......@@ -265,8 +265,7 @@
"@babel/helper-validator-identifier": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
"integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==",
"dev": true
"integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A=="
},
"@babel/helper-validator-option": {
"version": "7.12.17",
......@@ -311,8 +310,7 @@
"@babel/parser": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz",
"integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==",
"dev": true
"integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ=="
},
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
"version": "7.13.12",
......@@ -1098,7 +1096,6 @@
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"to-fast-properties": "^2.0.0"
......@@ -1175,6 +1172,66 @@
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==",
"dev": true
},
"@nuxt/opencollective": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.3.2.tgz",
"integrity": "sha512-XG7rUdXG9fcafu9KTDIYjJSkRO38EwjlKYIb5TQ/0WDbiTUTtUtgncMscKOYzfsY86kGs05pAuMOR+3Fi0aN3A==",
"requires": {
"chalk": "^4.1.0",
"consola": "^2.15.0",
"node-fetch": "^2.6.1"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
"integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"@popperjs/core": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz",
"integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q=="
},
"@soda/friendly-errors-webpack-plugin": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.8.0.tgz",
......@@ -1380,6 +1437,11 @@
"@types/node": "*"
}
},
"@types/showdown": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-1.9.3.tgz",
"integrity": "sha512-akvzSmrvY4J5d3tHzUUiQr0xpjd4Nb3uzWW6dtwzYJ+qW/KdWw5F8NLatnor5q/1LURHnzDA1ReEwCVqcatRnw=="
},
"@types/source-list-map": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz",
......@@ -1788,6 +1850,34 @@
"strip-ansi": "^6.0.0"
}
},
"@vue/compiler-core": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.1.tgz",
"integrity": "sha512-Z1RO3T6AEtAUFf2EqqovFm3ohAeTvFzRtB0qUENW2nEerJfdlk13/LS1a0EgsqlzxmYfR/S/S/gW9PLbFZZxkA==",
"requires": {
"@babel/parser": "^7.12.0",
"@babel/types": "^7.12.0",
"@vue/shared": "3.1.1",
"estree-walker": "^2.0.1",
"source-map": "^0.6.1"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
"@vue/compiler-dom": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.1.tgz",
"integrity": "sha512-nobRIo0t5ibzg+q8nC31m+aJhbq8FbWUoKvk6h3Vs1EqTDJaj6lBTcVTq5or8AYht7FbSpdAJ81isbJ1rWNX7A==",
"requires": {
"@vue/compiler-core": "3.1.1",
"@vue/shared": "3.1.1"
}
},
"@vue/component-compiler-utils": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.2.0.tgz",
......@@ -1841,6 +1931,38 @@
"integrity": "sha512-LIZMuJk38pk9U9Ur4YzHjlIyMuxPlACdBIHH9/nGYVTsaGKOSnSuELiE8vS9wa+dJpIYspYUOqk+L1Q4pgHQHQ==",
"dev": true
},
"@vue/reactivity": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.1.tgz",
"integrity": "sha512-DsH5woNVCcPK1M0RRYVgJEU1GJDU2ASOKpAqW3ppHk+XjoFLCbqc/26RTCgTpJYd9z8VN+79Q1u7/QqgQPbuLQ==",
"requires": {
"@vue/shared": "3.1.1"
}
},
"@vue/runtime-core": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.1.tgz",
"integrity": "sha512-GboqR02txOtkd9F3Ysd8ltPL68vTCqIx2p/J52/gFtpgb5FG9hvOAPEwFUqxeEJRu7ResvQnmdOHiEycGPCLhQ==",
"requires": {
"@vue/reactivity": "3.1.1",
"@vue/shared": "3.1.1"
}
},
"@vue/runtime-dom": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.1.tgz",
"integrity": "sha512-o57n/199e/BBAmLRMSXmD2r12Old/h/gf6BgL0RON1NT2pwm6MWaMY4Ul55eyq+FsDILz4jR/UgoPQ9vYB8xcw==",
"requires": {
"@vue/runtime-core": "3.1.1",
"@vue/shared": "3.1.1",
"csstype": "^2.6.8"
}
},
"@vue/shared": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.1.tgz",
"integrity": "sha512-g+4pzAw7PYSjARtLBoDq6DmcblX8i9KJHSCnyM5VDDFFifUaUT9iHbFpOF/KOizQ9f7QAqU2JH3Y6aXjzUMhVA=="
},
"@vue/web-component-wrapper": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
......@@ -2622,6 +2744,30 @@
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
"dev": true
},
"bootstrap": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.1.tgz",
"integrity": "sha512-Fl79+wsLOZKoiU345KeEaWD0ik8WKRI5zm0YSPj2oF1Qr+BO7z0fco6GbUtqjoG1h4VI89PeKJnMsMMVQdKKTw=="
},
"bootstrap-vue": {
"version": "2.21.2",
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.21.2.tgz",
"integrity": "sha512-0Exe+4MZysqhZNXIKf4TzkvXaupxh9EHsoCRez0o5Dc0J7rlafayOEwql63qXv74CgZO8E4U8ugRNJko1vMvNw==",
"requires": {
"@nuxt/opencollective": "^0.3.2",
"bootstrap": ">=4.5.3 <5.0.0",
"popper.js": "^1.16.1",
"portal-vue": "^2.1.7",
"vue-functional-data-merge": "^3.1.0"
},
"dependencies": {
"bootstrap": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz",
"integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw=="
}
}
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
......@@ -3434,6 +3580,11 @@
"integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==",
"dev": true
},
"consola": {
"version": "2.15.3",
"resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz",
"integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw=="
},
"console-browserify": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz",
......@@ -4020,6 +4171,11 @@
}
}
},
"csstype": {
"version": "2.6.17",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz",
"integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A=="
},
"cyclist": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz",
......@@ -5211,6 +5367,11 @@
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
"dev": true
},
"estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
},
"esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
......@@ -8072,6 +8233,11 @@
"lower-case": "^1.1.1"
}
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
},
"node-forge": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz",
......@@ -8717,6 +8883,16 @@
"ts-pnp": "^1.1.6"
}
},
"popper.js": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
"integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ=="
},
"portal-vue": {
"version": "2.1.7",
"resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz",
"integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g=="
},
"portfinder": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
......@@ -11170,8 +11346,7 @@
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
"dev": true
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4="
},
"to-object-path": {
"version": "0.3.0",
......@@ -11717,6 +11892,11 @@
}
}
},
"vue-functional-data-merge": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-3.1.0.tgz",
"integrity": "sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA=="
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
......@@ -11838,6 +12018,28 @@
}
}
},
"vue-showdown": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/vue-showdown/-/vue-showdown-3.1.0.tgz",
"integrity": "sha512-/2ak7vczNTFk7HkYWtvnf6SCcmgxrhlU2BcZo0osAEV+LPlTCOcguGKEi+kezKA831Uj6CXxdyQFM2yCYcEpFQ==",
"requires": {
"@types/showdown": "^1.9.3",
"showdown": "^1.9.1",
"vue": "^3.0.0"
},
"dependencies": {
"vue": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.1.1.tgz",
"integrity": "sha512-j9fj3PNPMxo2eqOKYjMuss9XBS8ZtmczLY3kPvjcp9d3DbhyNqLYbaMQH18+1pDIzzVvQCQBvIf774LsjjqSKA==",
"requires": {
"@vue/compiler-dom": "3.1.1",
"@vue/runtime-dom": "3.1.1",
"@vue/shared": "3.1.1"
}
}
}
},
"vue-simplemde": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/vue-simplemde/-/vue-simplemde-2.0.0.tgz",
......
......@@ -8,18 +8,23 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@popperjs/core": "^2.9.2",
"axios": "^0.21.1",
"bootstrap": "^5.0.1",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.6.5",
"jquery": "^3.6.0",
"jquery-ui-bundle": "^1.12.1-migrate",
"markdown-it-vue": "^1.1.6",
"mavon-editor": "^2.9.1",
"popper.js": "^1.16.1",
"showdown": "^1.9.1",
"vue": "^2.6.11",
"vue-cookie": "^1.1.4",
"vue-cookies": "^1.7.4",
"vue-js-modal": "^2.0.0-rc.6",
"vue-js-popover": "^1.2.1",
"vue-showdown": "^3.1.0",
"vue-simplemde": "^2.0.0"
},
"devDependencies": {
......
<template>
<div id="app">
<Volet_Base @choix_variante="choixVariante" @newContenu="newContenu" v-bind:auteur="auteur" />
<Volet_Base @choix_variante="choixVariante" @newContenu="newContenu" v-bind:auteur="auteur" v-bind:contenuAjoute="contenuAjoute" />
</div>
</template>
......@@ -23,7 +23,7 @@ export default {
}
},
props: ['auteur']
props: ['auteur', 'contenuAjoute']
}
</script>
......
......@@ -3,14 +3,20 @@
<Login v-show="etat === 'unlogged'" @user_logged="setLogged"></Login>
<Menu v-show="etat !== 'unlogged'" v-bind:auteur="auteur" v-bind:etat="etat" v-bind:variante="variante" @menu_choisi="changerPage"></Menu>
<Contenu v-show="etat === 'Contenu'" v-bind:auteur="auteur" @choix_variante="choixVariante" @newContenu="newContenu"></Contenu>
<Contenu v-show="etat === 'Contenu'" v-bind:auteur="auteur" v-bind:contenuAjoute="contenuAjoute" @choix_variante="choixVariante" @newContenu="newContenu"></Contenu>
<Maj v-show="etat === 'Mises à jour'" v-bind:auteur="auteur" v-bind:isRecu="isRecu" v-bind:isPropose="isPropose"
v-bind:contenuEnPublication="contenuEnPublication" ></Maj>
<Profil v-show="etat === 'Profil'" ></Profil>
<Tags v-show="etat === 'Tags'" ></Tags>
<p style="text-align: center" v-show="errorLogin">Login ou mot de passe erroné</p>
<NewContenu v-show="etat === 'newContenu'"></NewContenu>
<NewContenu v-show="etat === 'newContenu'" v-bind:auteur="auteur" @contenuAjoute="ajouterUnContenu"></NewContenu>
<!-- <p id="popover-target-1" style="text-align: center">
Hover Me
</p>
<b-popover target="popover-target-1" triggers="click" placement="bottom">
<template #title>Popover Title</template>
<h1>I am</h1> popover <b>component</b> content!
</b-popover>-->
</div>
</template>
......@@ -22,6 +28,7 @@ import Maj from "@/Maj";
import Profil from "@/Profil";
import Tags from "@/Tags";
import NewContenu from "@/NewContenu";
// import showdown from "showdown"
export default {
name: "Index.vue",
......@@ -34,7 +41,8 @@ export default {
errorLogin: false,
auteur: "",
isRecu: false,
isPropose: false
isPropose: false,
contenuAjoute: false
}
},
methods: {
......@@ -65,7 +73,11 @@ export default {
},
newContenu: function () {
this.etat = "newContenu"
},
ajouterUnContenu:function () {
this.contenuAjoute = true
}
},
components:{
NewContenu,
......@@ -80,5 +92,4 @@ export default {
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -56,7 +56,7 @@ export default {
width : 1000px;
text-align: center;
align-content: center;
margin: 20% auto 0;
margin: 15% auto 0;
}
input{
......@@ -65,7 +65,7 @@ input{
}
button {
height: 20px;
height: auto;
width: auto;
text-align: center;
}
......
<template>
<div>
<p></p>
<p>Création de contenu</p>
<p>Dans cette zone vous pouvez renseigner (en langage markdown) le contenu que vous désirez</p>
<!-- <div class="markdown">
<!-- <div class="markdown">
<textarea rows="50" cols="150"/>
</div>-->
<!-- <vue-simplemde id="markdownEditor" v-model="contenuSaisi"/>-->
<!-- <vue-simplemde id="markdownEditor" v-model="contenuSaisi"/>-->
<div class="mavonEditor">
<mavon-editor :language="'fr'" style="min-height: 700px" v-model="contenuSaisi"/>
......@@ -23,10 +24,11 @@
<script>
// import VueSimplemde from 'vue-simplemde'
import Service from "@/service/Service";
export default {
name: "NewContenu",
props: ['auteur'],
data() {
return {
contenuSaisi: '',
......@@ -38,7 +40,14 @@ export default {
},
methods: {
ajouterContenu: function () {
alert("contenu : " + this.contenuSaisi )
let data = {auteur: this.auteur, contenu_a_ecrire: this.contenuSaisi}
let that = this
Service.creerContenuPerso(data).then(
function () {
that.$emit("contenuAjoute")
}
)
}
}
}
......@@ -72,4 +81,4 @@ button {
height: 250%;
}
</style>
\ No newline at end of file
</style>
\ No newline at end of file
......@@ -11,7 +11,9 @@
<button v-else v-show="contenuCliqueProvenance === 'en-cours' && contenuClique.etat !== 'refuse'" v-on:click="actionContenu('validerModification')">valider la modification</button>
<button v-show="contenuCliqueProvenance === 'banque' && contenuClique.etat !== 'refuse'" v-on:click="actionContenu('mettreFavori')">mettre le contenu en tiers</button>
<br>
<span contenteditable="false" v-html="formatterMarkdown()">
</span>
<br>
</div>
<button id="ren" v-on:click="revenirArriere">Retour en arrière</button>
......@@ -20,17 +22,40 @@
</template>
<script>
import Service from "@/service/Service";
export default {
name: "Consulter_Contenu",
props: ['contenuClique', 'contenuCliqueProvenance', 'auteur'],
methods: {
formatterMarkdown: function () {
let showdown = require('showdown'),
converter = new showdown.Converter()
return converter.makeHtml(this.contenu)
},
actionContenu: function (action) {
this.$emit("actionContenu", {action: action, contenu: this.contenuClique})
},
revenirArriere: function () {
this.$emit("retour_arriere", {panierChoisi: this.contenuCliqueProvenance !== 'banque'})
}
},
data: function () {
return {
contenu: ''
}
},
watch: {
contenuClique: function () {
let that = this
Service.recupererTexteContenu(JSON.stringify(this.contenuClique._id)).then(
function (response) {
that.contenu = response.data
// alert(response.data)
}
)
}
},
}
</script>
......@@ -46,6 +71,7 @@ div{
#actionsContenu>button {
width: auto;
height: auto;
margin-left: 45%;
margin-right: 45%;
......@@ -53,6 +79,7 @@ div{
#ren {
width: auto;
height: auto;
}
......
<template>
<div >
<p id="modifTitre"> Modification du contenu </p>
<div class="mavonEditor">
<mavon-editor :language="'fr'" style="min-height: 700px" v-model="contenu"/>
</div>
<div class="markdown">
<br>
<button id="validerModif" v-on:click="validerUneModif">modifier </button>
<button> revenir en arrière</button>
</div>
</div>
</template>
<script>
import Service from "@/service/Service";
export default {
name: "Modifier_Contenu",
props: ['contenuClique', 'auteur', 'contenuCliqueProvenance'],
data: function () {
return {
contenu: ''
}
},
methods: {
validerUneModif: function (message) {
// Modification du contenu en cours (au niveau de l'intérieur du fichier)
}
},
watch: {
contenuClique: function () {
let that = this
Service.recupererTexteContenu(JSON.stringify(this.contenuClique._id)).then(
function (response) {
that.contenu = response.data
// alert(response.data)
}
)
}
},
}
/* this.panierChoisi = true
if (this.contenuCliqueProvenance !== 'en-cours'){
data = {auteur: this.auteur, id_contenu: JSON.stringify(event.contenu._id), version: event.contenu.versionEnCours["numero"]}
Service.creerEnCours(data).then(
function () {
that.contenusDuPanier()
}
)
}*/
</script>
<style scoped>
div {
text-align: center;
}
button {
height: auto;
width: auto;
}
#validerModif {
margin-right: 5px;
margin-bottom: 5px;
}
#modifTitre{
margin-top: -35px;
}
</style>
\ No newline at end of file
<template>
<div>
<button id="changerVariante" v-show="!modeConsultation" v-on:click="changerVariante">changer</button>
<div class="choixPanier" v-show="panierChoisi">
<button id="changerVariante" v-show="!modeConsultation && !modeModification" v-on:click="changerVariante">changer</button>
<div class="choixPanier" v-show="panierChoisi && !modeConsultation && !modeModification">
<label>Perso</label>
<input type="checkbox" class="filtreTableau" v-model="persoChecked" v-on:click="persoChecked = !persoChecked" name="perso" value="tiers"/>
<label>Tiers</label>
......@@ -11,7 +11,7 @@
<input type="checkbox" class="filtreTableau" v-model="enCoursChecked" v-on:click="enCoursChecked = !enCoursChecked" name="en-cours" value="en-cours"/>
</div>
<div id="principal" v-show="!modeConsultation">
<div id="principal" v-show="!modeConsultation && !modeModification">
<div id="ensemble">
<button id="boutonVolet" v-on:click="desactiverVolet" v-bind:style="panierChoisi ? {'margin-top': '0%'} : {'margin-top': '20px'}"></button>
......@@ -47,17 +47,23 @@
&& (enCoursChecked ** (item.provenance === 'en-cours'))" v-for="item in contenus" :key="item.titre"
v-bind:style="{
'background-color': item.provenance === 'perso' ? 'white' : item.provenance === 'tiers' ? 'red' : 'blue'
}" >
<td class="modal titreContenu" v-on:click="chargerContenu(item, item.provenance)" v-popover:tooltip="'Open The Eyes\n'+
'\n'+
'Le **pipi** du *caca* est sur ton toit'">{{ item._id }}</td>
}">
<!-- <td class="modal titreContenu" id="titreContenu" v-on:click="chargerContenu(item, item.provenance)">{{ item._id }}</td>-->
<!-- <b-popover target="titreContenu" triggers="hover" placement="bottom">
<template #title>Popover Title</template>
<h1>I am</h1> popover <b>component</b> content!
</b-popover>-->
<td :id="JSON.stringify(item._id)" v-on:click="chargerContenu(item, item.provenance)">{{item._id}}</td>
<b-popover class="non" v-on:show="chocolat === item._id" :target="JSON.stringify(item._id)" triggers="hover" placement="bottom">
<p id="beautiful" v-html="whatYouGonnaDoNow(item.versionEnCours.commit)"></p>
</b-popover>
<td>{{item.auteur}}</td>
<td v-if="item.provenance === 'tiers'">{{ item.version }}</td>
<td v-else>{{ item.versionEnCours.numero }}</td>
<td>The table body</td>
<td class="prout">with two columns</td>
<td>with two columns</td>
<td class="modal tagContenu" v-popover:tooltip="'tags'">with two columns</td>
<td>with two columns</td>
<td class="boutonSupprimer" v-if="item.provenance !== 'en-cours'"> <input type="checkbox" v-on:change="ajouterCoche(item._id, item.provenance)" class="horns" name="horns"/></td>
<td class="boutonSupprimer" v-else> <input type="checkbox" v-on:change="ajouterCoche(item.reference, item.provenance)" class="horns" name="horns"/></td>
......@@ -65,13 +71,17 @@
</tr>
<tr v-show="!panierChoisi" v-for="item in contenusbanque" :key="item.titre">
<td class="modal titreContenu" v-on:click="chargerContenu(item, 'banque')" v-popover:tooltip="'prévisualisation'">{{ item._id }}</td>
<td id="titreContenuBanque" v-on:click="chargerContenu(item, 'banque')">{{ item._id }}</td>
<!-- <b-popover target="titreContenuBanque" triggers="hover" placement="bottom">
<template #title>Popover Title</template>
<h1>I am</h1> popover <b>component</b> content!
</b-popover>-->
<td>{{ item.auteur }}</td>
<td>{{item.versionEnCours}}</td>
<td>with two columns</td>
<td class="prout">with two columns</td>
<td>with two columns</td>
<td class="modal tagContenu" v-popover:tooltip="'tags'">with two columns</td>
<td>with two columns</td>
<td class="boutonSupprimer"> <input type="checkbox" v-on:change="ajouterCoche(item._id, item.versionEnCours)" class="horns" name="horns"/></td>
......@@ -86,30 +96,34 @@
</div>
</div>
<Consulter_Contenu v-bind:auteur="auteur" @actionContenu="actionContenu" @retour_arriere="retourArriere" v-bind:contenuClique = "contenuClique" v-bind:contenuCliqueProvenance = "contenuCliqueProvenance" v-show="modeConsultation"/>
<Consulter_Contenu v-bind:auteur="auteur" @actionContenu="actionContenu" @retour_arriere="retourArriere" v-bind:contenuClique = "contenuClique" v-bind:contenuCliqueProvenance = "contenuCliqueProvenance" v-show="modeConsultation && !modeModification"/>
<Modifier_Contenu v-bind:auteur="auteur" v-bind:contenuClique = "contenuClique" v-bind:contenuCliqueProvenance = "contenuCliqueProvenance" v-show="!modeConsultation && modeModification"/>
<div v-show="panierChoisi && !modeConsultation" class="circle" v-on:click="ajouterContenu" v-bind:style="{'margin-left': '95%'}">
</div>
</div>
</template>
<script>
import 'bootstrap/dist/js/bootstrap.min.js'
import $ from 'jquery'
import 'jquery-ui-bundle'
import Volet_Menu from "@/components/Volet_Menu";
import Volet_Contenu from "@/components/Volet_Contenu";
import Consulter_Contenu from "@/components/Consulter_Contenu";
import Service from '../../src/service/Service'
import 'popper.js/dist/popper.min.js';
import Modifier_Contenu from "@/components/Modifier_Contenu";
export default {
name: "Volet_Base",
components: {
Modifier_Contenu,
Volet_Menu,
Volet_Contenu,
Consulter_Contenu
},
props: ['auteur'],
props: ['auteur', 'contenuAjoute'],
data: function () {
return {
isActif: true,
......@@ -122,28 +136,31 @@ export default {
contenuCliqueProvenance: "",
modalOn: false,
modeConsultation: false,
modeModification: false,
persoChecked: true,
tiersChecked: true,
enCoursChecked: true,
oui: 0,
checkes: [],
nouveauContenu: false,
chocolat: '<h1 id="hellomarkdown">hello, markdown!</h1>',
imgEtoile: "https://previews.123rf.com/images/ylivdesign/ylivdesign1612/ylivdesign161208906/67933171-ic%C3%B4ne-%C3%A9toile-%C3%A0-cinq-branches-jaunes-illustration-de-dessin-anim%C3%A9-d-ic%C3%B4ne-de-vecteur-%C3%A9toile-jaune-%C3%A0-cinq-branches-.jpg",
imgPoubelle: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAflBMVEX///8AAACampq4uLh5eXlcXFxlZWXr6+vFxcVFRUWurq6ioqL39/doaGju7u7Z2dmIiIjX19eoqK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xgKsS/J4OlcuZIX0qlBbUaklgyF1tNucVwaTpKhNiNcAUMhDnZZl4nQhwGki/2s+2GGQvh4si4TJcJfQfn7olA4O4bCcf1LQmAObiuFbV8SApm/14tJdYWyLuP/LMmfyCMfwUUzQNQV4mkSGVpEOvA5u633i+oKF+WnMgZ7pat4Ip0apOOb2TNdIUILmXuM5NJw7hfBRdNN0RXCAZKhRYw+DCBDOzhczXurK8S9kq6f/7MkfyIzowgXmvdWV4h7tRTfEaVosUY6NQj5mjNPV4gZLStVkVya/50XkTfUKxe6QuxK4sR5CJSl6XG6Gq53c33qCrHehOMdpQ8DiKIK3s/VTJ/pCpGYExlv/4dHm0inpvy4uT51hcazFrFcGs5AlB83vWldofGsRZQ+DCDzZPj5FgrVj8bpwwCydKE+c1FVKBPncYoWa2QeA9tHI5OqKkRWVOb0I+UwVljja1QuVIWoWlh/oyhYc6zR86YqtF4+G+vA79E+AUel4YqpCuHgyeDJQUMdcV7DnW4EF6pC4+Wzvu/01BA+F0rwy1aFCENEM0CX/7ByO0QhTQ1r1fd568FyoD4MsGwO8KI3m41P5/3GuJez8YpZ47OX/fnpeDaTOX3vF2AxonTxwm82qfMs+vQjFS3WKO/5/BDRXJrP/38lcfowgPIWzA8R40mLBp+s0FuOwr+v8HP/J2Kssswa7R+PvJ94B776yv8PEKtosUZ7Sff7iZbDWKH8v5IPEM+l+ewjP96Br79m/v3EKlokSZIkSZIkX81/MjFrMKxwu60AAAAASUVORK5CYII="
}
}/*,
beforeUpdate() {
let that = this
Service.getPanierAuteur(this.auteur).then(function (response) {
that.contenus = response.data
})
},
updated() {
}*/,
},
watch: {
auteur: function () {
this.contenusDuPanier()
this.contenusDeLaBanque()
},
contenuAjoute: function(){
this.contenusDuPanier()
}
},
mounted() {
......@@ -151,6 +168,12 @@ export default {
$('#ensemble').draggable()
},
methods: {
whatYouGonnaDoNow: function (contenu) {
let showdown = require('showdown'),
converter = new showdown.Converter();
return converter.makeHtml(contenu)
/* console.log($(this).children().text())*/
},
contenusDuPanier: function(){
let that = this
// Dès que l'auteur est connu, on charge tous ses contenus
......@@ -234,7 +257,8 @@ export default {
)*/
},
chargerContenu: function (item, provenance){
this.modeConsultation = true;
this.panierChoisi = false
this.modeConsultation = true
this.contenuClique = item
this.contenuCliqueProvenance = provenance
},
......@@ -258,15 +282,22 @@ export default {
this.panierChoisi = false
break
case "modifier":
this.panierChoisi = true
this.modeModification = true
if (this.contenuCliqueProvenance !== 'en-cours'){
data = {auteur: this.auteur, id_contenu: JSON.stringify(event.contenu._id), version: event.contenu.versionEnCours["numero"]}
let data = {auteur: this.auteur, id_contenu: JSON.stringify(event.contenu._id), version: event.contenu.versionEnCours["numero"]}
// let that = this
Service.creerEnCours(data).then(
function () {
that.contenusDuPanier()
function (response) {
alert("Je suis l'id du contenu en cours :" + response.data)
}
)
}
else {
alert("Je suis l'id du contenu en cours :" + event.contenu._id)
}
// Il faudrait que j'arrive à récupérer l'id du contenu en cours (soit qui vient juste d'être créé, soit déja existant
break
case "supprimer":
this.panierChoisi = true
......
......@@ -3,10 +3,16 @@ import Index from '@/Index'
import VPopover from 'vue-js-popover'
import mavonEditor from 'mavon-editor';
import 'mavon-editor/dist/css/index.css';
import BootstrapVue from "bootstrap-vue"
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
//import Index from '@/Index'
Vue.config.productionTip = false
Vue.use(VPopover, { tooltip: true })
Vue.use(mavonEditor)
Vue.use(BootstrapVue)
new Vue({
render: h => h(Index),
......
......@@ -14,86 +14,92 @@ export default {
return axios.get(urlBase + "checkUser?login=" + login + "&password=" + motDePasse)
},
getPanierAuteur(auteur){
getPanierAuteur(auteur) {
return axios.get(urlBase + "getContenuPanier/" + auteur + "?perso=True&tiers=True&enCours=true")
},
getBanqueAuteur(auteur){
getBanqueAuteur(auteur) {
return axios.get(urlBase + "getContenuBanque/" + auteur)
},
getContenuById(idContenu){
getContenuById(idContenu) {
return axios.get(urlBase + "getContenu/" + idContenu)
},
creerContenuTiers(data){
creerContenuTiers(data) {
return axios.patch(urlBase + "ajouterTiers", data)
},
creerContenuPerso(data){
creerContenuPerso(data) {
return axios.post(urlBase + "addContenu", data)
},
creerEnCours(data){
creerEnCours(data) {
return axios.post(urlBase + "newEnCours", data)
},
creerEnCoursRefuse(data){
creerEnCoursRefuse(data) {
return axios.post(urlBase + "newEnCoursRefuse", data)
},
supprimerEnCours(idContenu){
supprimerEnCours(idContenu) {
return axios.delete(urlBase + "supprimerEnCours/" + idContenu)
},
supprimerEnCoursParLid(idEnCours){
supprimerEnCoursParLid(idEnCours) {
return axios.delete(urlBase + "supprimerEnCoursParId/" + idEnCours)
},
supprimerContenu(idContenu){
supprimerContenu(idContenu) {
return axios.delete(urlBase + "deletePerso/" + idContenu)
},
supprimerTiers(auteur, id_tiers){
supprimerTiers(auteur, id_tiers) {
return axios.delete(urlBase + "deleteTiers?auteur=" + auteur + "&id_tiers=" + id_tiers)
},
majContenu(data){
majContenu(data) {
return axios.patch(urlBase + "majContenu", data)
},
// bonus : fonction de récupération des tags pour getPanier et getBanque
getPublicationsRecues(auteur){
getPublicationsRecues(auteur) {
return axios.get(urlBase + "demandePublication/" + auteur + "/False")
},
getPublicationsProposees(auteur){
getPublicationsProposees(auteur) {
return axios.get(urlBase + "demandePublication/" + auteur + "/True")
},
creerDemandePublication(data) {
return axios.post(urlBase + "demandePublication" , data)
return axios.post(urlBase + "demandePublication", data)
},
supprimerDemandePublication(idDemandePublication){
supprimerDemandePublication(idDemandePublication) {
return axios.delete(urlBase + "demandePublication/" + idDemandePublication)
},
creerNouveauContenu(data){
creerNouveauContenu(data) {
return axios.post(urlBase + "newContenu", data)
},
gererDemandePublication(data){
gererDemandePublication(data) {
return axios.patch(urlBase + "gererDemandePub", data)
},
isMajTiersDisponible(auteur){
return axios.get(urlBase + "isMajTiersDisponible/" + auteur )
isMajTiersDisponible(auteur) {
return axios.get(urlBase + "isMajTiersDisponible/" + auteur)
},
listeMajTiers(auteur){
return axios.get(urlBase + "listeMajTiers/" + auteur )
listeMajTiers(auteur) {
return axios.get(urlBase + "listeMajTiers/" + auteur)
},
gererMajTiers(data) {
return axios.patch(urlBase + "gererMajTiers", data)
},
modifierContenuBasique(data) {
return axios.patch(urlBase + "modifierContenuBasique", data)
},
recupererTexteContenu(idContenu){
return axios.get(urlBase + "getTexteContenu/" + idContenu)
}
}
\ No newline at end of file
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