Skip to content

Commit

Permalink
UI approval
Browse files Browse the repository at this point in the history
  • Loading branch information
bmugwe committed Jun 20, 2024
1 parent 227f1ff commit 817fb6b
Show file tree
Hide file tree
Showing 246 changed files with 979 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ cpims/settings.py
.history/*
.pyc
__pycache__
__pycache__/*
*.pyc
migrations
Binary file modified cpims/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpims/__pycache__/emails.cpython-310.pyc
Binary file not shown.
Binary file modified cpims/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified cpims/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpims/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpims/__pycache__/wsgi.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion cpims/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'cpims_live',
'NAME': 'cpims_gok',
'USER': 'cpimsdbuser',
'PASSWORD': 'Xaen!ee8',
'HOST': '127.0.0.1',
Expand Down
Binary file modified cpovc_access/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/authentication.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/decorators.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/handlers.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/password_change.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/password_strength.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/signals.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_access/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_afc/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_afc/migrations/__pycache__/0002_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_afc/migrations/__pycache__/0003_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_afc/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_api/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_api/__pycache__/serializers.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_api/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_api/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/decorators.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/perms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_auth/migrations/__pycache__/0002_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_auth/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ctip/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_ctip/migrations/__pycache__/0002_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_ctip/migrations/__pycache__/0003_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_ctip/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/charts.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/parameters.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/queries.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_dashboard/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_forms/migrations/__pycache__/0002_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_forms/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_gis/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_gis/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_gis/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_gis/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_gis/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_gis/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/migrations/__pycache__/0002_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_help/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/country.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/__pycache__/utils.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_main/migrations/__pycache__/0002_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_main/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/params.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/telegram.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/__pycache__/vurugu.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_manage/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
19 changes: 13 additions & 6 deletions cpovc_mobile/urls.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
from django.urls import path
from django.urls import path, re_path
from . import views

# This should contain urls related to Mobile App endpoints ONLY

urlpatterns = [
path('', views.ovc_mobile_home, name='ovc_mobile_home'),
path("", views.ovc_mobile_home, name="ovc_mobile_home"),
# path('caseload/', views.ovc_mobile_caseload, name='ovc_mobile_caseload'),
path('caseload/', views.CaseloadViewSet.as_view()),
path("caseload/", views.CaseloadViewSet.as_view()),
# path('crs/', views.CaseloadViewSet.as_view()),
# path('follow_up/', views.CaseloadViewSet.as_view()),
path('crs/', views.ovc_mobile_crs, name='ovc_mobile_crs'),
path('follow_up/', views.ovc_mobile_follow_up, name='ovc_mobile_follow_up'),
]
path("crs/", views.ovc_mobile_crs, name="ovc_mobile_crs"),
path("follow_up/", views.ovc_mobile_follow_up, name="ovc_mobile_follow_up"),
# Approval urls UI
path("mobile-approval/", views.mobile_app_home, name="mobile_app_home"),
re_path(
r"^crs/view/(?P<id>\w+)/$",
views.view_mobile_case_record_sheet,
name="view_mobile_case_record_sheet",
),
]
109 changes: 99 additions & 10 deletions cpovc_mobile/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

from cpovc_forms.models import OVCCaseRecord, OVCCaseGeo
from cpovc_mobile.serializers import CaseRecordSerializer
from django.shortcuts import render, redirect

from django.contrib.auth.decorators import login_required

@api_view(['POST', 'GET'])

@api_view(["POST", "GET"])
def ovc_mobile_home(request):
"""Method to handle Mobile endpoints."""
try:
return(Response({'message':'Method not allowed'}, status=status.HTTP_400_BAD_REQUEST))
return Response(
{"message": "Method not allowed"}, status=status.HTTP_400_BAD_REQUEST
)
except Exception as e:
raise e
else:
Expand All @@ -26,33 +31,117 @@ def get_queryset(self):
for the currently authenticated user.
"""
user = self.request.user
cases = OVCCaseGeo.objects.filter(is_void=False).values('case_id_id')[:10]
case_obj = OVCCaseRecord.objects.filter(
case_id__in=cases, case_status='ACTIVE')
cases = OVCCaseGeo.objects.filter(is_void=False).values("case_id_id")[:10]
case_obj = OVCCaseRecord.objects.filter(case_id__in=cases, case_status="ACTIVE")
return case_obj


@api_view(['POST'])
@api_view(["POST"])
def ovc_mobile_crs(request):
"""Method to handle Mobile CRS endpoints."""
try:
results = {"message": "Saved Successfull"}

return(Response(results, status=201 ))
return Response(results, status=201)
except Exception as e:
raise e
else:
pass


@api_view(['POST'])
@api_view(["POST"])
def ovc_mobile_follow_up(request):
"""Method to handle Mobile CRS endpoints."""
try:
results = {"message": "Saved Successfull"}

return(Response(results, status=201 ))
return Response(results, status=201)
except Exception as e:
raise e
else:
pass
pass


# Mobile approval loading
@login_required
def mobile_app_home(request):
print(f"user id id {request.user.id}")
context = {
"cases": [
{
"id": "749fc18f2cbf11efb24922a3499bfe31",
"care_id": "749fc18f2cbf11efb24922a3499bfe33",
"case": "CCO/47/287/5/29/4423/2024",
"first_name": "Boniface",
"case_date": "2024-01-01",
"case_level": 2,
},
{
"id": "749fc18f2cbf11efb24922a3499bfe32",
"care_id": "2323",
"case": "CCO/47/287/5/29/4425/2024",
"first_name": "John",
"case_date": "2024-01-01",
"case_level": 2,
},
{
"id": "749fc18f2cbf11efb24922a3499bfe33",
"care_id": "2323",
"case": "CCO/47/287/5/29/4426/2024",
"first_name": "Jane",
"case_date": "2024-01-01",
"case_level": 2,
},
{
"id": "749fc18f2cbf11efb24922a3499bfe33",
"care_id": "2323",
"case": "CCO/47/287/5/29/4427/2024",
"first_name": "Jude",
"case_date": "2024-01-01",
"case_level": 2,
},
]
}
return render(request, "mobile/home.html", context=context)


def view_mobile_case_record_sheet(request, id):
csr_id = id
print(f"CSR-ID: {csr_id}")
context = {
"cases": [
{
"id": "749fc18f2cbf11efb24922a3499bfe31",
"care_id": "2323",
"case": "CCO/47/287/5/29/4423/2024",
"first_name": "Boniface",
"case_date": "2024-01-01",
"case_level": "8",
},
{
"id": "749fc18f2cbf11efb24922a3499bfe32",
"care_id": "2323",
"case": "CCO/47/287/5/29/4425/2024",
"first_name": "John",
"case_date": "2024-01-01",
"case_level": "8",
},
{
"id": "749fc18f2cbf11efb24922a3499bfe33",
"care_id": "2323",
"case": "CCO/47/287/5/29/4426/2024",
"first_name": "Jane",
"case_date": "2024-01-01",
"case_level": "8",
},
{
"id": "749fc18f2cbf11efb24922a3499bfe33",
"care_id": "2323",
"case": "CCO/47/287/5/29/4427/2024",
"first_name": "Jude",
"case_date": "2024-01-01",
"case_level": "8",
},
]
}
return render(request, "mobile/preview_csr.html", context=context)
Binary file modified cpovc_ovc/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_ovc/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_registry/migrations/__pycache__/0003_photo.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_registry/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/templatetags/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_registry/templatetags/__pycache__/app_class.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/config.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/documents.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/dq_queries.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/parameters.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/queries.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/security.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/utils.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_reports/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_reports/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_settings/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_settings/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/parameters.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified cpovc_stat_inst/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified cpovc_stat_inst/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions cpovc_stat_inst/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,8 @@
FPERM['FMSI036F'] = {0: [''], 1: ['CRU'], 2: ['CRU'], 3: ['RUD']}
FPERM['FMSI037F'] = {0: [''], 1: ['CRU'], 2: ['CRU'], 3: ['RUD']}
FPERM['FMSI038F'] = {0: [''], 1: ['CRU'], 2: ['CRU'], 3: ['RUD']}


# missing
INSTM = {}
INSTM[''] = ['']
2 changes: 1 addition & 1 deletion cpovc_stat_inst/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from weasyprint import HTML

import barcode
from barcode import EAN13, Code128
# from barcode import EAN13, Code128
import segno

from .forms import (SIForm)
Expand Down
Binary file modified notifications/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/functions.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/signals.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/utils.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified notifications/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified notifications/templatetags/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
</a>
</li>
{% if user.is_authenticated %}
<li class="dropdown">
<a href="{% url 'mobile_app_home' %}" id="mobile-approval" class="dropdown-toggle f-s-20">
<i class="fa fa-mobile"></i>
</a>
</li>

<li class="dropdown" id="session_status"></li>
<li class="dropdown navbar-user">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Expand Down
135 changes: 135 additions & 0 deletions templates/mobile/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{% extends 'base.html' %}
{% load static %}
{% block page_title %} CPIMS Mobile Approval Workflow {% endblock %}

{% load app_filters %}

{% load crispy_forms_tags %}

{% block style_code %}
<link href="{% static 'plugins/datatables/css/data-table.css' %}" rel="stylesheet" />
{% endblock %}

{% block primary %}
<!-- begin breadcrumb -->
<ol class="breadcrumb pull-right">
<li><a href="#">Home</a></li>
<li class="active">Approval</li>
</ol>
<!-- end breadcrumb -->
<!-- begin page-header -->
<h1 class="page-header"> Mobile Aproval <small>Home</small></h1>
<!-- end page-header -->
<div id="messages" class="alert alert-danger fade in" style="display: none;" tabindex="1">
<span class="close" data-dismiss="alert">×</span>
<i class="fa fa-check fa-2x pull-left"></i>
<span class="invalid-form-message" id="invalid-form-message"></span>
</div>
<!-- begin row -->
<div class="row">
<!-- begin col-12 -->
<div class="col-md-12">
<!-- begin panel -->
<div class="panel panel-inverse">
<div class="panel-heading">
<div class="panel-heading-btn">
<a href="#" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
<a href="#" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
</div>
<h4 class="panel-title">Mobile Approval - Workflow</h4>
</div>
<!-- start panel body -->
<div class="panel-body">
<div class="row">

</div>
<hr>
<table class="table" id="data-table">
<thead>
<tr><th>#</th><th>CPIMS ID</th><th>Names</th><th>Case ID</th><th>Case Date</th><th></th></tr>
</thead>
{% for case in cases %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ case.id }}</td>
<td>{{ case.first_name }} {{ case.surname|default:"------" }}</td>
<td>{{ case.case }} {{ case.case_t }}</td>
<td>{{ case.case_date }}</td>
<td>
{% if case.case_level == 2 %}
<a href="{% url 'view_mobile_case_record_sheet' id=case.care_id %}" class="btn btn-sm btn-primary m-r-5">View Care details</a>
{% elif case.case_level == 1 %}
<a href="{% url 'new_alt_care' case_id=case.case_id %}" class="btn btn-sm btn-primary m-r-5">New Alternative Care</a>
{% else %}
<a href="" class="btn btn-sm btn-danger m-r-5">New Case Record Sheet</a>
{% endif %}

</td>
</tr>
{% endfor %}
</table>
</div>
<!-- end panel body -->
</div>
<!-- end panel -->
</div>
<!-- end col-12 -->
</div>
<!-- end row -->

{% endblock %}

{% block lazy_javascript_code %}
<script src="{% static 'plugins/datatables/js/jquery.dataTables.js' %}"></script>
<script src="{% static 'plugins/datatables/js/dataTables.bootstrap.min.js' %}"></script>
<script src="{% static 'plugins/datatables/js/moment.min.js' %}"></script>
<script src="{% static 'plugins/datatables/js/datetime-moment.js' %}"></script>

<script>
$(document).ready(function() {
$('#data-table').DataTable( {
"order": [[ 0, "asc" ]]
} );

$('.ddash').on('click', function(ev) {
// var hashValue = location.hash.replace(/^#/, '');
var id = $(this).attr('id');
var cname = $(this).attr('rel');
var cdate = $(this).attr('rel1');
$('#cname').html(cname);
$('#cdate').html(cdate);
$('#item_cid').val(id);
$('#mywork > tbody').html('<tr><td colspan="3">Loading data</td></tr>');
$.ajax({
type: "POST",
url: "{{ request.get_full_path }}",
data: $("#icases").serialize()+ "&item_id="+ id + "&did=1",
success: function(response)
{
var msg = response.message;
var status_id = response.status;
var cdates = response.dates;
if (status_id == 0){
$("#report_"+ id).remove();
}
$('#mng_messages').html(msg);
var dt = '';
var tchildren = 0;
var tcases = 0;
var trpts = 0;
$.each(response.data, function(key, val) {
dt += '<tr><td></td><td>'+ key +'</td><td>';
dt += val + '</td></tr>';
});
$('#mywork > tbody').html(dt);
},
error: function(){
$('#mng_messages').html("Error removing report")
}
});
$('#modal-details').modal('show');
ev.preventDefault();
});
} );
</script>
{% endblock %}
Loading

0 comments on commit 817fb6b

Please sign in to comment.