add news
This commit is contained in:
@@ -25,12 +25,15 @@ BASE_DIR = os.path.dirname(PROJECT_DIR)
|
||||
|
||||
INSTALLED_APPS = [
|
||||
"dnscms",
|
||||
# adding more cms apps? may want to add it to GRAPPLE as well
|
||||
"images",
|
||||
"home",
|
||||
"generic",
|
||||
"home",
|
||||
"associations",
|
||||
"events",
|
||||
"venues",
|
||||
"news",
|
||||
# end cms apps
|
||||
"grapple",
|
||||
"graphene_django",
|
||||
"wagtail.contrib.forms",
|
||||
@@ -160,6 +163,8 @@ MEDIA_URL = "/media/"
|
||||
# Wagtail settings
|
||||
|
||||
WAGTAIL_SITE_NAME = "dnscms"
|
||||
WAGTAIL_ALLOW_UNICODE_SLUGS = False
|
||||
|
||||
WAGTAILIMAGES_IMAGE_MODEL = "images.CustomImage"
|
||||
|
||||
# Search
|
||||
@@ -181,12 +186,13 @@ BASE_URL = "http://example.com"
|
||||
GRAPHENE = {"SCHEMA": "grapple.schema.schema"}
|
||||
GRAPPLE = {
|
||||
"APPS": [
|
||||
"home",
|
||||
"images",
|
||||
"generic",
|
||||
"home",
|
||||
"associations",
|
||||
"events",
|
||||
"venues",
|
||||
"images",
|
||||
"news",
|
||||
],
|
||||
"EXPOSE_GRAPHIQL": True,
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ from wagtail.admin.menu import MenuItem
|
||||
|
||||
from associations.models import AssociationIndex
|
||||
from events.models import EventIndex
|
||||
from news.models import NewsIndex
|
||||
|
||||
|
||||
@hooks.register("register_rich_text_features")
|
||||
@@ -30,6 +31,15 @@ def register_associations_menu_item():
|
||||
return MenuItem("Foreninger", associations_url, icon_name="group", order=2)
|
||||
|
||||
|
||||
@hooks.register("register_admin_menu_item")
|
||||
def register_associations_menu_item():
|
||||
page = NewsIndex.objects.first()
|
||||
news_url = "#"
|
||||
if page:
|
||||
news_url = reverse("wagtailadmin_explore", args=(quote(page.pk),))
|
||||
return MenuItem("Nyheter", news_url, icon_name="info-circle", order=3)
|
||||
|
||||
|
||||
@hooks.register("construct_page_action_menu")
|
||||
def make_publish_default_action(menu_items, request, context):
|
||||
for index, item in enumerate(menu_items):
|
||||
|
||||
Reference in New Issue
Block a user