OSDN Git Service

c045cc417c78ec0c2ba25de8971d06bdf6987645
[newslash/newslash.git] / src / newslash_web / templates / common / article / article.html.tt2
1 [%-
2 IF story.content_type == 'story'; content_id = story.sid; END;
3 IF story.content_type == 'journal'; content_id = story.id; END;
4 IF story.content_type == 'submission'; content_id = story.subid; END;
5 -%]
6 <article type="[% story.content_type %]" item-id="[% content_id %]" [% IF !x_template %]v-if="0"[% END %]>
7   <header>
8     <h1>
9       [%- IF story.primary_topic.image.length || x_template -%]
10       <img [% IF story.primary_topic.image %]src="[% Site.topic_icon_base_url %]/[% story.primary_topic.image %]"[% END %]
11            :src="topicIconURL" v-if="topicIconURL" />
12       [%- END -%]
13       [%- IF story.content_type == 'story'; url = "/story/" _ story.sid _ "/"; END -%]
14       [%- IF story.content_type == 'journal'; url = "/journal/" _ story.id _ "/"; END -%]
15       [%- IF story.content_type == 'submission'; url = "/submission/" _ story.subid _ "/"; END -%]
16       [%- IF story.preview; url = "#"; END -%]
17       <a href="[% url %]" v-html="item.title">[% story.title %]</a>
18     </h1>
19     <div class="property">
20       <span class="content-type">
21         [%- IF story.content_type == 'story' -%]ストーリー[%- END -%]
22         [%- IF story.content_type == 'journal' -%]日記[%- END -%]
23         [%- IF story.content_type == 'submission' -%]タレコミ[%- END -%]
24       </span>
25       by <span v-text="item.author">[% story.author %]</span>
26       <span v-text="item.time">[% story.time %]</span>
27       [% IF story.content_type == 'story' %]<span v-text="item.dept">[% story.dept %]</span> 部門より[% END %]
28     </div>
29     <div class="toolbar">
30       [%- IF story.content_type == 'journal' && story.uid == user.uid || x_template -%]
31       <button type="button" class="btn btn-default btn-sm"
32               area-label="編集" v-show="editable" v-on:click="editItem(item)">
33         <span class="glyphicon glyphicon-pencil"></span>
34       </button>
35       [%- END -%]
36     </div>
37   </header>
38   <div class="body contents-text" v-html="item.introtext">[% story.introtext %]</div>
39   [% IF !hide_bodytext %]<div class="body contents-text" v-html="item.bodytext">[% story.bodytext %]</div>[% END %]
40   <footer>
41     [%- IF !hide_more_link -%]
42     <div class="link-to-story"><a href="[% url %]" :href="url">
43         [%- IF story.commentcount || x_template -%]
44         <span v-if="item.commentcount > 0">記事と<span v-text="item.commentcount">[% story.commentcount %]</span>件のコメントを読む</span>
45         [%- END -%]
46         [%- IF !story.commentcount || x_template -%]
47         <span v-if="item.commentcount == 0">記事を読む</span>
48         [%- END -%]
49     </a></div>
50     [%- ELSE -%]
51     <div class="comment-counter">
52       <a href="#comments"><span class="counter" v-text="item.commentcount">[% story.commentcount %]</span>コメント</a>
53     </div>
54     [%- END -%]
55     <div class="tag-bar">
56       <ul class="tags">
57         [%- FOREACH topic IN story.topics -%]
58         <li>[% topic.textname %]</li>
59         [%- END -%]
60       </ul>
61     </div>
62   </footer>
63 </article>