diff --git a/marko/components/modal/style.less b/marko/components/modal/style.less
index db2568a..6257266 100644
--- a/marko/components/modal/style.less
+++ b/marko/components/modal/style.less
@@ -113,6 +113,17 @@ div.overlay {
opacity: 1;
cursor: pointer;
}
+
+ div.summary {
+ text-align: left;
+ margin: auto;
+
+ p {
+ margin: 0;
+ text-indent: -2ch;
+ margin-left: 2ch;
+ }
+ }
}
div.modal.nolabel {
input, textarea {
diff --git a/marko/page/logs-content/components/page/component.js b/marko/page/logs-content/components/page/component.js
index 28eba57..d73a0d9 100644
--- a/marko/page/logs-content/components/page/component.js
+++ b/marko/page/logs-content/components/page/component.js
@@ -41,7 +41,11 @@ module.exports = class {
this.state.log = Object.assign({}, this.state.log)
}
- movePost(post, toPosition) {
+ movePost(post, toPosition, relative) {
+ if (relative) {
+ toPosition = post.position + toPosition
+ }
+
postApi.move({id: post.id, toPosition}).then(patches => {
this.patch(patches)
}).catch(err => {
@@ -49,6 +53,23 @@ module.exports = class {
})
}
+ removePost(post) {
+ postApi.remove({id: post.id}).then(() => {
+ this.state.log.posts = this.state.log.posts.filter(p => p.id !== post.id)
+
+ for (const p of this.state.log.posts) {
+ if (p.position > post.position) {
+ p.position--
+ }
+ }
+
+ this.state.log = Object.assign({}, this.state.log)
+ }).catch(errs => {
+ console.warn("Failed to delete:", errs)
+ this.state.error = "Failed to delete: " + (errs.message || errs[0].message)
+ })
+ }
+
get title() {
if (this.state.log.title) {
return this.state.log.title
diff --git a/marko/page/logs-content/components/page/index.marko b/marko/page/logs-content/components/page/index.marko
index 47603f3..167a872 100644
--- a/marko/page/logs-content/components/page/index.marko
+++ b/marko/page/logs-content/components/page/index.marko
@@ -2,6 +2,13 @@
${component.title}
-
${state.error}
+ +Are you sure you got the right post?
+ +Timestamp: ${state.timestamp}
+Kind: ${input.post.kind}
+Nick: ${input.post.nick}
+Text: ${input.post.text}
+