Gisle Aune
6 years ago
8 changed files with 122 additions and 7 deletions
-
11marko/components/modal/style.less
-
23marko/page/logs-content/components/page/component.js
-
9marko/page/logs-content/components/page/index.marko
-
8marko/page/logs-content/components/post/component.js
-
9marko/page/logs-content/components/post/index.marko
-
35marko/page/logs-content/components/remove-post-modal/component.js
-
16marko/page/logs-content/components/remove-post-modal/index.marko
-
18rpdata/api/Post.js
@ -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> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue