diff --git a/config/settings/base.py b/config/settings/base.py index 97f11994..bae595a6 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -55,7 +55,12 @@ "PORT": env("DATABASE_PORT"), } } - +# REPORT_BUILDER_THEME = True +# REPORT_BUILDER_ASYNC_REPORT = True +# REPORT_BUILDER_MODEL_MANAGER = 'on_site' +# REPORT_BUILDER_INCLUDE = [ +# "itez.beneficiary", +# ] # URLS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf @@ -94,8 +99,27 @@ # "notifications_rest", "mapwidgets", "django_celery_results", + "report_builder", ] + +REPORT_BUILDER_INCLUDE = [ + "beneficiary" + ,"agent" + ,"beneficiaryparent" + ,"province" + ,"district" + ,"servicearea" + ,"workdetail" + ,"implementingpartner" + ,"facilitytype" + ,"facility" + ,"serviceproviderpersonelqualification" + ,"serviceproviderpersonel" + ,"drug" + ,"service" + ,"medicalrecord" +] LOCAL_APPS = [ "itez.users.apps.UsersConfig", "itez.authentication.apps.AuthenticationConfig", @@ -209,11 +233,12 @@ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.template.context_processors.i18n", - "django.template.context_processors.media", - "django.template.context_processors.static", + "django.template.context_processors.tz", "django.contrib.messages.context_processors.messages", "itez.utils.context_processors.settings_context", + "django.template.context_processors.static", + "django.template.context_processors.media", ], }, } @@ -342,16 +367,12 @@ # ------------------------------------------------------------------------------- # django-rest-framework - https://www.django-rest-framework.org/api-guide/settings/ REST_FRAMEWORK = { - "DEFAULT_AUTHENTICATION_CLASSES": ( - "itez.authentication.backends.ActiveSessionAuthentication", - ), "DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer",), "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", "PAGE_SIZE": 10, } - CORS_ORIGIN_ALLOW_ALL = True # CORS_ALLOW_CREDENTIALS = True CORS_ALLOW_HEADERS = ["*"] diff --git a/config/urls.py b/config/urls.py index 48e622ec..e91cf09c 100644 --- a/config/urls.py +++ b/config/urls.py @@ -24,12 +24,12 @@ ) urlpatterns = [ - path(settings.ADMIN_URL, admin.site.urls), path("", include("itez.beneficiary.urls", namespace="beneficiary")), path("", include("itez.authentication.urls")), path("", include("itez.users.urls", namespace="user")), path('inbox/notifications/', include(notifications.urls, namespace='notifications')), # path('^notifications/', include('notifications_rest.urls')), + path("report/builder/", include("report_builder.urls")), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) admin.site.site_header = "ITEZ Administration" diff --git a/itez/beneficiary/urls.py b/itez/beneficiary/urls.py index aac021f0..a88baea4 100644 --- a/itez/beneficiary/urls.py +++ b/itez/beneficiary/urls.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- -from django.urls import path, re_path +from django.urls import path, re_path, include from itez.beneficiary import views app_name = "beneficiary" diff --git a/itez/templates/layouts/base.html b/itez/templates/layouts/base.html index a2dc4435..9f8f8885 100644 --- a/itez/templates/layouts/base.html +++ b/itez/templates/layouts/base.html @@ -5,6 +5,7 @@
+ {% block rb_head %} {% endblock %} diff --git a/itez/templates/report_builder/base.html b/itez/templates/report_builder/base.html new file mode 100644 index 00000000..1a8d456d --- /dev/null +++ b/itez/templates/report_builder/base.html @@ -0,0 +1,42 @@ +{% extends 'layouts/base.html' %} +{% block rb_head %} + + {% block angular_app %} + {% block report_header %} + {% endblock %} + {% endblock %} +{% endblock %} + +{% block content %} + + + ++ {% trans "Select the report you wish to use. Report filters will be ignored and only your checked off items will be reported." %} +
++ {% trans "Create and manage reports" %} {% trans "here" %}. +
++ {% blocktrans with number_objects=number_objects model=model plur=number_objects|pluralize admin_url=admin_url %} + You have selected {{ number_objects }} {{ model }} record{{ plur }}. Click here to go back. + {% endblocktrans %} +
+| {% trans "Name" %} | +{% trans "Description" %} | +{% trans "Created" %} | +{% trans "Modified" %} | +{% trans "Select and Download" %} | +
|---|---|---|---|---|
| + {{ report.name }} + | ++ {{ report.description }} + | ++ {% blocktrans with created=report.created user=report.user_created %} + {{ created }} by {{ user }} + {% endblocktrans %} + | ++ {% blocktrans with modified=report.modified user=report.user_modified %} + {{ modified }} by {{ user }} + {% endblocktrans %} + | +
+
+ |
+
Please add 'django.core.context_processors.static' to context_processors in settings.py
+ {% endif %} +