-
Notifications
You must be signed in to change notification settings - Fork 2
/
blog_post_list.html
executable file
·225 lines (225 loc) · 11.5 KB
/
blog_post_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
{% extends "base.html" %}
{% load i18n mezzanine_tags blog_tags keyword_tags disqus_tags clean_blog_tags %}
{% block extra_head %}
{% pagination_prev_next_for blog_posts %}
{% include "blog/includes/google_adsense_script.html" %}
{% endblock %}
{# base.html のmeta_titleの処理の上書き #}
{% block meta_title %}
{# サイトタイトルを出力する #}
{% if tag or category or year or month or author %}
{% if tag %}
{% trans "Viewing posts tagged" %} {{ tag }}
{% else %}
{% if category %}
{% trans "Viewing posts for the category" %} {{ category }}
{% else %}
{% if year or month %}
{% trans "Viewing posts from" %} {% if month %} {{ month }}, {% endif %}
{{ year }}
{% else %}
{% if author %}{% trans "Viewing posts by" %}{{ author.get_full_name|default:author.username
}}{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% else %}
{% if page %}
{{ page.meta_title }}
{% else %}
{% trans "Blog" %}
{% endif %}
{% endif %}
{% endblock %}
{% block meta_keywords %}
{% metablock %}
{% keywords_for page as keywords %}
{% for keyword in keywords %}
{% if not forloop.first %}, {% endif %}
{{ keyword }}
{% endfor %}
{% endmetablock %}
{% endblock %}
{% block meta_description %}
{% metablock %}
{{ page.description }}
{% endmetablock %}
{% endblock %}
{% block title %}
{% if page %}
{% editable page.title %}{{ page.title }}{% endeditable %}
{% else %}
{% trans "Blog" %}
{% endif %}
{% endblock %}
{# base.html のheading-textの処理を上書き #}
{% block heading-text %}
{# サイトタイトルを出力する #}
{% if tag or category or year or month or author %}
<p>
{% if tag %}
{% trans "Viewing posts tagged" %} {{ tag }}
{% else %}{% if category %}
{% trans "Viewing posts for the category" %} {{ category }}
{% else %}{% if year or month %}
{% trans "Viewing posts from" %} {% if month %}{{ month }}, {% endif %}
{{ year }}
{% else %}{% if author %}
{% trans "Viewing posts by" %}
{{ author.get_full_name|default:author.username }}
{% endif %}{% endif %}{% endif %}{% endif %}
</p>
{% else %}
{% if page %}
{% block blog_post_list_pagecontent %}
{% if page.get_content_model.content %}
{% editable page.get_content_model.content %}
{{ page.get_content_model.content|richtext_filters|safe }}
{% endeditable %}
{% endif %}
{% endblock %}
{% else %}
{{ page.title }}
{% if settings.SITE_TITLE %}
<p>{{ settings.SITE_TITLE }}</p>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{# パンくずリストのブロック #}
{% block breadcrumb_menu %}
{{ block.super }}
{% if tag or category or year or month or author %}
<li>{% spaceless %}
{% if tag %}
{% trans "Tag:" %} {{ tag }}
{% else %}{% if category %}
{% trans "Category:" %} {{ category }}
{% else %}{% if year or month %}
{% if month %}{{ month }}, {% endif %}{{ year }}
{% else %}{% if author %}
{% trans "Author:" %} {{ author.get_full_name|default:author.username }}
{% endif %}{% endif %}{% endif %}{% endif %}
{% endspaceless %}
</li>
{% endif %}
{% endblock %}
{# メインブロック #}
{% block main %}
<section id="blog" class="container">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1" data-split-id="entry-wrap">
{% block right_panel %}
{# Do Nothing... #}
{% endblock %}
<div class="blog">
{% include "blog/includes/google_adsense.html" %}
{% for blog_post in blog_posts.object_list %}
<div class="blog-item">
{% if settings.BLOG_USE_FEATURED_IMAGE and blog_post.featured_image %}
{% block blog_post_list_post_featured_image %}
<a href="{{ blog_post.get_absolute_url }}">
<img width="100%" class="img-responsive img-blog"
src="{{ MEDIA_URL }}{{ blog_post.featured_image }}">
</a>
{% endblock %}
{% endif %}
<div class="blog-content post-preview">
{% block blog_post_list_post_title %}
{% editable blog_post.title %}
<a href="{{ blog_post.get_absolute_url }}">
<h2 class="post-title">{{ blog_post.title }}</h2>
</a>
{% endeditable %}
{% endblock %}
{% block blog_post_list_post_metainfo %}
{% editable blog_post.publish_date %}
<div class="entry-meta">
<span><span class="glyphicon glyphicon-user">{% trans "Posted by" %}:
{% with blog_post.user as author %}</span>
<a href="{% url "blog_post_list_author" author %}">{{ author.get_full_name|default:author.username }}</a>
{% endwith %}
</span>
<span><i class="glyphicon glyphicon-folder-close"></i>
{% with blog_post.categories.all as categories %}
{% if categories %}
{% trans "in" %}
{% for category in categories %}
<a href="{% url "blog_post_list_category" category.slug %}">{{ category }}</a>
{% if not forloop.last %}, {% endif %}
{% endfor %}
{% endif %}
{% endwith %}
</span>
<span>
<span class="glyphicon glyphicon-calendar">投稿日:</span>
<time datetime="{{ blog_post.publish_date|date:"c"}}">{{ blog_post.publish_date|date:'Y-m-d' }}</time> (
{% blocktrans with sometime=blog_post.publish_date|timesince %}
{{ sometime }} ago{% endblocktrans %})</span>
<span>
<span class="glyphicon glyphicon-calendar">更新日:</span>
<time datetime="{{ blog_post.updated|date:"c"}}">{{ blog_post.updated|date:'Y-m-d' }}</time> (
{% blocktrans with sometime=blog_post.updated|timesince %}
{{ sometime }} ago{% endblocktrans %})</span>
<span>
{% if blog_post.allow_comments %}
{% if settings.COMMENTS_DISQUS_SHORTNAME %}
<a class="glyphicon glyphicon-comment"
href="{{ blog_post.get_absolute_url }}#disqus_thread"
data-disqus-identifier="{% disqus_id_for blog_post %}"
data-ga-event-category="discus_comment"
data-ga-event-label="{{ blog_post.get_absolute_url }}">
{% trans "Comments" %}
</a>
{% else %}
<a class="glyphicon glyphicon-comment"
href="{{ blog_post.get_absolute_url }}#comments"
data-ga-event-category="comment"
data-ga-event-label="{{ blog_post.get_absolute_url }}">
{% blocktrans count comments_count=blog_post.comments_count %}{{ comments_count }} comment
{% plural %}{{ comments_count }} comments{% endblocktrans %}
</a>
{% endif %}
{% endif %}
</span>
</div>
{% endeditable %}
{% endblock %}
{% if settings.CLEAN_BLOG_IS_VISIBLE_DESCRIPTION %}
{% block blog_post_list_post_content %}
<div>
{% editable blog_post.content %}
{{ blog_post.description_from_content|safe }}
{% endeditable %}
{% endblock %}
{% comment "read more button is unnecessary" %}
{% endcomment %}
<a href="{{ blog_post.get_absolute_url }}" class="btn btn-default">{% trans "read more" %}
<i class="glyphicon glyphicon-triangle-right"></i></a>
{% block blog_post_list_post_links %}
{% keywords_for blog_post as tags %}
{% if tags %}
<div class="tags">
<i class="glyphicon glyphicon-tags"></i> {% trans "Tags" %}:
{% spaceless %}
{% for tag in tags %}
<a href="{% url "blog_post_list_tag" tag.slug %}"
class="btn btn-xs btn-primary">{{ tag }}</a>
{% endfor %}
{% endspaceless %}
</div>
{% endif %}
{% endblock %}
</div>
</div>
{% endif %}
</div>
<hr>
</div>
{% endfor %}
{% include "blog/includes/google_adsense.html" %}
<div class="blog-item">
{% pagination_for blog_posts %}
</div>
</div>
</section>
{% endblock %}