Skip to content
Snippets Groups Projects
Commit c547cb6a authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Fix dashboard links & improve decoupling

Adapt dashboard links to new URL structure of plan
Introduce conditional loading of paths to central URL file
parent ed77c4b4
No related branches found
No related tags found
No related merge requests found
......@@ -25,14 +25,14 @@
{% if 'AKPlan'|check_app_installed %}
<a class="dashboard-box btn btn-primary"
href="{% url 'plan:ak_plan_current_next' event_slug=event.slug %}">
href="{% url 'plan:plan_overview' event_slug=event.slug %}">
<div class="col-sm-12 col-md-3 col-lg-2 dashboard-button">
<span class="fa fa-list-ul"></span>
<span class='text'>{% trans 'Current AKs' %}</span>
</div>
</a>
<a class="dashboard-box btn btn-primary"
href="{% url 'plan:ak_plan_timeline' event_slug=event.slug %}">
href="{% url 'plan:plan_wall' event_slug=event.slug %}">
<div class="col-sm-12 col-md-3 col-lg-2 dashboard-button">
<span class="fa fa-calendar"></span>
<span class='text'>{% trans "AK Wall" %}</span>
......
......@@ -13,12 +13,19 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.apps import apps
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('AKSubmission.urls', namespace='submit')),
path('', include('AKDashboard.urls', namespace='dashboard')),
path('i18n/', include('django.conf.urls.i18n')),
path('i18n/', include('django.conf.urls.i18n'))
]
# Load URLs dynamically (only if components are active)
if apps.is_installed("AKSubmission"):
urlpatterns.append(path('', include('AKSubmission.urls', namespace='submit')))
if apps.is_installed("AKDashboard"):
urlpatterns.append(path('', include('AKDashboard.urls', namespace='dashboard')))
if apps.is_installed("AKPlan"):
urlpatterns.append(path('', include('AKPlan.urls', namespace='plan')))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment