-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
blog_post_list.html
159 lines (144 loc) · 4.83 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
{% extends "base.html" %}
{% load i18n mezzanine_tags blog_tags keyword_tags disqus_tags %}
{% block meta_title %}{% if page %}{{ page.meta_title }}{% else %}{% trans "Blog" %}{% 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 %}
{% block breadcrumb_menu %}
{{ block.super }}
{% if tag or category or year or month or author %}
<li class="breadcrumb-item active">{% 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 %}
{% if tag or category or year or month or author %}
{% block blog_post_list_filterinfo %}
<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 %}
{% endblock %}
</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 }}
{% endeditable %}
{% endif %}
{% endblock %}
{% endif %}
{% endif %}
{% for blog_post in blog_posts.object_list %}
{% block blog_post_list_post_title %}
{% editable blog_post.title %}
<h2>
<a href="{{ blog_post.get_absolute_url }}">{{ blog_post.title }}</a>
</h2>
{% endeditable %}
{% endblock %}
{% block blog_post_list_post_metainfo %}
{% editable blog_post.publish_date %}
<h6 class="post-meta">
{% trans "Posted by" %}:
{% with blog_post.user as author %}
<a href="{% url "blog_post_list_author" author %}">{{ author.get_full_name|default:author.username }}</a>
{% endwith %}
{% 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 %}
{% blocktrans with sometime=blog_post.publish_date|timesince %}{{ sometime }} ago{% endblocktrans %}
</h6>
{% endeditable %}
{% endblock %}
{% 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 class="img-thumbnail pull-left" src="{{ MEDIA_URL }}{% thumbnail blog_post.featured_image 90 90 %}">
</a>
{% endblock %}
{% endif %}
{% block blog_post_list_post_content %}
{% editable blog_post.content %}
{{ blog_post.description_from_content|safe }}
{% endeditable %}
{% endblock %}
{% block blog_post_list_post_links %}
<div class="blog-list-detail">
{% keywords_for blog_post as tags %}
{% if tags %}
<ul class="list-inline tags">
{% trans "Tags" %}:
{% spaceless %}
{% for tag in tags %}
<li><a href="{% url "blog_post_list_tag" tag.slug %}" class="tag">{{ tag }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endfor %}
{% endspaceless %}
</ul>
{% endif %}
<p>
<a href="{{ blog_post.get_absolute_url }}">{% trans "read more" %}</a>
{% if blog_post.allow_comments %}
/
{% if settings.COMMENTS_DISQUS_SHORTNAME %}
<a href="{{ blog_post.get_absolute_url }}#disqus_thread"
data-disqus-identifier="{% disqus_id_for blog_post %}">
{% trans "Comments" %}
</a>
{% else %}
<a href="{{ blog_post.get_absolute_url }}#comments">
{% blocktrans count comments_count=blog_post.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %}
</a>
{% endif %}
{% endif %}
</p>
</div>
{% endblock %}
{% endfor %}
{% pagination_for blog_posts %}
{% if settings.COMMENTS_DISQUS_SHORTNAME %}
{% include "generic/includes/disqus_counts.html" %}
{% endif %}
{% endblock %}
{% block right_panel %}
{% include "blog/includes/filter_panel.html" %}
{% endblock %}