This commit is contained in:
@@ -3,6 +3,11 @@ module.exports = class {
|
||||
this.state = {
|
||||
modal: null,
|
||||
removed: false,
|
||||
commentLabels: {
|
||||
Article: "Comment",
|
||||
Message: "Message",
|
||||
Chat: "Chat Message",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,22 @@
|
||||
<chapter-meta kind="date" utc=true value=input.chapter.fictionalDate />
|
||||
<chapter-meta weak kind="date" value=input.chapter.createdDate />
|
||||
<chapter-meta weak kind="author" value=input.chapter.author />
|
||||
<chapter-meta weak kind="message" value=input.chapter.commentMode />
|
||||
</div>
|
||||
<markdown class="chapter-content color-text" source=input.chapter.source />
|
||||
|
||||
<div class=["comment-section", "type-" + (input.chapter.commentMode.toLowerCase() || "disabled")]>
|
||||
<comment for(comment in input.chapter.comments) key=comment.id
|
||||
comment=comment
|
||||
locked=input.chapter.commentsLocked
|
||||
mode=input.chapter.commentMode
|
||||
user=input.user
|
||||
/>
|
||||
<if-permitted if(input.chapter.canComment) user=input.user author=input.chapter.author permission="chapter.edit">
|
||||
<div class="add-comment color-menu" on-click("open", "addComment") >Add ${state.commentLabels[input.chapter.commentMode] || "Comment"}</div>
|
||||
</if-permitted>
|
||||
</div>
|
||||
<edit-chapter-modal enabled=(state.modal === "edit") chapter=input.chapter on-close("close") on-edit("updateChapter") />
|
||||
<create-comment-modal enabled=(state.modal === "addComment") chapter=input.chapter user=input.user on-close("close") on-add("addComment") />
|
||||
<move-chapter-modal enabled=(state.modal === "move") chapter=input.chapter user=input.user on-close("close") on-move("moveChapter") />
|
||||
<remove-chapter-modal enabled=(state.modal === "remove") chapter=input.chapter on-close("close") on-remove("removeChapter") />
|
||||
</div>
|
||||
@@ -49,4 +49,30 @@
|
||||
div.chapter-content {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
div.comment-section {
|
||||
margin: 1em 4ch 2em 4ch;
|
||||
|
||||
div.add-comment {
|
||||
text-align: center;
|
||||
margin-top: 1em;
|
||||
padding: 1em 0;
|
||||
font-size: 1.5em;
|
||||
border: 1px solid;
|
||||
opacity: 0.5;
|
||||
cursor: pointer;
|
||||
}
|
||||
div.add-comment:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
div.add-comment:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
div.comment-section {
|
||||
margin: 1em 2ch 2em 2ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user