adding-description---server-side #1

Merged
ulysia merged 2 commits from adding-description---server-side into master 2025-02-08 15:53:28 +01:00
4 changed files with 12 additions and 1 deletions
Showing only changes of commit be280acb17 - Show all commits

View file

@ -53,6 +53,7 @@
<div class='post-container'></div>
<div class='after-mobile-controls'>
<div class='description'></div>
<% if (ctx.canCreateComments) { %>
<h2>Add comment</h2>
<div class='comment-form-container'></div>

View file

@ -187,6 +187,9 @@ class PostMainController extends BasePostController {
if (e.detail.source !== undefined && e.detail.source !== null) {
post.source = e.detail.source;
}
if (e.detail.desc !== undefined && e.detail.desc !== null) {
post.desc = e.detail.desc;
}
post.save().then(
() => {
this._view.sidebarControl.showSuccess("Post saved.");

View file

@ -114,6 +114,10 @@ class Post extends events.EventTarget {
return this._notes;
}
get desc() {
return this._desc;
}
get comments() {
return this._comments;
}
@ -277,6 +281,9 @@ class Post extends events.EventTarget {
if (this._source !== this._orig._source) {
detail.source = this._source;
}
if (this._desc !== this._orig._desc) {
detail.desc = this._desc;
}
let apiPromise = this._id
? api.put(uri.formatApiLink("post", this.id), detail, files)

View file

@ -103,7 +103,7 @@ privileges:
'posts:edit:content': power
'posts:edit:flags': regular
'posts:edit:notes': regular
'posts:edit:desc': regular
'posts:edit:desc': regular
'posts:edit:relations': regular
'posts:edit:safety': power
'posts:edit:source': regular