|
|
|
@ -8,7 +8,7 @@ from django.views.generic import ListView, DetailView |
|
|
|
from parler.views import ViewUrlMixin, TranslatableSlugMixin |
|
|
|
from parler.views import ViewUrlMixin, TranslatableSlugMixin |
|
|
|
|
|
|
|
|
|
|
|
from aldryn_apphooks_config.mixins import AppConfigMixin |
|
|
|
from aldryn_apphooks_config.mixins import AppConfigMixin |
|
|
|
|
|
|
|
from taggit.models import Tag |
|
|
|
from .models import Post, BlogCategory, BLOG_CURRENT_POST_IDENTIFIER |
|
|
|
from .models import Post, BlogCategory, BLOG_CURRENT_POST_IDENTIFIER |
|
|
|
from .settings import get_setting |
|
|
|
from .settings import get_setting |
|
|
|
|
|
|
|
|
|
|
|
@ -45,6 +45,7 @@ class PostListView(BaseBlogView, ListView): |
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(PostListView, self).get_context_data(**kwargs) |
|
|
|
context = super(PostListView, self).get_context_data(**kwargs) |
|
|
|
context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT') |
|
|
|
context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT') |
|
|
|
|
|
|
|
context['tags'] = Tag.objects.all() |
|
|
|
return context |
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -106,6 +107,8 @@ class TaggedListView(BaseBlogView, ListView): |
|
|
|
kwargs['tagged_entries'] = (self.kwargs.get('tag') |
|
|
|
kwargs['tagged_entries'] = (self.kwargs.get('tag') |
|
|
|
if 'tag' in self.kwargs else None) |
|
|
|
if 'tag' in self.kwargs else None) |
|
|
|
context = super(TaggedListView, self).get_context_data(**kwargs) |
|
|
|
context = super(TaggedListView, self).get_context_data(**kwargs) |
|
|
|
|
|
|
|
if kwargs['tagged_entries']: |
|
|
|
|
|
|
|
context['tag'] = Tag.objects.get(slug=kwargs['tagged_entries']) |
|
|
|
context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT') |
|
|
|
context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT') |
|
|
|
return context |
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|