OSDN Git Service

template: componentize article_item and content_editor
authorhylom <hylom@users.sourceforge.jp>
Tue, 29 Nov 2016 14:41:37 +0000 (23:41 +0900)
committerhylom <hylom@users.sourceforge.jp>
Tue, 29 Nov 2016 14:41:37 +0000 (23:41 +0900)
src/newslash_web/templates/components/article_item.html.tt2 [new file with mode: 0644]
src/newslash_web/templates/components/content_editor.html.tt2 [new file with mode: 0644]
src/newslash_web/templates/journal/create.html.tt2
src/newslash_web/templates/journal/user_journals.html.tt2

diff --git a/src/newslash_web/templates/components/article_item.html.tt2 b/src/newslash_web/templates/components/article_item.html.tt2
new file mode 100644 (file)
index 0000000..8609f2a
--- /dev/null
@@ -0,0 +1,7 @@
+<script type="text/x-template" id="article-item">
+  [% INCLUDE common/article story={content_type => "journal", vue_template => 1} hide_more_link = 0 %]
+</script>
+<script src="/js/article-item.js" ></script>
+<script>
+  articleItem.run();
+</script>
diff --git a/src/newslash_web/templates/components/content_editor.html.tt2 b/src/newslash_web/templates/components/content_editor.html.tt2
new file mode 100644 (file)
index 0000000..9022a34
--- /dev/null
@@ -0,0 +1,7 @@
+<script type="text/x-template" id="content-editor">
+[% INCLUDE journal/editor %]
+</script>
+<script src="/js/content-editor.js" ></script>
+<script>
+  contentEditor.run();
+</script>
index b2dbe53..e0feedf 100644 (file)
@@ -1,12 +1,6 @@
 [% WRAPPER common/layout sidebar=1 vue=1%]
-
-<script type="text/x-template" id="article-item">
-  [% INCLUDE common/article story={content_type => "journal", vue_template => 1} hide_more_link = 0 %]
-</script>
-
-<script type="text/x-template" id="content-editor">
-[% INCLUDE journal/editor %]
-</script>
+[%- INCLUDE components/article_item -%]
+[%- INCLUDE components/content_editor -%]
 
 <div class="main-column">
   <div class="post submission main-contents" id="journal-editor">
 </div>
 [%- INCLUDE common/sidebar -%]
   
-<script src="/js/content-editor.js" ></script>
-<script src="/js/article-item.js" ></script>
 <script src="/js/editor.js" ></script>
 <script>
-  contentEditor.run();
-  articleItem.run();
   editor.run({ type: 'journal', el: '#journal-editor', user: user, });
 </script>
 
index 56b3ad8..96163aa 100644 (file)
@@ -1,14 +1,6 @@
 [% WRAPPER common/layout sidebar=1 vue=1 %]
-
-<script type="text/x-template" id="article-item">
-  [% INCLUDE common/article story={content_type => "journal", vue_template => 1} hide_more_link = 0 %]
-</script>
-
-<script type="text/x-template" id="content-editor">
-[% INCLUDE journal/editor %]
-</script>
-
-
+[%- INCLUDE components/article_item -%]
+[%- INCLUDE components/content_editor -%]
 <div class="main-column">
   <div class="index main-contents" id="journal-index" server-rendered="true">
     <div class="item-wrapper" v-for="item in items">
 
 [%- INCLUDE common/sidebar -%]
 
-<script src="/js/content-editor.js" ></script>
-<script src="/js/article-item.js" ></script>
 <script src="/js/index.js" ></script>
 <script>
-  contentEditor.run();
-  articleItem.run();
   index.run({ type: 'journal',
   el: '#journal-index',
   userConfig: userConfig,