Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenQuizz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Weber Rodolphe
OpenQuizz
Commits
689a5e29
Commit
689a5e29
authored
Sep 23, 2021
by
Jérémie Passerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sauvegarde avant essais css sur le menu
parent
045f8d04
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
169 additions
and
55 deletions
+169
-55
ImporterFichier.vue
src/ImporterFichier.vue
+24
-5
Maj.vue
src/Maj.vue
+8
-5
Menu.vue
src/Menu.vue
+4
-4
NewContenu.vue
src/NewContenu.vue
+1
-6
Previsualiser_Moodle.vue
src/Previsualiser_Moodle.vue
+3
-2
Consulter_Contenu.vue
src/components/Consulter_Contenu.vue
+18
-4
Modifier_Contenu.vue
src/components/Modifier_Contenu.vue
+36
-14
Volet_Base.vue
src/components/Volet_Base.vue
+56
-13
Service.js
src/service/Service.js
+19
-2
No files found.
src/ImporterFichier.vue
View file @
689a5e29
<
template
>
<div
style=
"text-align: center"
>
<div>
<div
style=
"text-align: center"
v-show=
"isImportation"
>
Je suis la page pour charger un contenu
<br>
...
...
@@ -7,29 +8,45 @@
<div
class=
"markdown"
>
<br>
<button
class=
"ajouterContenu"
v-on:click=
"
ajouterContenu
"
>
créer
</button><br><br>
<button
class=
"ajouterContenu"
v-on:click=
"
choisirTags
"
>
créer
</button><br><br>
<button
class=
"retourArriere"
v-on:click=
"retourArriere"
>
revenir en arrière
</button>
</div>
</div>
<TagsFixes
v-show=
"!isImportation"
@
tags=
"ajouterContenu"
></TagsFixes>
</div>
</
template
>
<
script
>
import
Service
from
"./service/Service"
;
import
TagsFixes
from
"./TagsFixes"
;
export
default
{
name
:
"ImporterFichier"
,
components
:
{
TagsFixes
},
props
:
{
// l'auteur connecté
auteur
:
{}
},
data
()
{
return
{
formData
:
null
formData
:
null
,
isImportation
:
true
}
},
methods
:
{
/**
* @vuese
* Fonction pour déclencher l'affichage de la page pour choisir les tags fixes
*/
choisirTags
:
function
()
{
this
.
isImportation
=
false
},
/**
* @vuese
* permet 'd'enrengistrer' le fichier uploadé via le formulaire
...
...
@@ -51,15 +68,17 @@ export default {
* @vuese
* Fonction permettant l'ajout du fichier en tant que contenu
*/
ajouterContenu
:
function
()
{
ajouterContenu
:
function
(
event
)
{
let
that
=
this
Service
.
uploaderContenuPerso
(
this
.
formData
,
this
.
auteur
).
then
(
Service
.
uploaderContenuPerso
(
this
.
formData
,
this
.
auteur
,
JSON
.
stringify
(
event
.
tags
)
).
then
(
function
(
reponse
)
{
let
nouveauContenu
=
reponse
.
data
nouveauContenu
.
provenance
=
"perso"
nouveauContenu
.
tags_libres
=
[]
that
.
$emit
(
"contenuAjoute"
,
{
contenu
:
nouveauContenu
})
that
.
contenuSaisi
=
''
that
.
retourArriere
()
that
.
isImportation
=
true
}
)
}
...
...
src/Maj.vue
View file @
689a5e29
...
...
@@ -69,7 +69,8 @@
<tr
v-for=
"(item, index) in contenusPropose"
:key=
"index"
>
<td
:id=
"JSON.stringify(item._id)"
v-on:click=
"consulterContenuMaj(item)"
>
{{
item
.
titre
}}
</td>
<b-popover
:target=
"JSON.stringify(item._id)"
v-on:show=
"rechercherTexteMaj(item)"
triggers=
"hover"
placement=
"bottom"
>
<p
v-html=
"texteDuContenuMaj"
></p>
<p
v-html=
"texteDuContenuMaj"
v-if=
"item.source !== 'moodle'"
></p>
<Previsualiser
_Moodle
v-bind:id=
"item.idContenuEnCours"
v-bind:provenance=
"contenuCliqueProvenance"
v-else
></Previsualiser
_Moodle
>
</b-popover>
<td>
{{
item
.
auteurContenu
}}
</td>
<td>
1
</td>
...
...
@@ -95,10 +96,12 @@
<
script
>
import
Service
from
"./service/Service"
;
import
Consulter_Contenu
from
"./components/Consulter_Contenu"
;
import
Previsualiser_Moodle
from
"@/Previsualiser_Moodle"
;
export
default
{
name
:
"Maj"
,
components
:
{
Previsualiser_Moodle
,
Consulter_Contenu
},
props
:
{
...
...
@@ -326,9 +329,9 @@ export default {
action
:
false
,
detailContenu
:
false
,
contenuClique
:
null
,
contenuCliqueProvenance
:
''
,
contenuCliqueProvenance
:
'
maj
'
,
texteDuContenuMaj
:
''
,
isModeRecu
:
true
isModeRecu
:
true
,
}
},
watch
:
{
...
...
@@ -376,10 +379,10 @@ div{
table
{
margin-top
:
10px
;
margin-left
:
185px
;
margin-left
:
9.5vw
;
margin-bottom
:
10px
;
width
:
1550px
;
width
:
81vw
;
}
th
,
...
...
src/Menu.vue
View file @
689a5e29
...
...
@@ -167,10 +167,10 @@ export default {
this
.
styleCircle
[
"margin-left"
]
=
"3%"
}
else
if
(
this
.
variante
){
this
.
styleCircle
[
"margin-left"
]
=
"
38.87%
"
this
.
styleCircle
[
"margin-left"
]
=
"
50vw
"
}
else
{
this
.
styleCircle
[
"margin-left"
]
=
"94.75
%
"
this
.
styleCircle
[
"margin-left"
]
=
"94.75
vw
"
}
},
...
...
@@ -246,13 +246,13 @@ export default {
.menuHaut
{
display
:
flex
;
background-color
:
white
;
justify-content
:
center
;
justify-content
:
space-evenly
;
}
.menuManuel
{
display
:
flex
;
background-color
:
white
;
justify-content
:
space-
between
;
justify-content
:
space-
evenly
;
}
.circle
{
...
...
src/NewContenu.vue
View file @
689a5e29
...
...
@@ -7,14 +7,9 @@
</div>
<br>
<p>
Dans cette zone vous pouvez renseigner (en langage markdown) le contenu que vous désirez
</p>
<!--
<div
class=
"markdown"
>
<textarea
rows=
"50"
cols=
"150"
/>
</div>
-->
<!--
<vue-simplemde
id=
"markdownEditor"
v-model=
"contenuSaisi"
/>
-->
<div
class=
"mavonEditor"
>
<mavon-editor
:language=
"'fr'"
style=
"position: static; height: 78vh; margin-top: -0.
5
%"
v-model=
"contenuSaisi"
/>
<mavon-editor
:language=
"'fr'"
style=
"position: static; height: 78vh; margin-top: -0.
77
%"
v-model=
"contenuSaisi"
/>
</div>
<div
class=
"markdown"
>
<br>
...
...
src/Previsualiser_Moodle.vue
View file @
689a5e29
...
...
@@ -43,8 +43,9 @@ export default {
* A chaque fois que prévisualiser_moodle est appelé on fait appel a parserTexte pour permettre d'appeler le bon composant d'affichage
*/
let
that
=
this
//alert(this.provenance)
if
(
this
.
provenance
!==
'en-cours'
)
{
// alert(this.provenance)
if
(
this
.
provenance
!==
'en-cours'
&&
this
.
provenance
!==
'maj'
)
{
Service
.
parserTexte
(
JSON
.
stringify
(
this
.
id
)).
then
(
function
(
response
)
{
that
.
questionParsee
=
response
.
data
})
...
...
src/components/Consulter_Contenu.vue
View file @
689a5e29
...
...
@@ -58,8 +58,9 @@
</table>
<br>
<p>
Voici l'intérieur de votre contenu dans sa version
{{
versionChoisie
}}
:
</p>
<span
contenteditable=
"false"
style=
"background-color: white; width: 50vw; margin-left: auto; margin-right: auto"
v-html=
"formatterMarkdown()"
>
<span
v-if=
"sourceContenu !== 'moodle'"
contenteditable=
"false"
style=
"background-color: white; width: 50vw; margin-left: auto; margin-right: auto"
v-html=
"formatterMarkdown()"
>
</span>
<Previsualiser
_Moodle
v-else
v-bind:id=
"idContenu"
v-bind:provenance=
"contenuCliqueProvenance"
></Previsualiser
_Moodle
>
<br>
</div>
<p
style=
"text-align: center"
v-show=
"isContenuRefuse"
>
Ceci est un contenu en cours ayant fait l'objet d'un refus de publication. Aucune action disponible
</p>
...
...
@@ -70,9 +71,11 @@
<
script
>
import
Service
from
"../service/Service"
;
import
Previsualiser_Moodle
from
"@/Previsualiser_Moodle"
;
export
default
{
name
:
"Consulter_Contenu"
,
components
:
{
Previsualiser_Moodle
},
props
:
{
// Le contenu cliqué
contenuClique
:
{},
...
...
@@ -178,7 +181,8 @@ export default {
sourceContenu
:
''
,
populariteContenu
:
0
,
noteContenu
:
0
,
tagsContenus
:
[]
tagsContenus
:
[],
idContenu
:
''
}
},
watch
:
{
...
...
@@ -189,14 +193,24 @@ export default {
contenuClique
:
function
()
{
let
that
=
this
alert
(
"AYA"
)
if
(
this
.
contenuCliqueProvenance
===
'maj'
){
this
.
idContenu
=
this
.
contenuClique
.
idContenuEnCours
}
else
{
this
.
idContenu
=
this
.
contenuClique
.
_id
}
this
.
titreContenu
=
this
.
contenuClique
.
titre
this
.
populariteContenu
=
this
.
contenuClique
.
popularite
if
(
typeof
this
.
contenuClique
.
tags_fixes
===
"string"
)
{
this
.
tagsContenus
=
JSON
.
parse
(
this
.
contenuClique
.
tags_fixes
)
this
.
tagsContenus
=
this
.
tagsContenus
.
join
(
", "
)
}
else
{
this
.
tagsContenus
=
this
.
contenuClique
.
tags_fixes
===
undefined
?
[]
:
this
.
contenuClique
.
tags_fixes
.
join
(
", "
)
}
this
.
isContenuRefuse
=
false
this
.
typeContenu
=
this
.
contenuClique
.
type
this
.
sourceContenu
=
this
.
contenuClique
.
source
this
.
noteContenu
=
this
.
contenuClique
.
versionEnCours
===
undefined
?
''
:
this
.
calculerNoteDetailContenu
()
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
this
.
contenuClique
,
'refuse'
)){
...
...
src/components/Modifier_Contenu.vue
View file @
689a5e29
...
...
@@ -22,13 +22,14 @@
<label
v-if=
"sourceContenu !== 'moodle'"
>
Titre du contenu :
</label>
<label
v-else
>
Nom de la question :
</label>
<br>
<select
v-show=
"contenuCliqueProvenance === 'perso' && versionMax > 1"
v-model=
"versionChoisie"
v-on:change=
"changerVersion"
>
<option
v-for=
"i in versionMax"
v-bind:key=
"i"
>
{{
i
}}
</option>
<select
v-show=
"contenuCliqueProvenance === 'perso' && versionMax > 1"
v-model=
"versionChoisie"
v-on:change=
"changerVersion"
style=
"margin-right: 5px; background: none; border: none"
>
<option
v-for=
"i in versionMax"
v-bind:key=
"i"
>
v
{{
i
}}
</option>
</select>
<input
type=
"text"
id=
"titreDuContenu"
placeholder=
"titre du contenu"
style=
"width: 350px; outline: none; border: none"
v-model=
"titreContenu"
>
</div>
<div
id=
"voirNote"
>
<button
v-show=
"contenuCliqueProvenance === 'tiers' && !notePresente"
id=
"noterContenu"
>
{{
messageNoter
}}
</button>
<button
style=
"margin-left: 10px; background: floralwhite; border: none"
v-show=
"contenuCliqueProvenance === 'tiers' && !notePresente"
id=
"noterContenu"
>
{{
messageNoter
}}
</button>
<b-popover
target=
"noterContenu"
triggers=
"click"
placement=
"bottom"
>
<star-rating
@
rating-selected =
"setRating"
v-model=
"rating"
:read-only=
"notePresente"
:show-rating=
"false"
:increment=
0.5
:star-size=
25
/>
</b-popover>
...
...
@@ -52,15 +53,17 @@
<span
class=
"boutonAction"
v-show=
"contenuCliqueProvenance !== 'maj' && contenuCliqueProvenance === 'en-cours' &&
(contenuClique.origine === 'perso' || contenuClique.anonyme === 'oui')"
v-on:click=
"actionContenu('validerModification')"
id=
"validerContenu"
>
valider contenu
</span>
<span
class=
"boutonAction"
v-show=
"sourceContenu === 'moodle'"
v-on:click=
"actionContenu('exporter')"
id=
"exporterContenu"
>
Exporter
</span>
</div>
</div>
<br>
<div
class=
"mavonEditor"
v-show=
"!isModeTag && sourceContenu !== 'moodle'"
>
<mavon-editor
:language=
"'fr'"
style=
"position: static; height: 7
9vh; margin-top: -0.5
%"
v-model=
"texteDuContenu"
/>
<mavon-editor
:language=
"'fr'"
style=
"position: static; height: 7
8vh; margin-top: -0.77
%"
v-model=
"texteDuContenu"
/>
</div>
<TagsLibres
v-show=
"isModeTag"
v-bind:contenu=
"this.contenuClique"
v-bind:auteur=
"auteur"
@
actionTagLibre=
"actionTagLibre"
style=
"position: static; height: 7
9vh; margin-top: -0.5
%"
v-bind:darktheme=
"darktheme"
@
chargerTagsLibres=
"chargerTagsLibres"
v-bind:tagLibreAssocie=
"tagLibreAssocie"
></TagsLibres>
style=
"position: static; height: 7
8vh; margin-top: -0.77
%"
v-bind:darktheme=
"darktheme"
@
chargerTagsLibres=
"chargerTagsLibres"
v-bind:tagLibreAssocie=
"tagLibreAssocie"
></TagsLibres>
<Edit
_Contenus
@
actionMoodle=
"actionMoodle"
v-show=
"!isModeTag && sourceContenu === 'moodle'"
v-bind:darktheme=
"darktheme"
v-bind:idContenu=
"idContenu"
v-bind:provenance=
"contenuCliqueProvenance"
></Edit
_Contenus
>
...
...
@@ -292,6 +295,8 @@ export default {
}
let
that
=
this
if
(
this
.
contenuCliqueProvenance
!==
'banque'
){
Service
.
recupererNoteContenu
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
),
this
.
auteur
,
this
.
versionChoisie
).
then
(
function
(
result
)
{
let
nombre
=
result
.
data
if
(
nombre
!==
'-'
)
{
...
...
@@ -301,6 +306,7 @@ export default {
}
})
}
}
},
/**
* @vuese
...
...
@@ -332,7 +338,7 @@ button {
#validerModif
{
margin-right
:
5px
;
margin-bottom
:
5
px
;
margin-bottom
:
10
px
;
}
#titreContenu
{
...
...
@@ -388,6 +394,7 @@ button {
#supprimerContenuSolo
::before
{
content
:
"\01F5D1"
;
font-size
:
20px
;
/* border-right: 1px solid black;
margin-right: 10px;
...
...
@@ -398,6 +405,8 @@ button {
content
:
"\01F5D1"
;
color
:
transparent
;
text-shadow
:
0
0
0
white
;
font-size
:
20px
;
}
#supprimerContenu
::before
{
...
...
@@ -405,6 +414,8 @@ button {
border-right
:
1px
solid
black
;
margin-right
:
10px
;
padding-right
:
10px
;
font-size
:
20px
;
}
#supprimerContenuDark
::before
{
...
...
@@ -414,6 +425,8 @@ button {
border-right
:
1px
solid
black
;
margin-right
:
10px
;
padding-right
:
10px
;
font-size
:
20px
;
}
...
...
@@ -451,4 +464,13 @@ button {
position: absolute;*/
}
#exporterContenu
::before
{
content
:
"\01F4F0"
;
margin-right
:
5px
;
border-left
:
1px
solid
black
;
padding-left
:
10px
;
margin-left
:
10px
;
}
</
style
>
\ No newline at end of file
src/components/Volet_Base.vue
View file @
689a5e29
...
...
@@ -100,7 +100,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw
<td
class=
"boutonSupprimer"
>
<input
type=
"checkbox"
v-on:change=
"ajouterCoche($event, item._id, item.provenance, item.note_perso)"
class=
"horns"
name=
"horns"
/></td>
</tr>
<tr
v-show=
"!panierChoisi && (!modeModification && !modeConsultation)"
v-for=
"item in contenus
b
anque"
:key=
"JSON.stringify(item._id)"
<tr
v-show=
"!panierChoisi && (!modeModification && !modeConsultation)"
v-for=
"item in contenus
B
anque"
:key=
"JSON.stringify(item._id)"
v-bind:style=
"
{'background-color': 'white'}" >
<td
:id=
"'a' + JSON.stringify(item._id)"
v-on:click=
"chargerContenu(item, 'banque')"
>
{{
item
.
titre
}}
</td>
<b-popover
:target=
"'a' + JSON.stringify(item._id)"
v-on:show=
"rechercherTexte(item._id, 'banque', item.source)"
triggers=
"hover"
placement=
"bottom"
>
...
...
@@ -190,7 +190,7 @@ export default {
filtre_choisi
:
""
,
variante
:
false
,
contenus
:
[],
contenus
b
anque
:
[],
contenus
B
anque
:
[],
contenusTotal
:
[],
contenusTotalBanque
:
[],
contenuClique
:
""
,
...
...
@@ -250,6 +250,8 @@ export default {
this
.
modeConsultation
=
false
this
.
panierChoisi
=
true
this
.
isDeconnecte
=
true
this
.
contenus
=
[]
this
.
contenusBanque
=
[]
},
/**
* @vuese
...
...
@@ -371,7 +373,7 @@ export default {
let
that
=
this
Service
.
getBanqueAuteur
(
this
.
auteur
).
then
(
function
(
response
)
{
that
.
contenusTotalBanque
=
Array
.
from
(
response
.
data
)
that
.
contenus
b
anque
=
that
.
contenusTotalBanque
that
.
contenus
B
anque
=
that
.
contenusTotalBanque
})
},
/**
...
...
@@ -431,7 +433,7 @@ export default {
let
contenuSupprime
=
that
.
contenus
.
filter
(
contenu
=>
contenu
.
_id
===
id
)
that
.
contenus
=
that
.
contenus
.
filter
(
contenu
=>
contenu
.
_id
!==
id
)
if
(
response
.
data
!==
'0'
)
that
.
contenus
b
anque
.
push
(
contenuSupprime
[
0
])
that
.
contenus
B
anque
.
push
(
contenuSupprime
[
0
])
}
)
}
else
{
...
...
@@ -443,6 +445,20 @@ export default {
}
}
if
(
this
.
checkes
.
length
===
0
){
//alert("Le caca du pipi" + this.contenus.length)
for
(
let
itBe
in
this
.
contenus
){
// this.ajouterCoche(this.contenus[itBe]._id, this.contenus[itBe].provenance, this.contenus[itBe].note_perso)
this
.
checkes
.
push
([
this
.
contenus
[
itBe
].
_id
,
this
.
contenus
[
itBe
].
provenance
,
this
.
contenus
[
itBe
].
note_perso
])
}
$
(
".horns"
).
prop
(
"checked"
,
true
);
return
//this.checkes.push([idContenu, provenance, notePerso])
}
}
// dans ce cas -> mode appropriation de contenu banque
else
{
...
...
@@ -457,7 +473,7 @@ export default {
nouveauTiers
.
provenance
=
"tiers"
nouveauTiers
.
version
=
version
that
.
contenus
.
push
(
nouveauTiers
)
that
.
contenus
banque
=
that
.
contenusb
anque
.
filter
(
contenu
=>
contenu
.
_id
!==
id
)
that
.
contenus
Banque
=
that
.
contenusB
anque
.
filter
(
contenu
=>
contenu
.
_id
!==
id
)
// data= {id_contenu:JSON.stringify(id) , version: version}
//Service.incrementerPopularite(data)
}
...
...
@@ -532,8 +548,9 @@ export default {
let
data
=
{}
let
that
=
this
let
auteur
=
""
let
version
=
0
;
let
version
=
0
let
id
=
''
let
nom_fichier
=
''
switch
(
event
.
action
)
{
...
...
@@ -552,7 +569,7 @@ export default {
nouveauTiers
.
provenance
=
"tiers"
nouveauTiers
.
version
=
version
that
.
contenus
.
push
(
nouveauTiers
)
that
.
contenus
banque
=
that
.
contenusb
anque
.
filter
(
contenu
=>
contenu
.
_id
!==
event
.
contenu
.
_id
)
that
.
contenus
Banque
=
that
.
contenusB
anque
.
filter
(
contenu
=>
contenu
.
_id
!==
event
.
contenu
.
_id
)
// data= {id_contenu:JSON.stringify(id) , version: version}
// Service.incrementerPopularite(data)
...
...
@@ -582,7 +599,7 @@ export default {
function
()
{
let
contenuSupprime
=
that
.
contenus
.
filter
(
contenu
=>
contenu
.
_id
===
event
.
contenu
.
_id
)
that
.
contenus
=
that
.
contenus
.
filter
(
contenu
=>
contenu
.
_id
!==
event
.
contenu
.
_id
)
that
.
contenus
b
anque
.
push
(
contenuSupprime
[
0
])
that
.
contenus
B
anque
.
push
(
contenuSupprime
[
0
])
}
)
}
else
{
...
...
@@ -596,7 +613,7 @@ export default {
case
"publier"
:
this
.
panierChoisi
=
true
data
=
{
id_contenu
:
JSON
.
stringify
(
event
.
contenu
.
reference
),
id_contenu_en_cours
:
JSON
.
stringify
(
event
.
contenu
.
_id
),
auteur_en_cours
:
this
.
auteur
,
version
:
event
.
contenu
.
version
.
toString
()}
auteur_en_cours
:
this
.
auteur
,
version
:
event
.
contenu
.
version
.
toString
()
,
source
:
event
.
contenu
.
source
}
// this.$emit("rechercherNouvellesPublications")
Service
.
creerDemandePublication
(
data
).
then
(
function
()
{
...
...
@@ -622,6 +639,34 @@ export default {
that
.
panierChoisi
=
true
})
break
case
"exporter"
:
nom_fichier
=
this
.
contenuClique
.
fichier
.
substring
(
this
.
contenuClique
.
fichier
.
lastIndexOf
(
"/"
)
+
1
)
if
(
this
.
contenuCliqueProvenance
===
'en-cours'
){
Service
.
exporterXMLEnCours
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
)).
then
(
function
(
reponse
)
{
const
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
reponse
.
data
]));
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
url
link
.
setAttribute
(
'download'
,
nom_fichier
)
//or any other extension
document
.
body
.
appendChild
(
link
)
link
.
click
()
that
.
panierChoisi
=
true
})
}
else
{
Service
.
exporterXML
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
)).
then
(
function
(
reponse
)
{
const
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
reponse
.
data
]));
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
url
link
.
setAttribute
(
'download'
,
nom_fichier
)
//or any other extension
document
.
body
.
appendChild
(
link
)
link
.
click
()
that
.
panierChoisi
=
true
})
}
break
}
},
/**
...
...
@@ -645,9 +690,7 @@ export default {
}
})
for (let i = 0; i < this.checkes.length; i++){
if (this.checkes[i][0] === idContenu){
existant = true
}
...
...
@@ -718,10 +761,10 @@ export default {
this
.
panierChoisi
=
true
//this.contenuClique = []
//this.contenuCliqueProvenance = ''
this
.
$emit
(
"ChangerTitre"
,
{
titre
:
""
})
if
(
event
.
action
!==
'arriere'
)
{
this
.
$emit
(
"ChangerTitre"
,
{
titre
:
""
})
let
data
=
{}
// on prépare les données suivant le type de contenu ('valider' -> markdown, 'modifier' -> XML moodle)
if
(
event
.
action
===
"valider"
)
{
...
...
@@ -919,7 +962,7 @@ export default {
this
.
contenus
=
contenusFiltres
}
else
{
this
.
contenus
b
anque
=
contenusFiltres
this
.
contenus
B
anque
=
contenusFiltres
}
},
/* basculeRechercheFiltre: function (event) {
...
...
src/service/Service.js
View file @
689a5e29
...
...
@@ -46,6 +46,17 @@ export default {
//console.log("headon : " + header)
},
getSpecialHeader
(){
this
.
verifierToken
(
localStorage
.
token
)
return
{
responseType
:
'blob'
,
headers
:
{
'Content-Type'
:
'application/json'
}
}
},
getRefreshHeader
(
token
){
//this.verifierToken(token)
return
{
...
...
@@ -83,8 +94,8 @@ export default {
creerContenuPerso
(
data
)
{
return
axios
.
post
(
urlBase
+
contenus
+
"addContenu"
,
data
,
this
.
getHeader
())
},
uploaderContenuPerso
(
data
,
auteur
){
return
axios
.
post
(
urlBase
+
contenus
+
"uploadContenu/"
+
auteur
,
data
,
{
uploaderContenuPerso
(
data
,
auteur
,
tags
){
return
axios
.
post
(
urlBase
+
contenus
+
"uploadContenu/"
+
auteur
+
"?tags="
+
tags
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
,
Authorization
:
"Bearer "
+
localStorage
.
token
,
...
...
@@ -178,7 +189,13 @@ export default {
parserTexte
(
id_contenu
)
{
return
axios
.
get
(
urlBase
+
contenus
+
"parserContenu/"
+
id_contenu
,
this
.
getHeader
())
},
exporterXML
(
id_contenu
)
{
return
axios
.
get
(
urlBase
+
contenus
+
"exporterContenuXml/"
+
id_contenu
,
this
.
getSpecialHeader
())
},
// gestion des en-cours
exporterXMLEnCours
(
id_contenu
){
return
axios
.
get
(
urlBase
+
en_cours
+
"exporterContenuXmlEnCours/"
+
id_contenu
,
this
.
getSpecialHeader
())
},
modifierXMLEnCours
(
data
){
return
axios
.
patch
(
urlBase
+
en_cours
+
"modifierXMLEnCours"
,
data
,
this
.
getHeader
())
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment