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
Show 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 @@
<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'"
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"
>
Hover Me
</p>
...
...
@@ -76,6 +76,9 @@ export default {
},
ajouterUnContenu
:
function
()
{
this
.
contenuAjoute
=
true
},
retourArriere
:
function
()
{
this
.
etat
=
"Contenu"
}
},
...
...
src/NewContenu.vue
View file @
39e3a3a4
...
...
@@ -15,7 +15,7 @@
<div
class=
"markdown"
>
<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>
...
...
@@ -46,8 +46,12 @@ export default {
Service
.
creerContenuPerso
(
data
).
then
(
function
()
{
that
.
$emit
(
"contenuAjoute"
)
that
.
retourArriere
()
}
)
},
retourArriere
:
function
()
{
this
.
$emit
(
"retourArriere"
)
}
}
}
...
...
src/components/Consulter_Contenu.vue
View file @
39e3a3a4
...
...
@@ -5,17 +5,21 @@
<p>
(Dans le futur, ces actions varieront en fonction du type de contenu cliqué dans la 'fenetre principale')
</p>
<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-
if=
"auteur !== contenuClique.auteur"
v-show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.etat !== 'refuse
'"
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 === 'banque'
&& contenuClique.etat !== 'refuse'
"
v-on:click=
"actionContenu('mettreFavori')"
>
mettre le contenu en tiers
</button>
<button
v-
show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.origine === 'tiers
'"
v-on:click=
"actionContenu('publier')"
>
publier le contenu
</button>
<button
v-
show=
"contenuCliqueProvenance === 'en-cours' && contenuClique.origine === 'perso
'"
v-on:click=
"actionContenu('validerModification')"
>
valider la modification
</button>
<button
v-show=
"contenuCliqueProvenance === 'banque'"
v-on:click=
"actionContenu('mettreFavori')"
>
mettre le contenu en tiers
</button>
<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>
<br>
</div>
<button
id=
"ren"
v-on:click=
"revenirArriere"
>
Retour en arrière
</button>
</div>
...
...
@@ -38,16 +42,42 @@ export default {
},
revenirArriere
:
function
()
{
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
()
{
return
{
contenu
:
''
contenu
:
''
,
versionMax
:
1
,
versionChoisie
:
1
}
},
watch
:
{
contenuClique
:
function
()
{
let
that
=
this
if
(
this
.
contenuCliqueProvenance
===
'en-cours'
)
{
Service
.
recupererTexteContenuEnCours
(
JSON
.
stringify
(
this
.
contenuClique
.
_id
)).
then
(
function
(
response
)
{
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
...
...
@@ -55,6 +85,7 @@ export default {
}
)
}
}
},
}
</
script
>
...
...
@@ -82,5 +113,11 @@ div{
height
:
auto
;
}
select
{
margin-left
:
45%
;
margin-right
:
45%
;
text-align-last
:
center
;
}
</
style
>
\ No newline at end of file
src/components/Volet_Base.vue
View file @
39e3a3a4
...
...
@@ -63,7 +63,8 @@
<td>
The table body
</td>
<td
class=
"prout"
>
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-else
>
<input
type=
"checkbox"
v-on:change=
"ajouterCoche(item.reference, item.provenance)"
class=
"horns"
name=
"horns"
/></td>
...
...
@@ -71,20 +72,18 @@
</tr>
<tr
v-show=
"!panierChoisi"
v-for=
"item in contenusbanque"
:key=
"item.titre"
>
<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
id=
"summertime"
v-on:click=
"chargerContenu(item, 'banque')"
>
{{ item._id }}
</td>
<b-popover
target=
"summertime"
v-on:show=
"rechercherTexte(item._id, 'banque')"
triggers=
"hover"
placement=
"bottom"
>
<p
id=
"beautiful"
v-html=
"texteDuContenu"
></p>
</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>
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>
</tr>
...
...
@@ -319,13 +318,10 @@ export default {
)
break
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
.
supprimerEnCours
(
JSON
.
stringify
(
event
.
contenu
.
reference
)).
then
(
function
()
{
that
.
contenusDuPanier
()
})
})
break
}
},
...
...
@@ -359,6 +355,16 @@ export default {
}
)
}
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
(
function
(
response
)
{
...
...
@@ -377,13 +383,11 @@ export default {
if
(
event
.
action
===
"valider"
){
alert
(
event
.
nouveauTexte
)
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
Service
.
creerEnCours
(
dataDeux
).
then
(
function
(
reponse
)
{
that
.
contenusDuPanier
()
alert
(
"reponse "
+
reponse
.
data
)
Service
.
changerTexte
(
data
,
reponse
.
data
)
})
}
...
...
@@ -393,6 +397,7 @@ export default {
}
}
}
}
...
...
src/service/Service.js
View file @
39e3a3a4
...
...
@@ -104,5 +104,8 @@ export default {
},
recupererTexteContenuEnCours
(
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