Commit dc197372 authored by GuiΩ's avatar GuiΩ
Browse files

feat(seances): add 'cut seance' in context menu

parent c29db654
......@@ -71,7 +71,7 @@ Events:
.FeuilleHeader
span.FeuilleHeader_deleteFeuilleBtn(
:class="{disabled: ! isDeletable}"
title="Supprimer"
:title="isDeletable ? 'Supprimer' : 'Impossible de supprimer une feuille évaluée'"
@click="deleteFeuille") 🗙
|
| feuille {{ feuille.position }}
......
......@@ -200,16 +200,20 @@ Events:
function onContextMenu(event: MouseEvent) {
console.debug('FLFS.onContextMenu', event, props.clipboard)
if (! props.selection.seances.includes(props.seanceId))
if (! props.selection.seances.includes(props.seanceId)) {
onClick(event)
}
// emit('set-selection', {seances: [ props.seanceId ]})
const multipleSel = props.selection.seances.length > 1
const multipleClip = props.clipboard.seances.length > 1
emit('show-context-menu', {event:event, options:[
{ name: 'Copier ' + (multipleSel ? ' les seances' : 'la seance') ,
callback: () => emit('copy', event) },
{ name:'Supprimer' + (multipleSel ? ' les seances' : 'la seance'),
disabled: ! selectionIsDeletable,
{ name: 'Couper ' + (multipleSel ? ' les seances' : 'la seance') ,
disabled: ! (selectionIsDeletable.value && isDeletable.value),
callback: () => {emit('copy', event) ; nextTick(); undoables.deleteSeances(props.selection.seances) }},
{ name:'Supprimer ' + (multipleSel ? 'les seances' : 'la seance'),
disabled: ! (selectionIsDeletable.value && isDeletable.value),
callback: () => undoables.deleteSeances(props.selection.seances)},
{ name: 'Insérer '+ (multipleClip ? 'les seances' : 'la seance') + ' avant',
disabled: props.clipboard.seances.length < 1,
......@@ -251,7 +255,8 @@ Events:
.Seance_header Seance&nbsp;{{ seance.position }}
|&nbsp;
span.Seance_deleteBtn(
:disabled="! isDeletable"
:class="{disabled: ! isDeletable}"
:title="isDeletable ? 'Supprimer la seance' : 'Impossible de supprimer une séance évaluée'"
@click="undoables.deleteSeance(seance)") &#x1F5D9;
.Seance_body(:class="{selected: isSelected}")
FeuilleListFeuilleSeanceSlot(
......@@ -309,8 +314,6 @@ Events:
template(v-for="model of latex.getAllModels")
template(v-if="model.type === 'SE'")
a(:href="'api/seance/' + props.seanceId +'/get_pdf/?model_id=' + model.id") {{model.label}}.pdf
br
a(v-if="isDeletable" @click="undoables.deleteSeance(seance)") Supprimer la séance
</template>
<style lang="sass">
......@@ -352,8 +355,8 @@ Events:
.Seance_date
position: relative
top: 50%
//position: relative
//top: 50%
cursor: pointer
//
......@@ -368,6 +371,7 @@ Events:
display: flex
flex-direction: column
min-width: 150px
line-height: 150%
.tools .button
......
......@@ -241,9 +241,9 @@ export class SeancesAddActionR extends MultipleAction {
for (const seance of seances)
actions.push(new SeanceAddActionR(seance))
if (! redoMsg)
redoMsg = 'Insérer des séances'
redoMsg = seances.length > 1 ? 'Insérer des séances' : 'Insérer la séance'
if (! undoMsg)
undoMsg = 'Supprimer des séances'
undoMsg = seances.length > 1 ? 'Supprimer des séances' : 'Supprimer la séance'
super(redoMsg, undoMsg, actions);
}
}
......@@ -260,9 +260,9 @@ export class SeancesDelActionR extends MultipleAction {
for (const seance of seances)
actions.push(new SeanceDelActionR(seance))
if (redoMsg === undefined)
redoMsg = 'Supprimer les séances'
redoMsg = seances.length>1 ? 'Supprimer les séances' : 'Supprimer la séance'
if (undoMsg === undefined)
undoMsg = 'Restaurer les séances'
undoMsg = seances.length>1 ? 'Restaurer les séances' : 'Restaurer la séance'
super(redoMsg, undoMsg, actions);
}
}
......
Supports Markdown
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