mirror of
https://git.cmoser.eu/tinytools/django-tinywiki.git
synced 2026-02-04 14:16:32 +01:00
added TINYWIKI_HOME settings for settings the app-specific homepages of the wiki
This commit is contained in:
@@ -35,4 +35,6 @@ TINYWIKI_BASE_TEMPLATE = getattr(
|
|||||||
"tinywiki/base.html")
|
"tinywiki/base.html")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TINYWIKI_HOME = getattr(settings, "TINYWIKI_HOME", "tw-home")
|
||||||
|
|
||||||
USE_BOOTSTRAP = getattr(settings, "USE_BOOTSTRAP", False)
|
USE_BOOTSTRAP = getattr(settings, "USE_BOOTSTRAP", False)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import string
|
|||||||
from ..models import Page
|
from ..models import Page
|
||||||
from ..enums import WikiPageStatus
|
from ..enums import WikiPageStatus
|
||||||
from django.utils.translation import ngettext, gettext as _
|
from django.utils.translation import ngettext, gettext as _
|
||||||
|
from ..import settings
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
class HomeView(View):
|
class HomeView(View):
|
||||||
@@ -19,7 +19,7 @@ class HomeView(View):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
try:
|
try:
|
||||||
page = Page.objects.get(slug='tw-home')
|
page = Page.objects.get(slug=settings.TINYWIKI_HOME)
|
||||||
if (not Page.status == WikiPageStatus.PUBLISHED
|
if (not Page.status == WikiPageStatus.PUBLISHED
|
||||||
and not request.user.is_staff
|
and not request.user.is_staff
|
||||||
and not request.user.has_perm('page.view-all')):
|
and not request.user.has_perm('page.view-all')):
|
||||||
@@ -105,7 +105,6 @@ class TocView(View):
|
|||||||
else:
|
else:
|
||||||
pages_1 = toc_entries[split:]
|
pages_1 = toc_entries[split:]
|
||||||
|
|
||||||
|
|
||||||
if (key.startswith('0') or key == '#'):
|
if (key.startswith('0') or key == '#'):
|
||||||
toc_section = key
|
toc_section = key
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user