Editing entry labels

This commit is contained in:
2019-11-18 20:57:33 +01:00
parent 4bdb3bfc7f
commit 06ab8f2230
5 changed files with 24 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
from message.simple_messages import NoReset, Reset, ModalNotOkClose
from message.translation_edit import EditTranslation, MoveRight, MoveLeft, BinTranslation
from message.show_messages import ShowMenu, ShowEditTranslation, ShowSenseLabelEdit, ShowSenseDefinitionEdit, ShowCommentEdit, ShowAddTranslation, ShowSenseAdd, ShowExampleEdit, ShowExampleTranslationEdit, ShowVariantsEdit
from message.simple_edits import EditSenseLabel, EditSenseDefinition, EditComment, AddSenseLabel, AddSense, EditExample, AddExampleTranslation, EditExampleTranslation, AddToLabelList, AddToGenericList, EditVariants
from message.show_messages import ShowMenu, ShowEntryLabelsEdit, ShowEditTranslation, ShowSenseLabelEdit, ShowSenseDefinitionEdit, ShowCommentEdit, ShowAddTranslation, ShowSenseAdd, ShowExampleEdit, ShowExampleTranslationEdit, ShowVariantsEdit
from message.simple_edits import EditSenseLabel, EditSenseDefinition, EditComment, AddSenseLabel, AddSense, EditExample, AddExampleTranslation, EditExampleTranslation, AddToLabelList, AddToGenericList, EditVariants, EditEntryLabels
from message.message import msg

View File

@@ -102,3 +102,10 @@ class ShowAddTranslation(ClickMessage):
return
console.log("Should not be here!")
class ShowEntryLabelsEdit(ClickMessage):
def update_model(self, model):
model.modal_shown = True
model.entry.make_copy()
model.modal = lambda: modals.edit_entry_labels(model.entry)

View File

@@ -74,5 +74,12 @@ class EditVariants(Message):
def update_model(self, model):
variants = common_accessors.generic_list_getter()
model.entry.variants = variants
class EditEntryLabels(Message):
def update_model(self, model):
labels = common_accessors.label_list_getter()
model.entry.labels = labels