Merge pull request #393 from plamen-nikolov/develop

Disable menu subitems & fix wrong plugin url
This commit is contained in:
Iacopo Spalletti 2017-12-31 12:46:27 +01:00 committed by GitHub
commit fb1ea6ba2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 .cms_appconfig import BlogConfig
from .models import BlogCategory, Post 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): class BlogCategoryMenu(CMSAttachMenu):
@ -59,6 +61,8 @@ class BlogCategoryMenu(CMSAttachMenu):
categories_menu = True categories_menu = True
if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS): if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS):
posts_menu = True posts_menu = True
if config and config.menu_structure in (MENU_TYPE_NONE, ):
return nodes
used_categories = [] used_categories = []
if posts_menu: if posts_menu:

View file

@ -3,7 +3,7 @@
<h3>{% trans "Categories" %}</h3> <h3>{% trans "Categories" %}</h3>
<ul class="blog-categories"> <ul class="blog-categories">
{% for category in 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 }} {{ category.name }}
<span>( <span>(
{% if category.count > 0 %} {% if category.count > 0 %}