from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path

from apps.core import pwa_views
from apps.core import views as core_views

urlpatterns = [
    path(settings.ADMIN_URL, admin.site.urls),
    path("", core_views.home, name="home"),
    path("manifest.webmanifest", pwa_views.manifest, name="manifest"),
    path("sw.js", pwa_views.service_worker, name="service_worker"),
    path("hors-ligne/", pwa_views.offline, name="offline"),
    path("static/icons/icon-<int:size>.png", pwa_views.icons, name="pwa_icon"),
    path("static/icons/icon-maskable-<int:size>.png", pwa_views.icons, {"maskable": True}, name="pwa_icon_maskable"),
    path("", include("apps.core.urls")),
    path("comptes/", include("apps.accounts.urls")),
    path("agences/", include("apps.agencies.urls")),
    path("membres/", include("apps.members.urls")),
    path("formations/", include("apps.training.urls")),
    path("stocks/", include("apps.inventory.urls")),
    path("equipements/", include("apps.equipment.urls")),
    path("projets/", include("apps.projects.urls")),
    path("documents/", include("apps.documents.urls")),
    path("evenements/", include("apps.events.urls")),
    path("communication/", include("apps.communications.urls")),
    path("portail/", include("apps.members.portal_urls")),
    path("finances/", include("apps.finance.urls")),
    path("comptabilite/", include("apps.accounting.urls")),
    path("validation/", include("apps.approvals.urls")),
    path("synchronisation/", include("apps.sync.urls")),
    path("rapports/", include("apps.reporting.urls")),
    path("i18n/", include("django.conf.urls.i18n")),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
