Merge branch 'develop' of github.com:nephila/djangocms-blog into develop

This commit is contained in:
Iacopo Spalletti 2017-12-31 16:33:37 +01:00
commit 24a77632de
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6
2 changed files with 6 additions and 2 deletions

View file

@ -12,7 +12,9 @@ from menus.menu_pool import menu_pool
from .cms_appconfig import BlogConfig
from .models import BlogCategory, Post
from .settings import MENU_TYPE_CATEGORIES, MENU_TYPE_COMPLETE, MENU_TYPE_POSTS, get_setting
from .settings import (
MENU_TYPE_CATEGORIES, MENU_TYPE_COMPLETE, MENU_TYPE_NONE, MENU_TYPE_POSTS, get_setting,
)
class BlogCategoryMenu(CMSAttachMenu):
@ -59,6 +61,8 @@ class BlogCategoryMenu(CMSAttachMenu):
categories_menu = True
if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS):
posts_menu = True
if config and config.menu_structure in (MENU_TYPE_NONE, ):
return nodes
used_categories = []
if posts_menu:

View file

@ -3,7 +3,7 @@
<h3>{% trans "Categories" %}</h3>
<ul class="blog-categories">
{% for category in categories %}
<li><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }}">
<li><a href="{{ category.get_absolute_url }}" class="blog-categories-{{ category.count }}">
{{ category.name }}
<span>(
{% if category.count > 0 %}