Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
],
},
}
Expand Down Expand Up @@ -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 = ["*"]
Expand Down
2 changes: 1 addition & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion itez/beneficiary/urls.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions itez/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<html lang="en">

<head>
{% block rb_head %} {% endblock %}
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Expand Down
42 changes: 42 additions & 0 deletions itez/templates/report_builder/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% extends 'layouts/base.html' %}
{% block rb_head %}

{% block angular_app %}
{% block report_header %}
{% endblock %}
{% endblock %}
{% endblock %}

{% block content %}
<div class="pageloader"></div>
<div class="infraloader is-active"></div> <!-- Main sidebar menu -->

<div style="height: calc(100% - 106px); margin-top: 0.1em;">

<div id="dashboard-wrapper" class="dashboard-outer">
<div class="dashboard-wrapper">
{% block report_builder_content %}
{% block nav %}
{{ block.super }}
<style>
app-header {
"Build Custom Reports Here."
}
</style>
<div [innerHTML]="Build Custom Reports Here."></div>
{% endblock %}

{% endblock report_builder_content %}
<!-- Dashboard Wrapper -->
</div>
</div>
<script>

</script>
<!-- Specific Page JS goes HERE -->
{% block javascripts %}
<script> $(".mat-toolbar-single-row").text("Report Builder")</script>
{% endblock javascripts %}

{% endblock %}

56 changes: 56 additions & 0 deletions itez/templates/report_builder/export_to_report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% extends "report_builder/base.html" %}
{% load i18n %}
{% block content %}
<script src="{{ STATIC_URL }}report_builder/js/jquery-2.2.3.min.js" type="text/javascript" ></script>
<script src="{{ STATIC_URL }}report_builder/js/report_form.js" type="text/javascript" ></script>
<p>
{% trans "Select the report you wish to use. Report filters will be ignored and only your checked off items will be reported." %}
</p>
<p>
{% trans "Create and manage reports" %} <a href="{% url "admin:report_builder_report_changelist" %}">{% trans "here" %}</a>.
</p>
<p>
{% 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 <a href="{{ admin_url }}">here to go back</a>.
{% endblocktrans %}
</p>
<h2>{{ model|capfirst }} {% trans "Reports" %}</h2>
<table class="reports_table">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Created" %}</th>
<th>{% trans "Modified" %}</th>
<th>{% trans "Select and Download" %}</th>
</tr>
</thead>
<tbody>
{% for report in object_list %}
<tr>
<td>
{{ report.name }}
</td>
<td>
{{ report.description }}
</td>
<td>
{% blocktrans with created=report.created user=report.user_created %}
{{ created }} by {{ user }}
{% endblocktrans %}
</td>
<td>
{% blocktrans with modified=report.modified user=report.user_modified %}
{{ modified }} by {{ user }}
{% endblocktrans %}
</td>
<td>
<a href="?ct={{ ct }}&ids={{ ids }}&download={{ report.id }}">
<img style="width: 26px;" src="/static/report_builder/img/download.svg"/>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
25 changes: 25 additions & 0 deletions itez/templates/report_builder/spa.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends "report_builder/base.html" %}
{% load static %}

{% block report_header %}
<meta charset="utf-8">
<title>PPRC-TRALARD | THINK2044 </title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<base href="{% url 'report_builder' %}">
{% endblock %}

{% block report_builder_content %}
{% if not STATIC_URL %}
<p>Please add 'django.core.context_processors.static' to context_processors in settings.py</p>
{% endif %}
<app-root></app-root>
<script type="text/javascript" src="{% static 'report_builder/polyfills-es2015.js' %}" type="module"></script>
<script type="text/javascript" src="{% static 'report_builder/runtime-es2015.js' %}" type="module"></script>
<link rel="stylesheet" href="{% static 'report_builder/styles.css' %}">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script type="text/javascript" src="{% static 'report_builder/main-es2015.js' %}" type="module"></script>

<script type="text/javascript" src="{% static 'report_builder/polyfills-es5.js' %}" nomodule></script>
<script type="text/javascript" src="{% static 'report_builder/runtime-es5.js' %}" nomodule></script>
<script type="text/javascript" src="{% static 'report_builder/main-es5.js' %}" nomodule></script>
{% endblock %}