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='post-container'></div>
|
||||||
|
|
||||||
<div class='after-mobile-controls'>
|
<div class='after-mobile-controls'>
|
||||||
|
<div class='description'></div>
|
||||||
<% if (ctx.canCreateComments) { %>
|
<% if (ctx.canCreateComments) { %>
|
||||||
<h2>Add comment</h2>
|
<h2>Add comment</h2>
|
||||||
<div class='comment-form-container'></div>
|
<div class='comment-form-container'></div>
|
||||||
|
|
|
@ -187,6 +187,9 @@ class PostMainController extends BasePostController {
|
||||||
if (e.detail.source !== undefined && e.detail.source !== null) {
|
if (e.detail.source !== undefined && e.detail.source !== null) {
|
||||||
post.source = e.detail.source;
|
post.source = e.detail.source;
|
||||||
}
|
}
|
||||||
|
if (e.detail.desc !== undefined && e.detail.desc !== null) {
|
||||||
|
post.desc = e.detail.desc;
|
||||||
|
}
|
||||||
post.save().then(
|
post.save().then(
|
||||||
() => {
|
() => {
|
||||||
this._view.sidebarControl.showSuccess("Post saved.");
|
this._view.sidebarControl.showSuccess("Post saved.");
|
||||||
|
|
|
@ -114,6 +114,10 @@ class Post extends events.EventTarget {
|
||||||
return this._notes;
|
return this._notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get desc() {
|
||||||
|
return this._desc;
|
||||||
|
}
|
||||||
|
|
||||||
get comments() {
|
get comments() {
|
||||||
return this._comments;
|
return this._comments;
|
||||||
}
|
}
|
||||||
|
@ -277,6 +281,9 @@ class Post extends events.EventTarget {
|
||||||
if (this._source !== this._orig._source) {
|
if (this._source !== this._orig._source) {
|
||||||
detail.source = this._source;
|
detail.source = this._source;
|
||||||
}
|
}
|
||||||
|
if (this._desc !== this._orig._desc) {
|
||||||
|
detail.desc = this._desc;
|
||||||
|
}
|
||||||
|
|
||||||
let apiPromise = this._id
|
let apiPromise = this._id
|
||||||
? api.put(uri.formatApiLink("post", this.id), detail, files)
|
? api.put(uri.formatApiLink("post", this.id), detail, files)
|
||||||
|
|
Loading…
Reference in a new issue