This repository has been archived by the owner on Feb 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented basic tags, and tests, github issue #7
- Loading branch information
Showing
7 changed files
with
167 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{% extends "includes/base.html" %} | ||
|
||
{% load custom_markdown %} | ||
|
||
{% block header %} | ||
<div class="header"> | ||
<h1><code>Tags</code></h1> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% if object_list %} | ||
{% for post in object_list %} | ||
<div class="post"> | ||
<div class="col-sm-10"> | ||
<h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2> | ||
</div><!-- /.col-lg-12--> | ||
|
||
<div class="col-sm-2"> | ||
<span> | ||
<ul class="pager pull-right"> | ||
<li class="previous"><a href="{{ post.get_absolute_url }}"> Read <span aria-hidden="true">→</span></a></li> | ||
</ul> | ||
</span> | ||
</div><!-- /.col-sm-2--> | ||
|
||
<div class="col-sm-12"> | ||
<p> | ||
<small> | ||
{{ post.pub_date }} | ||
{% if post.category %} | ||
<a href="{{ post.category.get_absolute_url }}"><span class="label label-primary">{{ post.category.name }}</span></a> | ||
{% endif %} | ||
<br> | ||
{{ post.text | custom_markdown | truncatechars_html:159 }} | ||
{% if post.tags %} | ||
<div class="col-md-12"> | ||
{% for tag in post.tags.all %} | ||
<a href="{{ tag.get_absolute_url }}"><span class="label label-success">{{ tag.name }}</span></a> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
|
||
</small> | ||
</p> | ||
</div><!-- /.col-lg-12--> | ||
|
||
</div> | ||
|
||
{% endfor %} | ||
{% else %} | ||
<div class="col-sm-12"> | ||
<p>Tag not found, sorry no coresponding posts found</p> | ||
</div><!-- /.col-lg-12--> | ||
{% endif %} | ||
|
||
<div class="col-sm-12 text-center"> | ||
<span> | ||
<br> | ||
<ul class="pager"> | ||
{% if page_obj.has_previous %} | ||
<li><a href="/blog/{{ page_obj.previous_page_number }}/"><span aria-hidden="true">←</span> Prev</a></li> | ||
{% else %} | ||
<li class="disabled"><a href=""><span aria-hidden="true">←</span> Prev</a></li> | ||
{% endif %} | ||
{% if page_obj.has_next %} | ||
<li><a href="/blog/{{ page_obj.next_page_number }}/">Next <span aria-hidden="true">→</span></a></li> | ||
{% else %} | ||
<li class="disabled"><a href="">Next <span aria-hidden="true">→</span></a></li> | ||
{% endif %} | ||
</ul> | ||
</span> | ||
|
||
</div><!-- /.col-lg-12--> | ||
|
||
{% endblock %} |
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