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
39e3a3a4
Commit
39e3a3a4
authored
Jun 21, 2021
by
Jérémie Passerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Popovers banque & tags (monoligne pour l'instant)
parent
8c990e28
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
32 deletions
+84
-32
Index.vue
src/Index.vue
+4
-1
NewContenu.vue
src/NewContenu.vue
+5
-1
Consulter_Contenu.vue
src/components/Consulter_Contenu.vue
+49
-12
Volet_Base.vue
src/components/Volet_Base.vue
+22
-17
Service.js
src/service/Service.js
+4
-1
No files found.
src/Index.vue
View file @
39e3a3a4
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<Profil
v-show=
"etat === 'Profil'"
></Profil>
<Profil
v-show=
"etat === 'Profil'"
></Profil>
<Tags
v-show=
"etat === 'Tags'"
></Tags>
<Tags
v-show=
"etat === 'Tags'"
></Tags>
<p
style=
"text-align: center"
v-show=
"errorLogin"
>
Login ou mot de passe erroné
</p>
<p
style=
"text-align: center"
v-show=
"errorLogin"
>
Login ou mot de passe erroné
</p>
<NewContenu
v-show=
"etat === 'newContenu'"
v-bind:auteur=
"auteur"
@
contenuAjoute=
"ajouterUnContenu"
></NewContenu>
<NewContenu
v-show=
"etat === 'newContenu'"
v-bind:auteur=
"auteur"
@
contenuAjoute=
"ajouterUnContenu"
@
retourArriere=
"retourArriere"
></NewContenu>
<!--
<p
id=
"popover-target-1"
style=
"text-align: center"
>
<!--
<p
id=
"popover-target-1"
style=
"text-align: center"
>
Hover Me
Hover Me
</p>
</p>
...
@@ -76,6 +76,9 @@ export default {
...
@@ -76,6 +76,9 @@ export default {
},
},
ajouterUnContenu
:
function
()
{
ajouterUnContenu
:
function
()
{
this
.
contenuAjoute
=
true
this
.
contenuAjoute
=
true
},
retourArriere
:
function
()
{
this
.
etat
=
"Contenu"
}
}
},
},
...
...
src/NewContenu.vue
View file @
39e3a3a4
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<div
class=
"markdown"
>
<div
class=
"markdown"
>
<br>
<br>
<button
v-on:click=
"ajouterContenu"
>
créer
</button><br><br>
<button
v-on:click=
"ajouterContenu"
>
créer
</button><br><br>
<button>
revenir en arrière
</button>
<button
v-on:click=
"retourArriere"
>
revenir en arrière
</button>
</div>
</div>
...
@@ -46,8 +46,12 @@ export default {
...
@@ -46,8 +46,12 @@ export default {
Service
.
creerContenuPerso
(
data
).
then
(
Service
.
creerContenuPerso
(
data
).
then
(
function
()
{
function
()
{
that
.
$emit
(
"contenuAjoute"
)
that
.
$emit
(
"contenuAjoute"
)
that
.
retourArriere
()
}
}
)
)
},
retourArriere
:
function
()
{
this
.
$emit
(
"retourArriere"
)
}
}
}
}
}
}
...
...
src/components/Consulter_Contenu.vue
View file @
39e3a3a4
...
@@ -5,17 +5,21 @@
...
@@ -5,17 +5,21 @@
<p>
(Dans le futur, ces actions varieront en fonction du type de contenu cliqué dans la 'fenetre principale')
</p>
<p>
(Dans le futur, ces actions varieront en fonction du type de contenu cliqué dans la 'fenetre principale')
</p>
<div
id=
"actionsContenu"
>
<div
id=
"actionsContenu"
>
<button
v-show=
"contenuCliqueProvenance !== 'banque'
&& contenuClique.etat !== 'refuse'
"
v-on:click=
"actionContenu('modifier')"
>
modifier le contenu
</button>
<button
v-show=
"contenuCliqueProvenance !== 'banque'"
v-on:click=
"actionContenu('modifier')"
>
modifier le contenu
</button>
<button
v-show=
"contenuCliqueProvenance !== 'banque'"
v-on:click=
"actionContenu('supprimer')"
>
supprimer le contenu
</button>
<button
v-show=
"contenuCliqueProvenance !== 'banque'"
v-on:click=
"actionContenu('supprimer')"
>
supprimer le contenu
</button>
<button
v-
if=
"auteur !== contenuClique.auteur"
v-show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.etat !== 'refuse
'"
v-on:click=
"actionContenu('publier')"
>
publier le contenu
</button>
<button
v-
show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.origine === 'tiers
'"
v-on:click=
"actionContenu('publier')"
>
publier le contenu
</button>
<button
v-
else
v-show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.etat !== 'refuse
'"
v-on:click=
"actionContenu('validerModification')"
>
valider la modification
</button>
<button
v-
show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.origine === 'perso
'"
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>
<button
v-show=
"contenuCliqueProvenance === 'banque'"
v-on:click=
"actionContenu('mettreFavori')"
>
mettre le contenu en tiers
</button>
<br>
<br>
<select
v-show=
"(contenuCliqueProvenance === 'banque'
|| contenuCliqueProvenance === 'perso')
&& versionMax > 1"
v-model=
"versionChoisie"
v-on:change=
"changerVersion"
>
<option
v-for=
"i in versionMax"
v-bind:key=
"i"
>
{{
i
}}
</option>
</select>
<span
contenteditable=
"false"
v-html=
"formatterMarkdown()"
>
<span
contenteditable=
"false"
v-html=
"formatterMarkdown()"
>
</span>
</span>
<br>
<br>
</div>
</div>
<button
id=
"ren"
v-on:click=
"revenirArriere"
>
Retour en arrière
</button>
<button
id=
"ren"
v-on:click=
"revenirArriere"
>
Retour en arrière
</button>
</div>
</div>
...
@@ -38,22 +42,49 @@ export default {
...
@@ -38,22 +42,49 @@ export default {
},
},
revenirArriere
:
function
()
{
revenirArriere
:
function
()
{
this
.
$emit
(
"retour_arriere"
,
{
panierChoisi
:
this
.
contenuCliqueProvenance
!==
'banque'
})
this
.
$emit
(
"retour_arriere"
,
{
panierChoisi
:
this
.
contenuCliqueProvenance
!==
'banque'
})
},
changerVersion
:
function
()
{
let
that
=
this
Service
.
recupererTexteVersionContenu
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
),
this
.
versionChoisie
).
then
(
function
(
response
)
{
that
.
contenu
=
response
.
data
// alert(response.data)
}
)
}
}
},
},
data
:
function
()
{
data
:
function
()
{
return
{
return
{
contenu
:
''
contenu
:
''
,
versionMax
:
1
,
versionChoisie
:
1
}
}
},
},
watch
:
{
watch
:
{
contenuClique
:
function
()
{
contenuClique
:
function
()
{
let
that
=
this
let
that
=
this
Service
.
recupererTexteContenu
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
)).
then
(
if
(
this
.
contenuCliqueProvenance
===
'en-cours'
)
{
function
(
response
)
{
Service
.
recupererTexteContenuEnCours
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
)).
then
(
that
.
contenu
=
response
.
data
function
(
response
)
{
// alert(response.data)
that
.
contenu
=
response
.
data
}
// alert(response.data)
)
}
)
}
else
{
if
(
this
.
contenuCliqueProvenance
!==
'tiers'
){
this
.
versionMax
=
this
.
contenuClique
.
versionEnCours
.
numero
this
.
versionChoisie
=
this
.
versionMax
}
Service
.
recupererTexteContenu
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
)).
then
(
function
(
response
)
{
that
.
contenu
=
response
.
data
// alert(response.data)
}
)
}
}
}
},
},
}
}
...
@@ -82,5 +113,11 @@ div{
...
@@ -82,5 +113,11 @@ div{
height
:
auto
;
height
:
auto
;
}
}
select
{
margin-left
:
45%
;
margin-right
:
45%
;
text-align-last
:
center
;
}
</
style
>
</
style
>
\ No newline at end of file
src/components/Volet_Base.vue
View file @
39e3a3a4
...
@@ -63,7 +63,8 @@
...
@@ -63,7 +63,8 @@
<td>
The table body
</td>
<td>
The table body
</td>
<td
class=
"prout"
>
with two columns
</td>
<td
class=
"prout"
>
with two columns
</td>
<td>
with two columns
</td>
<td>
with two columns
</td>
<td>
with two columns
</td>
<td
v-if=
"item.provenance !== 'en-cours'"
v-b-popover
.
hover
.
bottom=
"item.tags_banque_libres.toString()"
>
with two columns
</td>
<td
v-else
v-b-popover
.
hover
.
bottom=
"'tags non disponibles'"
>
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-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>
<td
class=
"boutonSupprimer"
v-else
>
<input
type=
"checkbox"
v-on:change=
"ajouterCoche(item.reference, item.provenance)"
class=
"horns"
name=
"horns"
/></td>
...
@@ -71,20 +72,18 @@
...
@@ -71,20 +72,18 @@
</tr>
</tr>
<tr
v-show=
"!panierChoisi"
v-for=
"item in contenusbanque"
:key=
"item.titre"
>
<tr
v-show=
"!panierChoisi"
v-for=
"item in contenusbanque"
:key=
"item.titre"
>
<td
id=
"titreContenuBanque"
v-on:click=
"chargerContenu(item, 'banque')"
>
{{ item._id }}
</td>
<td
id=
"summertime"
v-on:click=
"chargerContenu(item, 'banque')"
>
{{ item._id }}
</td>
<!-- <b-popover target="titreContenuBanque" triggers="hover" placement="bottom">
<b-popover
target=
"summertime"
v-on:show=
"rechercherTexte(item._id, 'banque')"
triggers=
"hover"
placement=
"bottom"
>
<template #title>Popover Title</template>
<p
id=
"beautiful"
v-html=
"texteDuContenu"
></p>
<h1>I am</h1> popover <b>component</b> content!
</b-popover>
</b-popover>-->
<td>
{{ item.auteur }}
</td>
<td>
{{ item.auteur }}
</td>
<td>
{{item.versionEnCours}}
</td>
<td>
{{item.versionEnCours}}
</td>
<td>
with two columns
</td>
<td>
with two columns
</td>
<td
class=
"prout"
>
with two columns
</td>
<td
class=
"prout"
>
with two columns
</td>
<td>
with two columns
</td>
<td>
with two columns
</td>
<td>
with two columns
</td>
<td
v-b-popover
.
hover
.
bottom=
"item.tags_banque_libres.toString()"
>
with two columns
</td>
<td
class=
"boutonSupprimer"
>
<input
type=
"checkbox"
v-on:change=
"ajouterCoche(item._id, item.versionEnCours)"
class=
"horns"
name=
"horns"
/></td>
<td
class=
"boutonSupprimer"
>
<input
type=
"checkbox"
v-on:change=
"ajouterCoche(item._id, item.versionEnCours)"
class=
"horns"
name=
"horns"
/></td>
</tr>
</tr>
...
@@ -319,12 +318,9 @@ export default {
...
@@ -319,12 +318,9 @@ export default {
)
)
break
break
case
"validerModification"
:
case
"validerModification"
:
data
=
{
id_contenu
:
JSON
.
stringify
(
event
.
contenu
.
reference
),
auteur
:
""
}
data
=
{
id_contenu
_en_cours
:
JSON
.
stringify
(
event
.
contenu
.
_id
),
auteur
:
""
}
Service
.
majContenu
(
data
).
then
(
function
()
{
Service
.
majContenu
(
data
).
then
(
function
()
{
Service
.
supprimerEnCours
(
JSON
.
stringify
(
event
.
contenu
.
reference
)).
then
(
function
()
{
that
.
contenusDuPanier
()
that
.
contenusDuPanier
()
})
})
})
break
break
}
}
...
@@ -359,7 +355,17 @@ export default {
...
@@ -359,7 +355,17 @@ export default {
}
}
)
)
}
}
else
{
else
if
(
provenance
===
'banque'
){
Service
.
recupererTexteVersionContenu
(
JSON
.
stringify
(
id
),
0
).
then
(
function
(
response
)
{
let
showdown
=
require
(
'showdown'
),
converter
=
new
showdown
.
Converter
()
that
.
texteDuContenu
=
converter
.
makeHtml
(
response
.
data
)
}
)
}
else
{
Service
.
recupererTexteContenu
(
JSON
.
stringify
(
id
)).
then
(
Service
.
recupererTexteContenu
(
JSON
.
stringify
(
id
)).
then
(
function
(
response
)
{
function
(
response
)
{
let
showdown
=
require
(
'showdown'
),
let
showdown
=
require
(
'showdown'
),
...
@@ -377,13 +383,11 @@ export default {
...
@@ -377,13 +383,11 @@ export default {
if
(
event
.
action
===
"valider"
){
if
(
event
.
action
===
"valider"
){
alert
(
event
.
nouveauTexte
)
if
(
this
.
contenuCliqueProvenance
!==
'en-cours'
){
if
(
this
.
contenuCliqueProvenance
!==
'en-cours'
){
let
dataDeux
=
{
auteur
:
this
.
auteur
,
id_contenu
:
JSON
.
stringify
(
this
.
contenuClique
.
_id
),
version
:
this
.
contenuClique
.
versionEnCours
[
"numero"
]}
let
dataDeux
=
{
auteur
:
this
.
auteur
,
id_contenu
:
JSON
.
stringify
(
this
.
contenuClique
.
_id
),
version
:
this
.
contenuClique
.
versionEnCours
[
"numero"
]
,
provenance
:
this
.
contenuCliqueProvenance
}
let
that
=
this
let
that
=
this
Service
.
creerEnCours
(
dataDeux
).
then
(
function
(
reponse
)
{
Service
.
creerEnCours
(
dataDeux
).
then
(
function
(
reponse
)
{
that
.
contenusDuPanier
()
that
.
contenusDuPanier
()
alert
(
"reponse "
+
reponse
.
data
)
Service
.
changerTexte
(
data
,
reponse
.
data
)
Service
.
changerTexte
(
data
,
reponse
.
data
)
})
})
}
}
...
@@ -393,6 +397,7 @@ export default {
...
@@ -393,6 +397,7 @@ export default {
}
}
}
}
}
}
}
}
...
...
src/service/Service.js
View file @
39e3a3a4
...
@@ -104,5 +104,8 @@ export default {
...
@@ -104,5 +104,8 @@ export default {
},
},
recupererTexteContenuEnCours
(
idContenu
){
recupererTexteContenuEnCours
(
idContenu
){
return
axios
.
get
(
urlBase
+
"getTexteContenuEnCours/"
+
idContenu
)
return
axios
.
get
(
urlBase
+
"getTexteContenuEnCours/"
+
idContenu
)
}
},
recupererTexteVersionContenu
(
idContenu
,
version
){
return
axios
.
get
(
urlBase
+
"getTexteVersionContenu/"
+
idContenu
+
"/"
+
version
)
},
}
}
\ No newline at end of file
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