digitalglarus: styling on post details and list.

Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
rascencio 2015-09-26 13:08:14 -06:00
parent c10fea0169
commit 023a58a7d7
2 changed files with 36 additions and 29 deletions

View file

@ -8,18 +8,26 @@
{% block content_blog %}{% spaceless %}
<article id="post-{{ post.slug }}" class="post-item post-detail">
<header>
<h2>{{ post.title }}</h2>
{% block blog_meta %}
{% include "glarus_blog/includes/blog_meta.html" %}
{% endblock %}
{% if post.main_image_id %}
<div class="blog-visual">
{% thumbnail post.main_image post.full_image_options.size crop=post.full_image_options.crop upscale=post.full_image_options.upscale subject_location=post.main_image.subject_location as thumb %}
<img src="{{ post.main_image.url }}" alt="{{ post.main_image.default_alt_text }}" class="img-responsive img-border img-full" />
</div>
{% endif %}
<header class="text-center">
<h2>
<a href="{% url 'digitalglarus:blog-detail' post.slug %}">
{{ post.title }}
</a>
<br>
<small>
{{ post.date_created }}
</small>
</h2>
{% block blog_meta %}
{% include "glarus_blog/includes/blog_meta.html" %}
{% endblock %}
</header>
{% if post.main_image_id %}
<div class="blog-visual">
{% thumbnail post.main_image post.full_image_options.size crop=post.full_image_options.crop upscale=post.full_image_options.upscale subject_location=post.main_image.subject_location as thumb %}
<img src="{{ thumb.url }}" alt="{{ post.main_image.default_alt_text }}" width="{{ thumb.width }}" height="{{ thumb.height }}" />
</div>
{% endif %}
{% endspaceless %}
<div class="blog-content">{% render_placeholder post.content %}</div>
</article>

View file

@ -7,33 +7,32 @@
<section class="blog-list">
{% block blog_title %}
<header>
<h2>
{% if author %}{% trans "Articles by" %} {{ author.get_full_name }}
{% elif archive_date %}{% trans "Archive" %} &ndash; {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }}
{% elif tagged_entries %}{% trans "Tag" %} &ndash; {{ tagged_entries|capfirst }}
{% elif category %}{% trans "Category" %} &ndash; {{ category }}{% endif %}
</h2>
<hr></hr>
<h2 class="intro-text text-center">
Digital Glarus <b>Blog</b>
</h2>
<hr></hr>
</header>
{% endblock %}
{% for post in post_list %}
{% include "glarus_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}
{% include "glarus_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}
{% empty %}
<p class="blog-empty">{% trans "No article found." %}</p>
<p class="blog-empty text-center lead">{% trans "No article found." %}</p>
{% endfor %}
{% if author or archive_date or tagged_entries %}
<p class="blog-back"><a href="{% url 'djangocms_blog:posts-latest' %}">{% trans "Back" %}</a></p>
{% endif %}
{% if is_paginated %}
<nav class="{% firstof css_grid instance.css_grid %} pagination">
{% if page_obj.has_previous %}
<a href="?{{ view.page_kwarg }}={{ page_obj.previous_page_number }}">&laquo; {% trans "previous" %}</a>
{% endif %}
<span class="current">
{% trans "Page" %} {{ page_obj.number }} {% trans "of" %} {{ paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?{{ view.page_kwarg }}={{ page_obj.next_page_number }}">{% trans "next" %} &raquo;</a>
{% endif %}
{% if page_obj.has_previous %}
<a href="?{{ view.page_kwarg }}={{ page_obj.previous_page_number }}">&laquo; {% trans "previous" %}</a>
{% endif %}
<span class="current">
{% trans "Page" %} {{ page_obj.number }} {% trans "of" %} {{ paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?{{ view.page_kwarg }}={{ page_obj.next_page_number }}">{% trans "next" %} &raquo;</a>
{% endif %}
</nav>
{% endif %}
</section>