aboutsummaryrefslogtreecommitdiff
path: root/templates/partials/weblog_list.html
blob: f166610e30f7d29448680c51cc4d4d8cee9a9f0d (plain)
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
{% load tz %}
{% load static %}
<link rel="stylesheet" href="{% static 'css/core/post_list.css' %}">
{% for post in posts %}
    <div class="post">
        <div class="post-body">
            <div class="post-image">
                <img src="{{ post.image_url }}" alt="{% if request.LANGUAGE_CODE == 'ja' %}{{ post.title_ja }}{% else %}{{ post.title }}{% endif %}">
            </div>
            <div class="post-content">
                <h2>
                    <a href="#">{% if request.LANGUAGE_CODE == 'ja' %}{{ post.title_ja }}{% else %}{{ post.title }}{% endif %}</a>
                </h2>
                <div class="author-info">
                    {% with post.author.userprofile_set.first as authorprofile %}
                    <img src="{% static 'images/avatars/' %}{{ authorprofile.avatar_url }}.gif" class="post-profile-image" alt="{{ post.author.first_name }}'s Avatar">
                    {% endwith %}
                    <a href="#"> {{ post.author.first_name }} {{ post.author.last_name }}</a>
                    <span>{% if request.LANGUAGE_CODE == 'ja' %}投稿カテゴリー:{% else %}posted in{% endif %}</span>
                    <a href="#{{ post.category.slug }}">{% if request.LANGUAGE_CODE == 'ja' %}{{ post.category.name_ja }}{% else %}{{ post.category }}{% endif %}</a>
                    <span>{% if request.LANGUAGE_CODE == 'ja' %}投稿日:{% else %}on{% endif %}</span>
                    <span style="margin-left: 4px;">{% localtime on %}{{ post.date | date:"M d, Y" }}{% endlocaltime %}</span>
                </div>
                {{ post.excerpt | safe }}
            </div>
        </div>
        <div class="post-actions">
            <div class="post-links">
                <a href="#">{% if request.LANGUAGE_CODE == 'ja' %}続きを読む{% else %}Continue Reading{% endif %}</a> | 
                <a href="##comments">{{ post.num_comments }} 
                {% if request.LANGUAGE_CODE == 'ja' %}
                    コメント
                {% else %}
                    Comment{% if not post.num_comments == 1 %}s{% endif %}
                {% endif %}</a>
            </div>
            <div class="post-tags">
            {% for tag in post.tags.all %}
                <a class="post-tag" href="#{{ tag.slug }}">{% if request.LANGUAGE_CODE == 'ja' %}{{ tag.name_ja }}{% else %}{{ tag.name }}{% endif %}</a>
            {% endfor %}
            </div>
        </div>
    </div>
{% endfor %}