Compare commits

...

64 Commits

Author SHA1 Message Date
95ca55816e Merge pull request 'fix(email): change mail to domain associated' (#3) from bobby_dev into main
Reviewed-on: #3
2025-01-23 06:24:01 +00:00
bobbyvish
b7dc64b4cc fix(email): change mail to domain associated 2024-07-11 13:34:59 +05:30
3f0de0a415 Merge pull request 'Added readme file' (#2) from bobby_dev into main
Reviewed-on: #2
2024-06-12 07:11:08 +00:00
bobbyvish
3497d2f4a9 Added readme file 2024-06-12 12:26:17 +05:30
51d1c301fb Merge pull request 'bobby_dev' (#1) from bobby_dev into main
Reviewed-on: #1
2024-06-11 09:59:45 +00:00
bobbyvish
dab7734185 Merge branch 'bobby_dev' of https://github.com/WDI-Ideas/digest_backend into bobby_dev 2024-06-11 15:28:18 +05:30
bobbyvish
20796ce757 conflict fix 2024-06-11 15:26:29 +05:30
bobbyvish
d4eb35406c fix:1404 file 2024-06-06 13:56:44 +05:30
BOBBY VISHWAKARMA
15e591169a Merge branch 'development' into bobby_dev 2024-05-27 15:33:15 +05:30
bobbyvish
a78cf241dd fix(404):404 and permission denied page 2024-05-27 15:29:57 +05:30
BOBBY VISHWAKARMA
e842b12957 Merge pull request #54 from WDI-Ideas/development
Development
2024-05-23 12:18:26 +05:30
BOBBY VISHWAKARMA
345fa62865 Merge pull request #52 from WDI-Ideas/bobby_dev
refactor(app version): updated serializer
2024-05-23 12:14:12 +05:30
bobbyvish
be1ae7262a refactor(app version): updated serializer 2024-05-23 12:13:26 +05:30
BOBBY VISHWAKARMA
244cd7c383 Merge pull request #50 from WDI-Ideas/bobby_dev
fix(app version):changes in logic
2024-05-21 19:44:23 +05:30
bobbyvish
585c863f66 fix(app version):changes in logic 2024-05-21 19:40:57 +05:30
BOBBY VISHWAKARMA
59519ad43f Merge pull request #48 from WDI-Ideas/bobby_dev
conf(production):structure setting of production server and app verio…
2024-05-21 19:03:38 +05:30
BOBBY VISHWAKARMA
9de5bcc122 Merge pull request #47 from WDI-Ideas/staging
Staging
2024-05-16 19:19:37 +05:30
BOBBY VISHWAKARMA
fa5c897d99 Merge pull request #46 from WDI-Ideas/development
Development
2024-05-16 17:52:30 +05:30
BOBBY VISHWAKARMA
14c415389e Merge pull request #45 from WDI-Ideas/bobby_dev
feat(contact us): landing page contact support through email
2024-05-16 17:51:37 +05:30
BOBBY VISHWAKARMA
24d18e6a30 Merge pull request #44 from WDI-Ideas/development
Development
2024-05-15 17:40:28 +05:30
BOBBY VISHWAKARMA
a6e97f25b0 Merge branch 'staging' into development 2024-05-15 17:40:19 +05:30
BOBBY VISHWAKARMA
5450ac31d2 Merge pull request #43 from WDI-Ideas/bobby_dev
refactor: user report filter
2024-05-15 17:33:58 +05:30
BOBBY VISHWAKARMA
a3dd0cc941 Merge pull request #42 from WDI-Ideas/bobby_dev
refactor(module_auth): form validation
2024-05-15 11:18:17 +05:30
BOBBY VISHWAKARMA
5cbd822c33 Merge pull request #41 from WDI-Ideas/bobby_dev
refactor(module_auth): form validation
2024-05-15 11:15:26 +05:30
BOBBY VISHWAKARMA
eff9eccf1e Merge pull request #40 from WDI-Ideas/development
Development
2024-05-14 12:01:49 +05:30
BOBBY VISHWAKARMA
4e83b961c0 Merge pull request #39 from WDI-Ideas/bobby_dev
refactor(auth):changed logout functionality
2024-05-14 12:01:29 +05:30
BOBBY VISHWAKARMA
35af98676f Merge pull request #38 from WDI-Ideas/development
Development
2024-05-13 17:03:01 +05:30
BOBBY VISHWAKARMA
bc2c961d5b Merge pull request #37 from WDI-Ideas/bobby_dev
refactor(notification):added notification for symptom
2024-05-13 17:02:39 +05:30
BOBBY VISHWAKARMA
70de300837 Merge pull request #36 from WDI-Ideas/development
Development
2024-05-13 12:09:25 +05:30
BOBBY VISHWAKARMA
9aa3fa9c2a Merge pull request #35 from WDI-Ideas/bobby_dev
refactore(dataset):script to update the data of dataset
2024-05-13 12:08:58 +05:30
BOBBY VISHWAKARMA
281336b4c2 Merge pull request #34 from WDI-Ideas/development
Development
2024-05-09 16:24:08 +05:30
BOBBY VISHWAKARMA
d1286fa6bf Merge pull request #33 from WDI-Ideas/bobby_dev
refactor(manage_notification): solved the issue of cron for push noti…
2024-05-09 16:23:25 +05:30
BOBBY VISHWAKARMA
716590e718 Merge pull request #32 from WDI-Ideas/development
Development
2024-04-19 15:55:25 +05:30
BOBBY VISHWAKARMA
36674c67f7 Merge pull request #31 from WDI-Ideas/bobby_dev
refactor: meal duplicate and admin validation
2024-04-19 15:54:08 +05:30
BOBBY VISHWAKARMA
6361444cb8 Merge pull request #30 from WDI-Ideas/development
Development
2024-04-18 11:57:31 +05:30
BOBBY VISHWAKARMA
816dd0367a Merge pull request #29 from WDI-Ideas/bobby_dev
refactor: form validation
2024-04-18 11:57:12 +05:30
BOBBY VISHWAKARMA
6f8257d1d8 Merge pull request #28 from WDI-Ideas/development
Development
2024-04-15 15:00:45 +05:30
BOBBY VISHWAKARMA
3461a7281e Merge pull request #27 from WDI-Ideas/bobby_dev
refactor: home api sort and datatable
2024-04-15 14:55:24 +05:30
BOBBY VISHWAKARMA
6d55254013 Merge pull request #26 from WDI-Ideas/development
Development
2024-04-08 00:34:55 +05:30
BOBBY VISHWAKARMA
694e74eb0c Merge pull request #25 from WDI-Ideas/bobby_dev
refactor: validation of all forms
2024-04-08 00:34:32 +05:30
BOBBY VISHWAKARMA
0a7b910c46 Merge pull request #24 from WDI-Ideas/development
Development
2024-04-04 16:30:42 +05:30
BOBBY VISHWAKARMA
6aa5c602d2 Merge pull request #23 from WDI-Ideas/bobby_dev
fix meal api and force update api
2024-04-04 16:30:06 +05:30
BOBBY VISHWAKARMA
514f9a96e2 Merge pull request #22 from WDI-Ideas/development
Development
2024-04-02 19:29:52 +05:30
BOBBY VISHWAKARMA
f13b7d8d4e Merge pull request #21 from WDI-Ideas/bobby_dev
fix: iamprincipal
2024-04-02 19:29:26 +05:30
BOBBY VISHWAKARMA
d41af6a628 Merge pull request #20 from WDI-Ideas/development
Development
2024-04-01 11:55:25 +05:30
BOBBY VISHWAKARMA
ec1fc86c25 Merge pull request #19 from WDI-Ideas/bobby_dev
Refactor activity model
2024-04-01 11:54:56 +05:30
BOBBY VISHWAKARMA
1513c8609b Merge pull request #18 from WDI-Ideas/development
Development
2024-04-01 11:34:12 +05:30
BOBBY VISHWAKARMA
82e85c488e Merge pull request #17 from WDI-Ideas/bobby_dev
Refactor i am principal
2024-04-01 11:33:45 +05:30
BOBBY VISHWAKARMA
575c35691e Merge pull request #16 from WDI-Ideas/development
Development
2024-03-29 18:51:58 +05:30
BOBBY VISHWAKARMA
2613e926c7 Merge pull request #15 from WDI-Ideas/bobby_dev
refactor: food dataset api
2024-03-29 18:51:24 +05:30
BOBBY VISHWAKARMA
de964c4620 Merge pull request #14 from WDI-Ideas/development
Development
2024-03-29 00:49:49 +05:30
BOBBY VISHWAKARMA
9e6c995e59 Merge pull request #13 from WDI-Ideas/bobby_dev
feat: Added meal food and ingredient record through dataset
2024-03-29 00:49:09 +05:30
BOBBY VISHWAKARMA
5e85aea844 Merge pull request #12 from WDI-Ideas/development
Development
2024-03-26 13:25:31 +05:30
BOBBY VISHWAKARMA
edc1f394db Merge pull request #11 from WDI-Ideas/bobby_dev
refactor datatables
2024-03-26 13:25:08 +05:30
BOBBY VISHWAKARMA
6b64a44242 Merge pull request #10 from WDI-Ideas/development
Development
2024-03-21 13:21:18 +05:30
BOBBY VISHWAKARMA
6e3df95b1e Merge pull request #9 from WDI-Ideas/bobby_dev
Bobby dev
2024-03-21 13:19:52 +05:30
BOBBY VISHWAKARMA
7cecbf90b7 Merge pull request #8 from WDI-Ideas/development
Development
2024-03-18 15:23:31 +05:30
BOBBY VISHWAKARMA
090e806b16 Merge pull request #7 from WDI-Ideas/bobby_dev
Changes related to static file
2024-03-18 15:22:57 +05:30
BOBBY VISHWAKARMA
dce1bd46a7 Merge pull request #6 from WDI-Ideas/development
Development
2024-03-18 11:45:58 +05:30
BOBBY VISHWAKARMA
167c379c6b Merge pull request #5 from WDI-Ideas/bobby_dev
refactore iam principal and password reset
2024-03-18 11:45:28 +05:30
BOBBY VISHWAKARMA
d8b121b6a5 Merge pull request #4 from WDI-Ideas/development
Development
2024-03-11 17:34:09 +05:30
BOBBY VISHWAKARMA
d52a35c9e3 Merge pull request #3 from WDI-Ideas/bobby_dev
Updated base setting and env.example file
2024-03-11 17:33:11 +05:30
BOBBY VISHWAKARMA
83224bc92a Merge pull request #2 from WDI-Ideas/development
Development
2024-03-11 16:40:54 +05:30
BOBBY VISHWAKARMA
77cc6a0940 Merge pull request #1 from WDI-Ideas/bobby_dev
Bobby dev
2024-03-11 15:41:03 +05:30
18 changed files with 268 additions and 36 deletions

77
README.md Normal file
View File

@@ -0,0 +1,77 @@
# Installation Guide for Digest Backend
Follow these steps to set up the Digest Backend project on your local machine.
## Cloning the Repository
1. Clone the repository:
```sh
$ git clone https://github.com/WDI-Ideas/digest_backend.git
$ cd digest_backend
```
## Setting Up the Environment
2. Install `virtualenv` if you haven't already:
```sh
$ pip install virtualenv
```
3. Create a virtual environment:
```sh
$ virtualenv venv
```
4. Activate the virtual environment:
**Windows:**
```sh
venv\Scripts\activate
```
**Mac/Linux:**
```sh
source venv/bin/activate
```
## Installing Dependencies
5. Install the required dependencies using pip:
```sh
$ pip install -r requirements.txt
```
## Configuring the Environment Variables
6. Copy and rename the env.example file to .env and set all the required variables. Ensure there are no spaces around the =:
```sh
$ cp env.example .env
```
## Migrating the Database
7. Run the following command to create the database tables:
```sh
$ python manage.py migrate
```
## Pre-Populating the Database
8. Run the following command to pre-populate the database with custom command:
```sh
$ python manage.py load_iam_fixture
```
## Running the Server
9. Run the following command to start the server:
```sh
$ python manage.py runserver
```
Now, your server should be up and running. Access it in your browser at http://127.0.0.1:8000/.
## Note :
- Make sure you have Python and pip installed on your system.
- If you encounter any issues, ensure that all dependencies are properly installed and the environment variables are correctly configured.
- Always activate the virtual environment before running any Python or Django commands.

View File

@@ -3,7 +3,7 @@ from django.contrib.auth.hashers import make_password
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
from module_iam.models import IAmPrincipal
from module_iam.models import AppVersion, IAmPrincipal
from module_project import constants
# class BasePasswordSerializer(serializers.Serializer):
@@ -107,3 +107,13 @@ class PasswordResetSerializer(serializers.ModelSerializer):
instance.password = make_password(new_password)
instance.save()
return instance
class AppVersionSerializer(serializers.ModelSerializer):
class Meta:
model = AppVersion
fields = [
"device_type",
"version",
"force_upgrade",
"recommend_upgrade",
]

View File

@@ -19,6 +19,5 @@ urlpatterns = [
path('apple-signin/', views.AppleSignin.as_view(), name='apple_signin'),
path('version-check/', views.VersionCheck.as_view(), name='version_check'),
path('app-version/', views.VersionCheck.as_view(), name='version_check'),
]

View File

@@ -15,7 +15,7 @@ from module_project import constants
from module_project.service import EmailService, SMSService
from module_project.utils import ApiResponse
from .serializers import (LoginSerializer, OtpVerificationSerializer,
from .serializers import (AppVersionSerializer, LoginSerializer, OtpVerificationSerializer,
PasswordResetSerializer, RegistrationSerializer)
from .utils import (AuthService, GoogleAuthService,
authticate_with_otp_and_passsword, blacklist_token,
@@ -139,7 +139,7 @@ class OtpRequestView(APIView):
return ApiResponse.error(
message=constants.EMAIL_REQUIRED, errors=constants.EMAIL_REQUIRED
)
print(f"email auth username: {settings.EMAIL_HOST_USER}")
print(f"email auth username: {settings.DEFAULT_FROM_EMAIL}")
email = request.data.get("email")
principal = get_principal_by_email(email=email)
@@ -161,7 +161,7 @@ class OtpRequestView(APIView):
email_service = EmailService(
subject="Password Reset Request",
to=principal.email,
from_email=settings.EMAIL_HOST_USER,
from_email=settings.DEFAULT_FROM_EMAIL,
)
# Send the email
@@ -369,30 +369,18 @@ class AppleSignin(APIView):
class VersionCheck(APIView):
authentication_classes = []
permission_classes = []
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]
model = AppVersion
def get(self, request, *args, **kwargs):
# app_version = request.GET.get('appVersion')
print("app version is called")
device_type = request.GET.get('deviceType')
if not device_type:
return ApiResponse.error(message=constants.FAILURE, errors="App version and device type is required")
return ApiResponse.error(message=constants.FAILURE, errors="device type is required")
# Query the database to retrieve the upgrade flags based on the app version
try:
version = self.model.objects.filter(device_type=device_type).last()
except self.model.DoesNotExist:
version = None
version = self.model.objects.filter(device_type=device_type).last()
version_data = AppVersionSerializer(version)
if version:
upgrade_flags = {
'forceUpgrade': version.force_upgrade,
'recommendUpgrade': version.recommend_upgrade,
}
else:
upgrade_flags = {
'forceUpgrade': False,
'recommendUpgrade': False,
}
return ApiResponse.success(message=constants.SUCCESS, data=upgrade_flags)
return ApiResponse.success(message=constants.SUCCESS, data=version_data.data)

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.2 on 2024-05-21 14:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('module_iam', '0009_alter_appversion_device_type_and_more'),
]
operations = [
migrations.AlterField(
model_name='appversion',
name='device_type',
field=models.CharField(choices=[('ios', 'ios'), ('android', 'android')], max_length=10, verbose_name='Device Type (ios / android)'),
),
]

View File

@@ -1,5 +1,6 @@
from functools import wraps
from django.core.exceptions import PermissionDenied
from django.shortcuts import render
from . import models
from django.db.models import Q
# import logging
@@ -69,7 +70,7 @@ class ResourcePermissionRequiredMixin:
def dispatch(self, request, *args, **kwargs):
if not self.has_resource_permission(request.user, self.resource):
# logger.warning(f"Permission denied for user {request.user} accessing {self.resource}:{self.action}")
raise PermissionDenied("You do not have permission to access this resource.")
return render(request, "module_iam/permission_denied.html")
return super().dispatch(request, *args, **kwargs)
@classmethod
@@ -80,7 +81,7 @@ class ResourcePermissionRequiredMixin:
instance = cls()
instance.resource = resource
if not instance.has_resource_permission(request.user, instance.resource):
raise PermissionDenied("You do not have permission to access this resource.")
return render(request, "module_iam/permission_denied.html")
return view_func(request, *args, **kwargs)
return _wrapped_view
return decorator

View File

@@ -32,7 +32,7 @@ if READ_DOT_ENV_FILE:
SECRET_KEY = env.str("SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool("DJANGO_DEBUG", True)
DEBUG = env.bool("DJANGO_DEBUG", False)
ALLOWED_HOSTS = []
@@ -216,6 +216,7 @@ EMAIL_HOST_USER = env.str("EMAIL_HOST_USER")
EMAIL_HOST_PASSWORD = env.str("EMAIL_HOST_PASSWORD")
EMAIL_PORT = env.str("EMAIL_PORT")
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = env.str("DEFAULT_FROM_EMAIL")
ONESIGNAL_APP_ID = env.str("ONESIGNAL_APP_ID")
ONESIGNAL_REST_API_KEY = env.str("ONESIGNAL_REST_API_KEY")

View File

@@ -4,7 +4,7 @@ import os
import colorlog
from logging.handlers import TimedRotatingFileHandler
# DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ["admin.eatwithdigest.com"]
# CORS_ALLOWED_ORIGINS = [

View File

@@ -17,8 +17,18 @@ Including another URLconf
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.shortcuts import render
from django.urls import include, path
def handler404(request, exception):
if request.user.is_authenticated:
print("True")
return render(request, '404.html')
else:
print("False")
return render(request, '1404.html')
urlpatterns = [
path('admin/', admin.site.urls),
@@ -40,8 +50,13 @@ urlpatterns = [
path('api/notification/', include("module_notification.api.urls")),
]
# handler404 = handler404
if settings.DEBUG:
import debug_toolbar
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += [path('__debug__/', include(debug_toolbar.urls))]
if not settings.DEBUG:
handler404 = handler404

View File

@@ -115,7 +115,7 @@ class ContactUsReplyView(LoginRequiredMixin, generic.View):
email_service = EmailService(
subject=f"Reply of your inquiry - {instance.subject}",
to=instance.email_address,
from_email=settings.EMAIL_HOST_USER,
from_email=settings.DEFAULT_FROM_EMAIL,
)
email_service.set_text_body(message)
email_service.send()
@@ -162,7 +162,7 @@ def ContactUsLandingView(request):
support_team_service = EmailService(
subject=f"New contact us - {subject}",
to=email,
from_email=settings.EMAIL_HOST_USER,
from_email=settings.DEFAULT_FROM_EMAIL,
)
support_team_service.load_template(
@@ -174,7 +174,7 @@ def ContactUsLandingView(request):
thankyou_service = EmailService(
subject=f"New contact us - {subject}",
to=email,
from_email=settings.EMAIL_HOST_USER,
from_email=settings.DEFAULT_FROM_EMAIL,
)
thankyou_service.load_template(

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

61
templates/1404.html Normal file
View File

@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
<title>Digest</title>
{% load static %}
<link rel="icon" type="image/x-icon" href="../src/assets/img/favicon.ico"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
<link href="{% static 'src/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet" type="text/css" />
<link href="{% static 'layouts/collapsible-menu/css/light/plugins.css' %}" rel="stylesheet" type="text/css" />
<link href="{% static 'src/assets/css/light/pages/error/error.css' %}" rel="stylesheet" type="text/css" />
<!-- END GLOBAL MANDATORY STYLES -->
<style>
body.dark .theme-logo.light-element {
display: none;
}
.theme-logo.light-element {
display: inline-block;
}
.error-gif{
background-image: url(https://cdn.dribbble.com/users/722246/screenshots/3066818/404-page.gif);
height: 600px;
background-position: center;
background-repeat: no-repeat;
}
</style>
</head>
<body class="text-center">.
<div class="container-fluid">
<div class="row">
<div class="col-md-4 mr-auto mt-5 text-md-left text-center">
{% comment %} <a href="index.html" class="ml-md-5">
<img alt="image-404" src="../src/assets/img/logo.svg" class="dark-element theme-logo">
<img alt="image-404" src="../src/assets/img/logo2.svg" class="light-element theme-logo">
</a> {% endcomment %}
</div>
</div>
</div>
<div class="container-fluid error-content">
<div class="">
<h2>Ooops!</h2>
<h3 class="m-1">The page you requested was not found!</h3>
<a href="{% url 'module_auth:login'%}" class="btn btn-dark m-1">Login Page</a>
<div class="error-gif"></div>
</div>
</div>
<!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
<script src="{% static 'src/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<!-- END GLOBAL MANDATORY SCRIPTS -->
</body>
</html>

36
templates/404.html Normal file
View File

@@ -0,0 +1,36 @@
{% extends 'base_structure/layout/base_template.html' %}
{% load static %}
{% block stylesheet %}
{% endblock %}
{% block content %}
<div class="row layout-top-spacing">
<div id="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{% url 'module_iam:dashboard'%}">Dashboard</a>
</li>
<li class="breadcrumb-item active">404 Error</li>
</ol>
<!-- Page Content -->
<h1 class="display-1">404</h1>
<p class="lead">Page not found. You can
<a class="btn" href="javascript:history.back()">go back</a>
to the previous page, or
<a class="btn" href="{% url 'module_iam:dashboard'%}">return home</a>.</p>
</div>
</div>
{% endblock content %}
{% block javascript %}
{% endblock %}

View File

@@ -24,7 +24,7 @@
</div>
<div class="shadow-bottom"></div>
<ul class="list-unstyled menu-categories" id="accordionExample">
<li class="menu {% if page_name == iam_constants_context.RESOURCE_MANAGE_DASHBOARD %}active{% endif %}">
<li class="menu {% if page_name == iam_constants_context.RESOURCE_MANAGE_DASHBOARD or not page_name%}active{% endif %}">
<a href="{% url 'module_iam:dashboard'%}" aria-expanded="false" class="dropdown-toggle">
<div class="">
<span class="material-symbols-outlined">dashboard</span>

View File

@@ -25,7 +25,7 @@
<p>Hello {{name}},</p>
<p>It looks like you've requested a password reset for your account.</p>
<p>To reset your password, please use the following secret code:</p>
<p><strong>{{ code }}</strong></p>
<h2><strong>{{ code }}</strong></h2>
<p>If you didn't request a password reset, you can safely ignore this email.</p>
<p>Thank you,</p>
<p>Team Digest</p>

View File

@@ -401,13 +401,14 @@ var mealUrl = "{% url 'module_activity:meal_detail' pk=0 %}"
var medicationUrl = "{% url 'module_activity:medication_detail' pk=0 %}"
var bowelUrl = "{% url 'module_activity:bowel_detail' pk=0 %}"
var symptomUrl = "{% url 'module_activity:meal_symptom_detail' pk=0 %}"
var reportUrl = "{% url 'module_activity:report_data' principal_id=obj.id %}?date_range=date_range_data"
// Entry point
$(document).ready(function() {
tableName = $('#table');
//dataTableInstance = initializeDataTable(tableName, activityMainUrl);
var selectedDays = $('input[name="dateFilter"]:checked').val();
getReportData(selectedDays);
@@ -538,7 +539,6 @@ function filterActivityData(dateRange){
}
*/
function getReportData(days){
console.log("data range is ", days)
var url = days ? reportUrl.replace("date_range_data", days) : reportUrl

View File

@@ -0,0 +1,25 @@
{% extends 'base_structure/layout/base_template.html' %}
{% load static %}
{% block stylesheet %}
{% endblock %}
{% block content %}
<div class="row layout-top-spacing">
<div id="content-wrapper">
<div class="container-fluid text-center">
<h1 class="w3-jumbo w3-animate-top w3-center"><code>Access Denied</code></h1>
<hr class="w3-border-white w3-animate-left" style="margin:auto;width:50%">
<h3 class="w3-center w3-animate-right">You dont have permission to view this site.</h3>
<h3 class="w3-center w3-animate-zoom">🚫🚫🚫🚫</h3>
<h6 class="w3-center w3-animate-zoom">error code:403 forbidden</h6>
</div>
</div>
</div>
{% endblock content %}
{% block javascript %}
{% endblock %}

View File

@@ -68,6 +68,7 @@
</div>
<!-- modal for View Feedback Question Answer -->
<div class="modal fade" id="feedbackmodal" tabindex="-1" role="dialog" aria-labelledby="feedbackmodalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content" >
@@ -126,7 +127,7 @@ function initializeDataTable(tableName, mainUrl) {
{
data: "comment",
render: function (data, type, row) {
return `<button class="btn btn-primary view-comment" data-comment="${data}">View</button>`;
return `<button class="btn btn-primary view-comment" data-comment="${data}">View</button>`;
}
}
],