UI changes

This commit is contained in:
snehalathad@aissel.com 2024-06-07 12:01:17 +05:30
parent 036aa8136f
commit dfbda64f50
4 changed files with 21 additions and 23 deletions

View File

@ -14,14 +14,13 @@
"client_name", "client_name",
"column_break_wrvr", "column_break_wrvr",
"client_poc", "client_poc",
"cs_assigned_poc",
"status",
"optin_received_date", "optin_received_date",
"column_break_tmrt",
"optin_approved_date", "optin_approved_date",
"status",
"column_break_tmrt",
"cs_assigned_poc",
"optin_type", "optin_type",
"data_processed_date", "data_processed_date",
"project_details",
"frappe_settings_section", "frappe_settings_section",
"is_published", "is_published",
"route" "route"
@ -116,17 +115,12 @@
{ {
"fieldname": "column_break_tmrt", "fieldname": "column_break_tmrt",
"fieldtype": "Column Break" "fieldtype": "Column Break"
},
{
"fieldname": "project_details",
"fieldtype": "Data",
"label": "Project Details"
} }
], ],
"is_published_field": "is_published", "is_published_field": "is_published",
"is_virtual": 1, "is_virtual": 1,
"links": [], "links": [],
"modified": "2024-06-06 17:16:32.614427", "modified": "2024-06-07 11:01:48.152600",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Opt In Management", "module": "Opt In Management",
"name": "optlist", "name": "optlist",

View File

@ -24,7 +24,6 @@ class optlist(Document):
"project_name" : str(client["project_name"]), "project_name" : str(client["project_name"]),
"client_name" : str(client["client_name"]), "client_name" : str(client["client_name"]),
"client_poc" : str(client["user_name"]), "client_poc" : str(client["user_name"]),
"project_details" : str(client["project_details"]),
"optin_received_date" : optinReceived(str(client["project_details"]),"Opt-in Received"), "optin_received_date" : optinReceived(str(client["project_details"]),"Opt-in Received"),
"optin_approved_date" : optinReceived(str(client["project_details"]),"Opt-in Approved"), "optin_approved_date" : optinReceived(str(client["project_details"]),"Opt-in Approved"),
"status" : optinStatus(str(client["project_details"])), "status" : optinStatus(str(client["project_details"])),
@ -115,7 +114,6 @@ def getValues():
"project_name" : str(client["project_name"]), "project_name" : str(client["project_name"]),
"client_name" : str(client["client_name"]), "client_name" : str(client["client_name"]),
"client_poc" : str(client["user_name"]), "client_poc" : str(client["user_name"]),
"project_details" : str(client["project_details"]),
"optin_received_date" : optinReceived(str(client["project_details"]),"Opt-in Received"), "optin_received_date" : optinReceived(str(client["project_details"]),"Opt-in Received"),
"optin_approved_date" : optinReceived(str(client["project_details"]),"Opt-in Approved"), "optin_approved_date" : optinReceived(str(client["project_details"]),"Opt-in Approved"),
"status" : optinStatus(str(client["project_details"])), "status" : optinStatus(str(client["project_details"])),

View File

