OSDN Git Service

fix topics indicator in submission editor
authorhylom <hylom@users.sourceforge.jp>
Wed, 8 May 2019 11:37:53 +0000 (20:37 +0900)
committerhylom <hylom@users.sourceforge.jp>
Wed, 8 May 2019 11:37:53 +0000 (20:37 +0900)
src/newslash_web/css/newslash/editor.less
src/newslash_web/lib/Newslash/Plugin/NewslashHelpers.pm
src/newslash_web/public/js/ns-util.js
src/newslash_web/templates/common/article/editor.html.tt2

index 4e542c3..786efe4 100644 (file)
@@ -1,3 +1,11 @@
 /* editor.less */
 
-textarea.editor { &:extend(.tallest); }
\ No newline at end of file
+textarea.editor { &:extend(.tallest); }
+
+.tag-editor {
+    .topic-items li {
+        &:extend(.flatten);
+        text-align: center;
+        img { display: block; }
+    }
+}
index 46106d6..13bd296 100644 (file)
@@ -300,23 +300,23 @@ sub _generate_site_config {
         $mod_reasons->{$k} = $reasons->{$k}->{name};
     }
 
-    my $keywords = {};
-    for my $topic (@$topics) {
-        my $lc_keyword = lc($topic->{keyword});
-        my $lc_textname = lc($topic->{textname});
-        $keywords->{$lc_keyword} = {keyword => $topic->{keyword},
-                                    textname => $topic->{textname},
-                                    image => $topic->{image}};
-        if ($lc_keyword ne $lc_textname) {
-            $keywords->{$lc_textname} = $keywords->{$lc_keyword};
-        }
-    }
+    my $keywords = {};
+    for my $topic (@$topics) {
+        my $lc_keyword = lc($topic->{keyword});
+        my $lc_textname = lc($topic->{textname});
+        $keywords->{$lc_keyword} = {keyword => $topic->{keyword},
+                                    textname => $topic->{textname},
+                                    image => $topic->{image}};
+        if ($lc_keyword ne $lc_textname) {
+            $keywords->{$lc_textname} = $keywords->{$lc_keyword};
+        }
+    }
 
     my $value = {
                  modReasons => $mod_reasons,
                  siteInfo => { topic_icon_base_url => $c->config->{Site}->{topic_icon_base_url} },
-                 #topics => $keywords,
-                 topics => \@topic_texts,
+                 topics => $keywords,
+                 #topics => \@topic_texts,
                  editorConfig => $c->config->{Editor},
                  acl2Types => {},
                 };
index b669326..fcb2ed3 100644 (file)
@@ -73,8 +73,9 @@ var nsUtil = {
   },
 
   topicIconURL: function topicIconURL(keyword) {
-    if (keyword && siteConfig.topics[keyword] && topics[keyword].image) {
-      return siteInfo.topicIconBaseURL + "/" + topics[keyword].image;
+    var topics = siteConfig.topics;
+    if (keyword && topics[keyword] && topics[keyword].image) {
+      return siteConfig.siteInfo.topic_icon_base_url + "/" + topics[keyword].image;
     }
     return "";
   },
index 144ce70..b2d8a54 100644 (file)
@@ -79,7 +79,7 @@
 
       <div class="topics">
         <label>トピックス(タグに応じて自動的に設定されます):</label>
-        <ol class="list-inline">
+        <ol class="topic-items">
           <li v-for="topic in currentTopics">
             <img :src="topicIconURL(topic)" v-show="topicIconURL(topic)" />
             <span v-text="topic"></span>