logs-content: Added remove modal, fixed move up/down mutations
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
const moment = require("moment")
|
||||
|
||||
const {postApi} = require("../../../../../rpdata/api/Post")
|
||||
|
||||
module.exports = class {
|
||||
onCreate(input) {
|
||||
this.state = {
|
||||
error: null,
|
||||
clicked: false,
|
||||
timestamp: moment(input.post.time).format("YYYY-MM-DD HH:mm:ss")
|
||||
}
|
||||
}
|
||||
|
||||
change(key, ev) {
|
||||
this.state.values[key] = ev.target.value
|
||||
}
|
||||
|
||||
open() {
|
||||
}
|
||||
|
||||
close() {
|
||||
this.emit("close")
|
||||
}
|
||||
|
||||
doIt() {
|
||||
if (this.state.clicked) {
|
||||
return
|
||||
}
|
||||
|
||||
this.state.clicked = true
|
||||
|
||||
this.emit("remove")
|
||||
this.emit("close")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<modal class="modal color-text nolabel" key="modal" enabled=(input.enabled) closable on-close("close") on-open("open") >
|
||||
<h1>Remove Post ${input.post.position}</h1>
|
||||
|
||||
<p class="color-error">${state.error}</p>
|
||||
|
||||
<p class="color-danger">Are you sure you got the right post?</p>
|
||||
|
||||
<div class="summary">
|
||||
<p><b>Timestamp</b>: ${state.timestamp}</p>
|
||||
<p><b>Kind</b>: ${input.post.kind}</p>
|
||||
<p><b>Nick</b>: ${input.post.nick}</p>
|
||||
<p><b>Text</b>: ${input.post.text}</p>
|
||||
</div>
|
||||
|
||||
<button disabled=state.loading on-click("doIt")>Yes, erase history!</button>
|
||||
</modal>
|
||||
Reference in New Issue
Block a user