Compare commits
4 Commits
c7adaf94b4
...
93e2d7910a
| Author | SHA1 | Date | |
|---|---|---|---|
| 93e2d7910a | |||
| 043dd6620b | |||
| 5c31142b03 | |||
| 149a5d0a1b |
@@ -9,7 +9,6 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
|
||||
"""
|
||||
|
||||
import importlib.util
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -21,11 +20,7 @@ BASE_DIR = str(BASE_PATH)
|
||||
|
||||
setup_search_paths("/etc/ocyan/", str(_project_app_path))
|
||||
|
||||
from ocyan.main.settings import * # noqa: F403,F405 # pylint:disable=W0401,W0614 # pyright: ignore[reportWildcardImportFromLibrary]
|
||||
from ocyan.core.fender import config as ocyan_config
|
||||
|
||||
# Keep existing database schemas stable across Django upgrades.
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||
from ocyan.main.settings import * # pylint:disable=W0401,W0614
|
||||
|
||||
INSTALLED_APPS = [
|
||||
"mandelblog_content_guard.apps.MandelblogContentGuardConfig",
|
||||
@@ -65,25 +60,6 @@ _ensure_required_app(
|
||||
"ocyan.plugin.coyote",
|
||||
)
|
||||
|
||||
def _ensure_installed_app(app_label: str, *, before: str | None = None) -> None:
|
||||
"""Ensure an app is present in INSTALLED_APPS with optional ordering."""
|
||||
if app_label in INSTALLED_APPS:
|
||||
INSTALLED_APPS.remove(app_label)
|
||||
if before and before in INSTALLED_APPS:
|
||||
INSTALLED_APPS.insert(INSTALLED_APPS.index(before), app_label)
|
||||
else:
|
||||
INSTALLED_APPS.append(app_label)
|
||||
|
||||
|
||||
# Production-clean: prefer the Carbasa webshop template package when Oscar is enabled.
|
||||
# This guarantees that `carbasa/headers/*` resolves to the webshop templates (search, user bar, cart, megamenu).
|
||||
_oscar_enabled = ocyan_config.is_webshop or any(
|
||||
app == "ocyan.plugin.oscar" or app.startswith("ocyan.plugin.oscar_")
|
||||
for app in INSTALLED_APPS
|
||||
)
|
||||
if _oscar_enabled and importlib.util.find_spec("ocyan.plugin.carbasa.webshop"):
|
||||
_ensure_installed_app("ocyan.plugin.carbasa.webshop", before="ocyan.plugin.carbasa")
|
||||
|
||||
# Keep Carbasa/Coyote defaults stable even when plugin settings are not
|
||||
# injected early enough during startup on this deployment.
|
||||
OXYAN_HEADER_OPTIONS = globals().get(
|
||||
@@ -145,13 +121,6 @@ ACTIVE_VERTICAL = "agency"
|
||||
# Wagtail content internationalization in admin
|
||||
WAGTAIL_I18N_ENABLED = True
|
||||
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES
|
||||
WAGTAILADMIN_BASE_URL = os.environ.get("WAGTAILADMIN_BASE_URL", "http://127.0.0.1:8001")
|
||||
|
||||
# Local dev convenience: allow Django's test client and common loopback hosts.
|
||||
ALLOWED_HOSTS = list(globals().get("ALLOWED_HOSTS", []))
|
||||
for _host in ("localhost", "127.0.0.1", "0.0.0.0", "testserver"):
|
||||
if _host not in ALLOWED_HOSTS:
|
||||
ALLOWED_HOSTS.append(_host)
|
||||
|
||||
CONTENT_GUARD_STRICT = True
|
||||
CONTENT_GUARD_BLOCK_MEDIUM = False
|
||||
|
||||
@@ -1,9 +1 @@
|
||||
{% extends "carbasa/headers/header.html" %}
|
||||
|
||||
{% block append_header_block %}
|
||||
{% include "oxyan/partials/language_chooser.html" %}
|
||||
{% endblock append_header_block %}
|
||||
|
||||
{% block language_chooser %}
|
||||
{% include "oxyan/partials/language_chooser.html" %}
|
||||
{% endblock language_chooser %}
|
||||
|
||||
@@ -1,9 +1 @@
|
||||
{% extends "carbasa/headers/mega.html" %}
|
||||
|
||||
{% block append_header_block %}
|
||||
{% include "oxyan/partials/language_chooser.html" %}
|
||||
{% endblock append_header_block %}
|
||||
|
||||
{% block language_chooser %}
|
||||
{% include "oxyan/partials/language_chooser.html" %}
|
||||
{% endblock language_chooser %}
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% load i18n mandelstudio_i18n %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<div class="header-right">
|
||||
<form action="{% url 'set_language' %}" method="post" class="ms-lang-switcher me-2" aria-label="Language switcher">
|
||||
{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{{ language_neutral_url_path|default:request.path|language_neutral_path }}">
|
||||
<label for="header-language-switcher" class="visually-hidden">{% trans "Language" %}</label>
|
||||
<select id="header-language-switcher" name="language" class="form-select form-select-sm" onchange="this.form.submit()">
|
||||
<option value="nl" {% if LANGUAGE_CODE == 'nl' %}selected{% endif %}>NL</option>
|
||||
<option value="en" {% if LANGUAGE_CODE == 'en' %}selected{% endif %}>EN</option>
|
||||
<option value="de" {% if LANGUAGE_CODE == 'de' %}selected{% endif %}>DE</option>
|
||||
<option value="fr" {% if LANGUAGE_CODE == 'fr' %}selected{% endif %}>FR</option>
|
||||
<option value="es" {% if LANGUAGE_CODE == 'es' %}selected{% endif %}>ES</option>
|
||||
<option value="it" {% if LANGUAGE_CODE == 'it' %}selected{% endif %}>IT</option>
|
||||
<option value="pt" {% if LANGUAGE_CODE == 'pt' %}selected{% endif %}>PT</option>
|
||||
<option value="ru" {% if LANGUAGE_CODE == 'ru' %}selected{% endif %}>RU</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<a tabindex="0" aria-label="Open Search" role="search" class="search-toggler user-button menu-circle">
|
||||
<i class="fa fa-search"></i>
|
||||
</a>
|
||||
<a href="{% url 'customer:summary' %}" aria-label="{% trans 'Customer summary' %}" class="user-button menu-circle"><i class="fa fa-user-solid"></i></a>
|
||||
{% include 'oxyan/headers/partials/mini_basket.html' %}
|
||||
{% include "oxyan/partials/language_chooser.html" %}
|
||||
{% include "oxyan/headers/partials/mini_basket.html" %}
|
||||
</div>
|
||||
|
||||
<div class="alert-messages-header" aria-live="polite">
|
||||
{% include "oscar/partials/alert_messages.html" with messages=messages %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<!-- MB OVERRIDE -->
|
||||
{% load i18n static ocyanjson mandelstudio_i18n %}
|
||||
|
||||
{% get_current_language as current_language %}
|
||||
{% get_available_languages as available_languages %}
|
||||
|
||||
<div class="dropdown language-dropdown">
|
||||
<button type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{% include "oxyan/partials/flags/"|add:current_language|add:".svg" %}
|
||||
{% include "oxyan/partials/flags/"|add:LANGUAGE_CODE|add:".svg" %}
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||
{% get_language_info_list for available_languages as languages %}
|
||||
{% get_language_info_list for languages as languages %}
|
||||
{% ocyanjson "i18n" "language_chooser_disabled_options" "" as disabled_languages %}
|
||||
<form action="{% url 'set_language' %}" method="post" class="language_form">
|
||||
{% csrf_token %}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{% load i18n ocyan_thumbnail oxyan %}
|
||||
|
||||
{# Carbasa dropdown override: include the root page when it is marked "show in menus". #}
|
||||
{% rootpage_as_category as menu_root_proxy %}
|
||||
{% if menu_root_proxy and menu_root_proxy.show_in_menus %}
|
||||
<li class="nav-item child">
|
||||
<a class="nav-link" href="{{ menu_root_proxy.get_absolute_url }}">
|
||||
{{ menu_root_proxy.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if menu_items %}
|
||||
{% for menu_item in menu_items %}
|
||||
{% with category_icon=menu_item.category.icons.first %}
|
||||
{% if menu_item.has_children %}
|
||||
<li class="nav-item {% if menu_item.depth == 1 %}head{% else %}child{% endif %} dropdown pages-dropdown">
|
||||
<a class="nav-link toggle" role="button" aria-haspopup="true" aria-expanded="false" tabindex="0">
|
||||
{{ menu_item.name }}<i class="fa fa-chevron-down small ms-2"></i>
|
||||
</a>
|
||||
<ul class="{% if mega_menu %}megasubmenu{% else %}dropdown-menu{% endif %}">
|
||||
{% else %}
|
||||
<li class="nav-item child">
|
||||
<a class="nav-link" href="{{ menu_item.get_absolute_url }}">
|
||||
{{ menu_item.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for close in menu_item.num_to_close %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user