OSDN Git Service

hide private tag in story editor
authorhylom <hylom@users.osdn.me>
Wed, 5 Jun 2019 10:42:53 +0000 (10:42 +0000)
committerhylom <hylom@users.osdn.me>
Wed, 5 Jun 2019 10:42:53 +0000 (10:42 +0000)
src/newslash_web/public/js/article-editor.js

index b98d841..00fa150 100644 (file)
@@ -428,14 +428,19 @@ articleEditor.init = function init () {
     }
     // convert tags to tags_string
     if (item.tags) {
-      var tagnames = item.tags.map(tag => tag.tagname);
+      var tagnames = item.tags
+         .filter(tag => (tag.private == "no"
+                         && tag.tagname != "submission"
+                         && tag.tagname != "journal"
+                        ))
+         .map(tag => tag.tagname);
       this.editor.tags_string = tagnames.join(" ");
       this.updateTopics();
     }
 
     // TODO: related stories
     // convert public to display
-    this.editor.display = (item.public == "yes");
+    this.editor.display = (item.public == "no") ? 0 : 1;
     if (item.create_time) {
       this.editor.createtime = newslash.util.formatToLocalISOString(newslash.util.decodeMySQLDateTime(item.create_time));
     } else {