mirror of
https://git.cmoser.eu/tinytools/django-tinywiki.git
synced 2026-02-04 06:06:33 +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_HOME = getattr(settings, "TINYWIKI_HOME", "tw-home")
|
||||
|
||||
USE_BOOTSTRAP = getattr(settings, "USE_BOOTSTRAP", False)
|
||||
|
||||
@@ -11,15 +11,15 @@ import string
|
||||
from ..models import Page
|
||||
from ..enums import WikiPageStatus
|
||||
from django.utils.translation import ngettext, gettext as _
|
||||
|
||||
from ..import settings
|
||||
# Create your views here.
|
||||
|
||||
class HomeView(View):
|
||||
template_name = "tinywiki/home/home.html"
|
||||
|
||||
def get(self,request):
|
||||
def get(self, request):
|
||||
try:
|
||||
page = Page.objects.get(slug='tw-home')
|
||||
page = Page.objects.get(slug=settings.TINYWIKI_HOME)
|
||||
if (not Page.status == WikiPageStatus.PUBLISHED
|
||||
and not request.user.is_staff
|
||||
and not request.user.has_perm('page.view-all')):
|
||||
@@ -105,7 +105,6 @@ class TocView(View):
|
||||
else:
|
||||
pages_1 = toc_entries[split:]
|
||||
|
||||
|
||||
if (key.startswith('0') or key == '#'):
|
||||
toc_section = key
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user