adding-description---server-side #1
4 changed files with 12 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue