data: Added character list/add/edit/remove

This commit is contained in:
2018-10-06 14:26:38 +02:00
parent 0e7f2d0f7e
commit 5b28ce4bc2
28 changed files with 551 additions and 3 deletions
@@ -0,0 +1,20 @@
module.exports = class {
onCreate() {
this.state = {
modal: null,
deleted: false,
}
}
open(modal) {
this.state.modal = modal
}
close() {
this.state.modal = null
}
removed() {
this.state.deleted = true
}
}
@@ -0,0 +1,12 @@
<if (!state.deleted)>
<compact-list-property primary short label="ID" value=input.data.id />
<compact-list-property label="Nick" value=(input.data.nick) weak=("+" + (input.data.nicks.length - 1)) showWeak=(input.data.nicks.length > 0) />
<compact-list-property long label="Name" value=input.data.name />
<compact-list-property short label="Author" value=input.data.author />
<compact-list-options long>
<a key="edit" on-click("open", "edit", input.data)>Edit</a>
<a key="remove" on-click("open", "remove", input.data)>Remove</a>
</compact-list-options>
<remove-character-modal enabled=(state.modal === "remove") character=input.data on-removed("emit", "removed") on-close("close") />
<edit-character-modal enabled=(state.modal === "edit") character=input.data on-edited("emit", "edited") on-close("close") />
</if>