This repository has been archived by the owner on Oct 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from aldryn/feature/templates
Simplify templates
- Loading branch information
Showing
12 changed files
with
102 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/base.html
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
{% extends CMS_TEMPLATE %} | ||
|
||
{% block extend_breadcrumb %} | ||
{{ block.super }} | ||
{% block newsblog_breadcrumb %}{% endblock newsblog_breadcrumb %} | ||
{% endblock extend_breadcrumb %} | ||
|
||
{% block content %}{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 51 additions & 61 deletions
112
aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/includes/article.html
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,61 @@ | ||
{% load i18n apphooks_config_tags cms_tags sekizai_tags staticfiles thumbnail %} | ||
|
||
<article class="aldryn-newsblog-article{% if article.is_featured %} aldryn-newsblog-featured{% endif %}{% if not article.published %} unpublished{% endif %}{% if article.future %} future{% endif %}"> | ||
{% block newsblog_visual %} | ||
{% if article.featured_image_id %} | ||
<p class="visual"> | ||
{% if not detail_view %} | ||
<a href="{{ article.get_absolute_url }}"> | ||
{% endif %} | ||
<img src="{% thumbnail article.featured_image.image 800x450 crop subject_location=article.featured_image.subject_location %}" alt="{{ article.featured_image.alt }}" class="img-responsive"> | ||
{% if not detail_view %} | ||
</a> | ||
{% endif %} | ||
</p> | ||
{% endif %} | ||
{% endblock newsblog_visual %} | ||
|
||
{% block newsblog_categories %} | ||
{% if article.categories %} | ||
<p class="category"> | ||
{% for category in article.categories.all %} | ||
<a href="{% namespace_url 'article-list-by-category' category.slug namespace=namespace default='' %}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %} | ||
{% endfor %} | ||
</p> | ||
{% endif %} | ||
{% endblock newsblog_categories %} | ||
|
||
{% block newsblock_title %} | ||
<h2> | ||
{% if article.featured_image_id %} | ||
<p class="visual"> | ||
{% if not detail_view %} | ||
<a href="{% namespace_url 'article-detail' article.slug namespace=namespace default='' %}">{% render_model article "title" %}</a> | ||
{% else %} | ||
{% render_model article "title" %} | ||
<a href="{{ article.get_absolute_url }}"> | ||
{% endif %} | ||
</h2> | ||
{% endblock newsblock_title %} | ||
|
||
{% block newsblog_meta %} | ||
<img src="{% thumbnail article.featured_image.image 800x450 crop subject_location=article.featured_image.subject_location %}" alt="{{ article.featured_image.alt }}" class="img-responsive"> | ||
{% if not detail_view %} | ||
</a> | ||
{% endif %} | ||
</p> | ||
{% endif %} | ||
|
||
{% if article.categories %} | ||
<p class="category"> | ||
{% for category in article.categories.all %} | ||
<a href="{% namespace_url 'article-list-by-category' category.slug namespace=namespace default='' %}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %} | ||
{% endfor %} | ||
</p> | ||
{% endif %} | ||
|
||
<h2> | ||
{% if not detail_view %} | ||
<div class="lead"> | ||
{% render_model article "lead_in" "" "" "truncatewords:'20'" %} | ||
</div> | ||
{% endif %} | ||
|
||
{% include "aldryn_newsblog/includes/author.html" with author=article.author %} | ||
|
||
{% if article.tags and detail_view %} | ||
<p class="tags"> | ||
{% for tag in article.tags.all %} | ||
<a href="{% namespace_url 'article-list-by-tag' tag=tag.slug namespace=namespace default='' %}">{{ tag.name }}</a> | ||
{% endfor %} | ||
</p> | ||
{% endif %} | ||
|
||
{% if detail_view %} | ||
<div class="lead"> | ||
{% render_model article "lead_in" %} | ||
</div> | ||
{% endif %} | ||
{% endblock newsblog_meta %} | ||
|
||
{% block newsblog_content %} | ||
{% if detail_view %} | ||
<div class="content"> | ||
{% render_placeholder article.content language placeholder_language %} | ||
</div> | ||
<a href="{% namespace_url 'article-detail' article.slug namespace=namespace default='' %}">{% render_model article "title" %}</a> | ||
{% else %} | ||
{% render_model article "title" %} | ||
{% endif %} | ||
{% endblock newsblog_content %} | ||
</h2> | ||
|
||
{% if not detail_view %} | ||
<div class="lead"> | ||
{% render_model article "lead_in" "" "" "truncatewords:'20'" %} | ||
</div> | ||
{% endif %} | ||
|
||
{% include "aldryn_newsblog/includes/author.html" with author=article.author %} | ||
|
||
{% if article.tags and detail_view %} | ||
<p class="tags"> | ||
{% for tag in article.tags.all %} | ||
<a href="{% namespace_url 'article-list-by-tag' tag=tag.slug namespace=namespace default='' %}">{{ tag.name }}</a> | ||
{% endfor %} | ||
</p> | ||
{% endif %} | ||
|
||
{% if detail_view %} | ||
<div class="lead"> | ||
{% render_model article "lead_in" %} | ||
</div> | ||
{% endif %} | ||
|
||
{% if detail_view %} | ||
<div class="content"> | ||
{% render_placeholder article.content language placeholder_language %} | ||
</div> | ||
{% endif %} | ||
</article> | ||
|
||
{% addtoblock "css" %}<link rel="stylesheet" href="{% static 'css/aldryn-newsblog/article.css' %}">{% endaddtoblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
aldryn_newsblog/templates/aldryn_newsblog/plugins/related_articles.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{% load i18n %} | ||
|
||
<ul> | ||
{% for article in article_list %} | ||
<li> | ||
<h3><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h3> | ||
<p>{% trans "by" %} <a href="#">{{ article.author }}</a> {{ article.publishing_date|date }}</p> | ||
</li> | ||
{% empty %} | ||
<li>{% trans "No items available" %}</li> | ||
{% endfor %} | ||
</ul> | ||
{% if article %} | ||
<ul> | ||
{% for article in article_list %} | ||
<li> | ||
<h3><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h3> | ||
<p>{% trans "by" %} <a href="#">{{ article.author }}</a> {{ article.publishing_date|date }}</p> | ||
</li> | ||
{% empty %} | ||
<li>{% trans "No items available" %}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters