Skip to content

Commit

Permalink
blog-list fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliYmn committed Feb 10, 2017
1 parent b7bbbb0 commit f7cc241
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions blog/views.py
Expand Up @@ -60,6 +60,7 @@ def get_context_data(self, **kwargs):
context['last_content'] = Post.objects.all().filter(is_active=True).order_by('-time')
context['category'] = Category.objects.all()
context['post'] = Post.objects.all().filter(is_active=True).order_by('-site_hit')[:5]
context['random_post'] = Post.objects.all().filter(is_active=True).order_by('?')
return context

class ContactView(TemplateView):
Expand Down
26 changes: 20 additions & 6 deletions templates/blog_list.html
@@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load static %}
{% load disqus_tags %}
{% load blog_tags %}
<!-- SEO -->

Expand Down Expand Up @@ -60,7 +59,7 @@
</li>
<li role="presentation">
<a href="#messages" aria-controls="messages" role="tab"
data-toggle="tab">Yorumlar</a>
data-toggle="tab">Rastgele</a>
</li>
</ul>

Expand Down Expand Up @@ -113,14 +112,29 @@ <h6><a href="/{{ i.url }}">{{ i.title }}</a>
</div>
<div role="tabpanel" class="tab-pane" id="messages">
<div class="tab-post-list">
{% for i in random_post %}
<div class="tab-post-list-wrap clearfix">

<div class="tab-post-thumb pull-left">
<figure>
<a href="/{{ i.url }}">
<img src="{{ i.image.url }}"
alt="{{ i.title }}">
</a>
</figure>
</div>

<div class="tab-post-list-wrap">
{% disqus_recent_comments 5 30 1 %}
</di>
<div class="tab-post-title">
<h6><a href="/{{ i.url }}">{{ i.title }}</a>
</h6>
<span>{{ i.time.date }}</span>
</div>

</div>
{% endfor %}

</div>
</div>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit f7cc241

Please sign in to comment.