-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/1378-mobile-header-navigation-no-…
…hamburger
- Loading branch information
Showing
37 changed files
with
565 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from django.contrib import admin | ||
|
||
from aldryn_apphooks_config.admin import BaseAppHookConfig | ||
|
||
from .cms_appconfig import ProfileConfig | ||
|
||
|
||
@admin.register(ProfileConfig) | ||
class ProfileConfigAdmin(BaseAppHookConfig, admin.ModelAdmin): | ||
def get_config_fields(self): | ||
return ( | ||
"my_data", | ||
"selected_categories", | ||
"mentors", | ||
"my_contacts", | ||
"selfdiagnose", | ||
"actions", | ||
"notifications", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from aldryn_apphooks_config.models import AppHookConfig | ||
|
||
|
||
class ProfileConfig(AppHookConfig): | ||
my_data = models.BooleanField( | ||
verbose_name=_("Mijn gegevens"), | ||
default=True, | ||
help_text=_( | ||
"Designates whether 'My data' section is rendered or not (Only for digid users)." | ||
), | ||
) | ||
selected_categories = models.BooleanField( | ||
verbose_name=_("Interessegebieden"), | ||
default=True, | ||
help_text=_( | ||
"Designates whether 'selected categories' section is rendered or not." | ||
), | ||
) | ||
mentors = models.BooleanField( | ||
verbose_name=_("Begeleiders"), | ||
default=True, | ||
help_text=_("Designates whether 'mentors' section is rendered or not."), | ||
) | ||
my_contacts = models.BooleanField( | ||
verbose_name=_("Mijn netwerkcontacten"), | ||
default=True, | ||
help_text=_("Designates whether 'contacts' section is rendered or not."), | ||
) | ||
selfdiagnose = models.BooleanField( | ||
verbose_name=_("Zelfdiagnose"), | ||
default=True, | ||
help_text=_("Designates whether 'self diagnose' section is rendered or not."), | ||
) | ||
actions = models.BooleanField( | ||
verbose_name=_("Acties"), | ||
default=True, | ||
help_text=_( | ||
"Designates whether 'actions' section is rendered or not." | ||
"If this is disabled, plans (page and menu) should be disabled as well." | ||
), | ||
) | ||
notifications = models.BooleanField( | ||
verbose_name=_("Communicatievoorkeuren"), | ||
default=True, | ||
help_text=_("Designates whether 'notifications' section is rendered or not."), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from cms.app_base import CMSApp | ||
from aldryn_apphooks_config.app_base import CMSConfigApp | ||
from cms.apphook_pool import apphook_pool | ||
|
||
from .cms_appconfig import ProfileConfig | ||
|
||
|
||
@apphook_pool.register | ||
class ProfileApphook(CMSApp): | ||
class ProfileApphook(CMSConfigApp): | ||
app_name = "profile" | ||
name = _("Profile Application") | ||
app_config = ProfileConfig | ||
|
||
def get_urls(self, page=None, language=None, **kwargs): | ||
return ["open_inwoner.cms.profile.urls"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from django.urls import reverse | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from aldryn_apphooks_config.utils import get_app_instance | ||
from cms.extensions.toolbar import ExtensionToolbar | ||
from cms.toolbar_pool import toolbar_pool | ||
|
||
from open_inwoner.cms.profile.cms_appconfig import ProfileConfig | ||
|
||
|
||
@toolbar_pool.register | ||
class ProfileApphookConfigToolbar(ExtensionToolbar): | ||
model = ProfileConfig | ||
supported_apps = ("profile",) | ||
|
||
def populate(self): | ||
current_page_menu = self._setup_extension_toolbar() | ||
if current_page_menu: | ||
self.namespace, self.config = get_app_instance(self.request) | ||
self.request.current_app = self.namespace | ||
|
||
if not self.config: | ||
url = reverse("admin:profile_profileconfig_changelist") | ||
else: | ||
url = reverse( | ||
"admin:profile_profileconfig_change", | ||
kwargs={"object_id": self.config.id}, | ||
) | ||
|
||
current_page_menu.add_modal_item( | ||
_("Profile apphook configurations"), | ||
url=url, | ||
disabled=(not self.page.application_urls == "ProfileApphook"), | ||
) |
Oops, something went wrong.