email: "",
tags_string: "",
related_urls: "",
- display: "1",
+ display: 1,
posttype: 1,
formatter: "modern",
id: "",
}
if (this.contentType == "story") {
- newslash.previewStory(postData).then(
+ newslash.admin.previewStory(postData).then(
(resp) => { // success
this.message = "";
this.previewTitle = resp.item.title;
// story post
if (this.contentType == "story") {
postData.csrf_token = this.csrfToken;
- newslash.postStory(postData).then(
+ newslash.admin.postStory(postData).then(
(resp) => { // success
this.message = "";
- var id = resp.id;
+ var id = resp.sid;
var type = resp.type;
var url = '/' + type + '/' + id;
// check if new post
if (!postData.id) {
this.createdUrl = url;
- this.item.subid = id;
+ this.item.sid = id;
}
this.message = "";
this.mode = "posted";
_loadStoryFromSubmission.call(this);
} else if (this.sourceType == "journal") {
_loadStoryFromJournal.call(this);
+ } else if (this.sourceType == "story") {
+ _loadStory.call(this);
} else {
// create new story
_createNewStory.call(this);
}
function _prepareStory(item) {
+ item.content_type = 'story';
for (var k in this.editor) {
if (item[k] !== undefined) {
this.editor[k] = item[k];
}
function _loadStory() {
- newslash.admin.getStory(this.contentId).then(
+ newslash.admin.getStory(this.sourceId).then(
resp => {
_prepareStory.call(this, resp.item);
},
<div class="content-editor-wrap">
<div class="alert alert-info post-done" v-if="mode == 'posted' && isUpdate">
投稿を更新しました。
- <span v-if="item.content_type == 'story'"><a href="#" @click="leavePreview">[再編集]</a></span>
+ <span v-if="contentType == 'story'"><a href="#" @click="leavePreview">[再編集]</a></span>
</div>
<div class="alert alert-info post-done" v-else-if="mode == 'posted'">
投稿を行いました。URL:<A :href="createdUrl" v-text="createdUrl"></a>
- <span v-if="item.content_type == 'story'"><a href="#" @click="leavePreview">[再編集]</a></span>
+ <span v-if="contentType == 'story'"><a href="#" @click="leavePreview">[再編集]</a></span>
</div>
<div class="alert alert-info post-error-message" v-show="message">
<div v-if="message == 'duplicated_post'">エラー:すでに同じ内容が投稿されています</div>
</label>
</p>
- <div v-if="item.content_type == 'story'">
+ <div v-if="contentType == 'story'">
<p>
<label>日時(JST):
<input type="datetime-local" name="createtime"
</p>
</div>
- <p v-if="item.content_type == 'story'">
+ <p v-if="contentType == 'story'">
<label>部門名:
<input type="text" name="dept" v-model="editor.dept" placeholder="部門名" />
</label>
</label>
</p>
- <p v-if="item.content_type == 'story'">
+ <p v-if="contentType == 'story'">
<label>続きの本文:
<textarea name="bodytext" v-model="editor.body_text"
placeholder="続きの本文をここに記述してください" ></textarea>
</label>
</p>
- <p v-if="item.content_type == 'submission'">
+ <p v-if="contentType == 'submission'">
<label>URL(本文がない場合は必須):
<input type="text" name="url" v-model="editor.url" placeholder="重要なURLを1つ(任意)" />
</label>
</p>
- <p v-if="item.content_type == 'submission'">
+ <p v-if="contentType == 'submission'">
<label>投稿者のメールアドレス/URL(任意):
<input type="text" name="email" v-model="editor.email"
placeholder="メールアドレスかURL" />
</div><!-- .tag-editor -->
- <div v-if="item.content_type == 'story'">
+ <div v-if="contentType == 'story'">
<label>関連ストーリー:
<div class="related-stories">
<ul v-for="rel in item.related">
</label>
</div>
- <div v-if="item.content_type == 'story'">
+ <div v-if="contentType == 'story'">
<p>
<label>メディアURL:
<input type="text" name="mediaurl" v-model="editor.mediaurl" placeholder="URL" />
</p>
</div>
- <div v-if="item.content_type == 'story' || item.content_type == 'journal'">
+ <div v-if="contentType == 'story' || contentType == 'journal'">
<p>
<label>コメント設定:
<select name="comment_status" v-model="editor.comment_status">
</label>
</p>
- <p class="checkbox" v-if="item.content_type == 'story'">
+ <p class="checkbox" v-if="contentType == 'story'">
<label>
<input type="checkbox" name="display" v-model="editor.display" value="1" checked="checked"/>
管理者や編集者以外にも表示
</p>
</div>
- <div v-if="item.content_type == 'journal' && item.formatter == 'legacy'">
+ <div v-if="contentType == 'journal' && item.formatter == 'legacy'">
<p>
<label>投稿形式:
<select name="posttype" v-model="editor.posttype">
</p>
</div>
- <p class="checkbox" v-show="!item.id && item.content_type == 'journal'">
+ <p class="checkbox" v-show="!item.id && contentType == 'journal'">
<label>
<input type="checkbox" name="submissioncopy" v-model="editor.submissioncopy" value="0" />
日記のコピーをタレコミとして投稿する