* adds proper boolean mapping to update_codelist * differs between id and atom_id for KonovaCode since atomIds are not unique (could change in the future) * adds is_selectable and is_archived to KonovaCode * scales width of DAL form fields to 100% width * adds table-responsive wrapping container for table forms to prevent unwanted rendering artifacts in case of table resizing due to long content * adds autocomplete routes for law, registration offices and conservation offices
63 lines
3.2 KiB
Python
63 lines
3.2 KiB
Python
"""konova URL Configuration
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
https://docs.djangoproject.com/en/3.1/topics/http/urls/
|
|
Examples:
|
|
Function views
|
|
1. Add an import: from my_app import views
|
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
Class-based views
|
|
1. Add an import: from other_app.views import Home
|
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
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'))
|
|
"""
|
|
import debug_toolbar
|
|
from django.contrib import admin
|
|
from django.urls import path, include
|
|
|
|
from konova.autocompletes import OrganisationAutocomplete, NonOfficialOrganisationAutocomplete, EcoAccountAutocomplete, \
|
|
InterventionAutocomplete, CompensationActionCodeAutocomplete, BiotopeCodeAutocomplete, LawCodeAutocomplete, \
|
|
RegistrationOfficeCodeAutocomplete, ConservationOfficeCodeAutocomplete
|
|
from konova.settings import SSO_SERVER, SSO_PUBLIC_KEY, SSO_PRIVATE_KEY, DEBUG
|
|
from konova.sso.sso import KonovaSSOClient
|
|
from konova.views import logout_view, home_view, get_document_view, remove_document_view, remove_deadline_view
|
|
|
|
sso_client = KonovaSSOClient(SSO_SERVER, SSO_PUBLIC_KEY, SSO_PRIVATE_KEY)
|
|
urlpatterns = [
|
|
path('admin/', admin.site.urls),
|
|
path('login/', include(sso_client.get_urls())),
|
|
path('logout/', logout_view, name="logout"),
|
|
path('', home_view, name="home"),
|
|
path('intervention/', include("intervention.urls")),
|
|
path('compensation/', include("compensation.urls")),
|
|
path('ema/', include("ema.urls")),
|
|
path('organisation/', include("organisation.urls")),
|
|
path('user/', include("user.urls")),
|
|
path('news/', include("news.urls")),
|
|
path('news/', include("codelist.urls")),
|
|
|
|
# Generic documents routes
|
|
path('document/<id>', get_document_view, name="doc-open"),
|
|
path('document/<id>/remove', remove_document_view, name="doc-remove"),
|
|
|
|
# Generic deadline routes
|
|
path('deadline/<id>/remove', remove_deadline_view, name="deadline-remove"),
|
|
|
|
# Autocomplete paths for all apps
|
|
path("atcmplt/orgs", OrganisationAutocomplete.as_view(), name="orgs-autocomplete"),
|
|
path("atcmplt/orgs/other", NonOfficialOrganisationAutocomplete.as_view(), name="other-orgs-autocomplete"),
|
|
path("atcmplt/eco-accounts", EcoAccountAutocomplete.as_view(), name="accounts-autocomplete"),
|
|
path("atcmplt/interventions", InterventionAutocomplete.as_view(), name="interventions-autocomplete"),
|
|
path("atcmplt/codes/compensation-action", CompensationActionCodeAutocomplete.as_view(), name="codes-compensation-action-autocomplete"),
|
|
path("atcmplt/codes/biotope", BiotopeCodeAutocomplete.as_view(), name="codes-biotope-autocomplete"),
|
|
path("atcmplt/codes/law", LawCodeAutocomplete.as_view(), name="codes-law-autocomplete"),
|
|
path("atcmplt/codes/reg-off", RegistrationOfficeCodeAutocomplete.as_view(), name="codes-registration-office-autocomplete"),
|
|
path("atcmplt/codes/cons-off", ConservationOfficeCodeAutocomplete.as_view(), name="codes-conservation-office-autocomplete"),
|
|
]
|
|
|
|
if DEBUG:
|
|
urlpatterns += [
|
|
path('__debug__/', include(debug_toolbar.urls)),
|
|
] |