remove menu
This commit is contained in:
parent
1ba6f03529
commit
b2b27eec16
4 changed files with 1 additions and 33 deletions
|
@ -2,7 +2,7 @@ from django.contrib import admin
|
||||||
|
|
||||||
from mptt.admin import MPTTModelAdmin
|
from mptt.admin import MPTTModelAdmin
|
||||||
|
|
||||||
from cms.models import MenuItem, Page
|
from cms.models import Page
|
||||||
|
|
||||||
|
|
||||||
class PageAdmin(MPTTModelAdmin):
|
class PageAdmin(MPTTModelAdmin):
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
from cms.models import MenuItem
|
|
||||||
|
|
||||||
|
|
||||||
def menuitems(request):
|
|
||||||
qs = MenuItem.objects.filter(published=True)
|
|
||||||
if not request.user.is_authenticated():
|
|
||||||
qs = qs.filter(login_required=False)
|
|
||||||
return {
|
|
||||||
"menuitems": qs,
|
|
||||||
}
|
|
|
@ -63,23 +63,3 @@ class Page(MPTTModel, ContentBase):
|
||||||
order_insertion_by = ["ordering", "title"]
|
order_insertion_by = ["ordering", "title"]
|
||||||
|
|
||||||
reversion.register(Page)
|
reversion.register(Page)
|
||||||
|
|
||||||
|
|
||||||
class MenuItem(MPTTModel):
|
|
||||||
|
|
||||||
name = models.CharField(max_length=50, unique=True)
|
|
||||||
slug = models.SlugField()
|
|
||||||
parent = TreeForeignKey("self", null=True, blank=True, related_name="children")
|
|
||||||
|
|
||||||
url = models.CharField(max_length=200)
|
|
||||||
|
|
||||||
published = models.BooleanField(default=True)
|
|
||||||
login_required = models.BooleanField(default=False)
|
|
||||||
ordering = models.PositiveIntegerField(default=1)
|
|
||||||
|
|
||||||
def __unicode__(self):
|
|
||||||
return self.name
|
|
||||||
|
|
||||||
|
|
||||||
class MPTTMeta:
|
|
||||||
order_insertion_by = ["ordering", "name"]
|
|
||||||
|
|
|
@ -133,8 +133,6 @@ TEMPLATE_CONTEXT_PROCESSORS = [
|
||||||
"pinax.core.context_processors.pinax_settings",
|
"pinax.core.context_processors.pinax_settings",
|
||||||
|
|
||||||
"pinax.apps.account.context_processors.account",
|
"pinax.apps.account.context_processors.account",
|
||||||
|
|
||||||
"cms.context_processors.menuitems",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
|
Loading…
Reference in a new issue