@ -35,12 +35,14 @@
{% block title %}Pricing{% endblock %} {% block title %}Pricing{% endblock %}
{% block content %} {% block content %}
<h4>Opt In Data</h4>
<div> <div>
<button id="download-csv" class="button button1">Download CSV</button> <button id="download-csv" class="button button1">Download CSV</button>
<button id="download-xlsx" class="button button2">Download XLSX</button> <button id="download-xlsx" class="button button2">Download XLSX</button>
<button id="download-pdf" class="button button3">Download PDF</button> <button id="download-pdf" class="button button3">Download PDF</button>
</div> </div>
<div id="tabulator-table" class="tabulator-table"></div> <div id="tabulator-table" class="tabulator-table"></div>
<div></div>
{% endblock %} {% endblock %}
@ -69,7 +71,7 @@ document.addEventListener('DOMContentLoaded', function() {
for(var rec in data) for(var rec in data)
{ {
tableData.push({ tableData.push({
kol_id:rec.kol_id, kol_name:rec["kol_name"],project_name: rec["project_name"], client_name:rec["client_name"], client_poc:rec["client_poc"], cs_Assigned_poc:rec["cs_Assigned_poc"],optin_received_date:rec["optin_received_date"],optin_approved_date:rec["optin_approved_date"],status:rec["status"],project_details:rec["project_details"] kol_id:rec.kol_id, kol_name:rec["kol_name"],project_name: rec["project_name"], client_name:rec["client_name"], client_poc:rec["client_poc"], cs_Assigned_poc:rec["cs_Assigned_poc"],optin_received_date:rec["optin_received_date"],optin_approved_date:rec["optin_approved_date"],status:rec["status"],optin_type:rec["optin_type"],data_processed_date:rec["data_processed_date"]
}); });
} }
console.log(tableData); console.log(tableData);
@ -86,39 +88,41 @@ document.addEventListener('DOMContentLoaded', function() {
// filterMode: "remote", // filterMode: "remote",
pagination:true, pagination:true,
paginationSize: 20, paginationSize: 20,
layout:"fitDataStretch",
ajaxLoaderLoading:"<span>Loading Data</span>", ajaxLoaderLoading:"<span>Loading Data</span>",
// paginationMode:"remote", // paginationMode:"remote",
paginationSizeSelector: [5, 10, 50, 100], paginationSizeSelector: [5, 10, 50, 100],
paginationCounter: "rows", paginationCounter: "rows",
columns:[ // Define table columns columns:[ // Define table columns
{title:"KOL ID", field:"kol_id", width:150,headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"KOL ID", field:"kol_id",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"KOL Name", field:"kol_name", width:150,headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"KOL Name", field:"kol_name",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Project Name", field:"project_name",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Project Name", field:"project_name",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Client Name", field:"client_name",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Client Name", field:"client_name",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Client POC", field:"client_poc",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Client POC", field:"client_poc",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"CS Assigned POC", field:"cs_assigned_poc",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"CS Assigned POC", field:"cs_assigned_poc",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Opt-in Requested", field:"optin_received_date",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Requested Date", field:"optin_received_date",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Opt-in Approved", field:"optin_approved_date",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Approved Date", field:"optin_approved_date",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Status", field:"status",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Status", field:"status",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Project Details", field:"project_details",headerFilterPlaceholder: "Search", headerFilter: true,}, {title:"Opt-In Type", field:"optin_type",headerFilterPlaceholder: "Search", headerFilter: true,},
{title:"Data Processed Date", field:"data_processed_date",headerFilterPlaceholder: "Search", headerFilter: true,},
], ],
}); });
document.getElementById("download-csv").addEventListener("click", function(){ document.getElementById("download-csv").addEventListener("click", function(){
table.download("csv", "data.csv"); table.download("csv", "optInData.csv");
}); });
//trigger download of data.xlsx file //trigger download of data.xlsx file
document.getElementById("download-xlsx").addEventListener("click", function(){ document.getElementById("download-xlsx").addEventListener("click", function(){
table.download("xlsx", "data.xlsx", {sheetName:"My Data"}); table.download("xlsx", "optInData.xlsx", {sheetName:"Opt In Data"});
}); });
//trigger download of data.pdf file //trigger download of data.pdf file
document.getElementById("download-pdf").addEventListener("click", function(){ document.getElementById("download-pdf").addEventListener("click", function(){
table.download("pdf", "data.pdf", { table.download("pdf", "optInData.pdf", {
orientation:"portrait", //set page orientation to portrait orientation:"portrait", //set page orientation to portrait
title:"Example Report", //add title to report title:"opt In Data Report", //add title to report
}); });
}); });

View File

@ -15,6 +15,8 @@ def fetch_data():
"optin_received_date" : str(client["optin_received_date"]), "optin_received_date" : str(client["optin_received_date"]),
"optin_approved_date" : str(client["optin_approved_date"]), "optin_approved_date" : str(client["optin_approved_date"]),
"status" : str(client["status"]), "status" : str(client["status"]),
"project_details": str(client["project_details"])
} }
for client in records] for client in records]