Conversion_Kitchen_Code/kitchen_counter/scriptAudit/templates/audit/audited_copy.html

667 lines
46 KiB
HTML
Raw Normal View History

2024-04-27 09:33:09 +00:00
{% extends "mnfapp/base.html" %}
{% load static %}
{% load i18n %}
{% block content %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="../../../static/Audit/css/Audit-output.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
2024-05-03 05:53:28 +00:00
<style>
/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
}
#feedback-thanks-container {
display: block;
background-color: #252525;
opacity: .75;
height: 100vh;
width: 100%;
background-color: #7f7f7f;
position: absolute;
width: 100%;
height: 100%;
z-index: 999;
top: 8%;
left: 0%;
}
#feedback-thanks {
border-radius: 8px;
position: relative;
background-color: #FAFAFA;
background-color: #fafafa;
position: absolute;
width: 375px;
height: auto;
top: 50%;
border-radius: 8px;
left: 50%;
transform: translate(-50%, -50%);
z-index: 99;
}
#closeThanksPopup {
position: absolute;
top: -10px;
right: -10px;
background: #EE3C4D;
color: #FAFAFA;
border-radius: 50%;
height: 30px;
width: 30px;
scale: 0.9;
border: transparent;
text-align: center;
}
.f-hats-image {
width: 375.92px;
height: 360.16px;
}
</style>
2024-04-27 09:33:09 +00:00
</head>
<body>
2024-05-03 05:53:28 +00:00
<div id="feedback-thanks-container">
<div id="feedback-thanks">
<button type="button" class="closebtn" id="closeThanksPopup" onclick="closeFeedback();">X</button>
<img src="/static/media/feedback/hats-off.png" alt="hats-off" class="f-hats-image">
</div>
</div>
2024-04-27 09:33:09 +00:00
<div class="modal" tabindex="-1" id="delete" aria-labelledby="exampleModalLabel" aria-hidden="true">
2024-04-30 04:59:37 +00:00
<div class="modal-dialog" id="d-delete">
2024-04-27 09:33:09 +00:00
<div class="modal-content">
<button type="button" class="red-btn-close" data-dismiss="modal" onclick="delete_script_btn()"
aria-hidden="true">X</button>
<div class="modal-body m-body">
<p class="deleteMsg">Are you Sure you want to Delete this Project?</p>
<p class="d-none" id="para_inner_test"></p>
<p class="" id="para_idd"></p>
<div class="d-flex justify-content-evenly script_con_card_low pt-5 ">
<button class="btn primary-btn-color view_text_button" onclick="delete_script_btn()" id="delete_btn_none">
No</button>
<button id="delete_auideted_script"
class="btn primary-btn-color button_download download_text_button view_text_button">Yes</button>
</div>
</div>
</div>
</div>
</div>
2024-04-30 04:59:37 +00:00
2024-04-27 09:33:09 +00:00
</div>
<div class="container mt">
{% if user.is_authenticated %}
{% if i %}
<div class="row">
2024-04-30 04:59:37 +00:00
2024-04-27 09:33:09 +00:00
<div class="col-sm-1">
<img class="d-image" src="/static/media/Audit_img.png" alt="conversion doodle">
</div>
<div class="col-sm-10">
<div class="mobile-view">
<img src="/static/media/Audit_img.png" class="m-none" alt="conversion doodle">
<h2 class="text-center">My Audited Scripts</h2>
</div>
<p class="text-center blockchain-text"> <img src="/static/media/blockchain_img.png" alt="conversion video"
class="block-chain-img">
<span>Your Assets are
Secured by blockchain.
<span class="c-green-text">MNF</span> has no access to Them.
</span>
</p>
</div>
<div class="row gy-3 my-3 m-auto mobile-m">
{% for k in i %}
<div class="col col-sm-6 col-lg-4 col-xl-3">
<div class="card-item card-items">
<div class=" card" id="{{k.scriptName}}">
<div class="card-body">
<div class="d-flex justify-content-between">
2024-04-30 04:59:37 +00:00
<h5 class="card-title" data-toggle="tooltip" title="{{k.scriptName}}">{{k.scriptName|slice:":20"}}</h5>
2024-04-27 09:33:09 +00:00
<div data-scriptid="{{k.scriptName}}" data-url="{{url}}/audit/delete_scripts/{{k.scriptName}}"
data-bs-toggle="modal" data-bs-target="#delete" data-toggle="dropdown" aria-haspopup="true"
class="cpointer" onclick="delete_script_card('{{k.scriptName}}')" aria-expanded="false">
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<circle cx="12.8467" cy="12.2241" r="11.5" fill="#FAFAFA" stroke="#33B0CA" />
<mask id="mask0_342_430" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="4" width="17"
height="17">
<rect x="4.84668" y="4.22412" width="16" height="16" fill="url(#pattern0)" />
</mask>
<g mask="url(#mask0_342_430)">
<rect x="4.84668" y="4.22412" width="18.9091" height="18.9091" fill="#33B0CA" />
</g>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_342_430" transform="scale(0.00195312)" />
</pattern>
<image id="image0_342_430" width="512" height="512"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAgAElEQVR4Ae2dC7D1VXneH65eEgW8cBNNnDbViqbTcWwnmRijmETjWG0biwXUpmMV8UODNqbTNkht02q9VLkYtJmJATIYMEkbO5lEBUw608ZiRYwWGETEGkBTMYgXJKKdhWfr4TvXfb73+e/1/NdvzzDn41ye/a7f+6xnvf999tlb4gYBCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIBBF4GBJf0vSaZL+raR3SfotSZfx39AMmgeaF94g6VRJPyqpeYUbBCAAAQgEEzhU0nMkXSrp/0n6Dv/BYBce+Iu14fDnJDUPcYMABCAAgRACD5J0pqRbdhH2DAUMRtt54LOSXinpgSHep0wIQAACwxI4SdL1HPxc6Rd74CZJ7REBbhCAAAQg0BmBdoX2juLQ3+7KkK+N+c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IAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCA
</defs>
</svg>
</div>
</div>
<h6 class="card-subtitle mb-2 text-muted u_name">{{k.author }}</h6>
{% if k.iscomplete == "S" %}
<div class="my-3">
<p class="card-text">Uploaded On : {{ k.created_on }}</p>
2024-04-30 04:59:37 +00:00
<p class="card-text" data-toggle="tooltip" title="{% trans k.screenplay_language %}">Screenplay in {% trans k.screenplay_language|slice:":10" %}</p>
<p class="card-text" data-toggle="tooltip" title="{% trans k.dialogue_language %}">Dialogues in {% trans k.dialogue_language|slice:":10" %}</p>
2024-04-27 09:33:09 +00:00
<p class="card-text">Pages {% trans k.page_number %}</p>
2024-04-30 04:59:37 +00:00
</div>
2024-04-27 09:33:09 +00:00
{% endif %}
{% if k.iscomplete == "F" %}
<div class="my-3">
<p class="card-text">Uploaded On : {{ k.created_on }}</p>
2024-04-30 04:59:37 +00:00
<p class="card-text">Screenplay in {% trans k.screenplay_language|slice:":10" %}</p>
<p class="card-text">Dialogues in {% trans k.dialogue_language|slice:":10" %}</p>
2024-04-27 09:33:09 +00:00
<p class="card-text">Pages {110}</p>
</div>
{% endif %}
{% if k.iscomplete == "R" %}
<div class="my-3">
<p class="card-text">Uploaded On : {{ k.created_on }}</p>
2024-04-30 04:59:37 +00:00
<p class="card-text">Screenplay in {% trans k.screenplay_language|slice:":10" %}</p>
<p class="card-text">Dialogues in {% trans k.dialogue_language|slice:":10" %}</p>
2024-04-27 09:33:09 +00:00
<p class="card-text">Pages {110}</p>
</div>
{% endif %}
<div class="d-flex justify-content-between script_con_card_low">
{% if k.iscomplete == "S" %}
<Button class="card-link edit-btnn cpointerrr" onclick=redirectToScriptPad('{{k.scriptid}}')>
<img src="{%static '/media/pencil.png'%}" class="pencil_image" width="19">
{% trans "Edit" %}
</Button>
2024-04-30 04:59:37 +00:00
<Button class="card-link cpointerrr" type="button" data-bs-toggle="dropdown"
2024-04-27 09:33:09 +00:00
aria-expanded="false">Download</Button>
<ul class="dropdown-menu ul_list">
<li>
<a class="dropdown-item" id="scipt_original_download" href="#" data-bs-toggle="modal"
data-bs-target="#downloadpopclose" data-toggle="dropdown" aria-haspopup="true"
2024-04-30 04:59:37 +00:00
aria-expanded="false" onclick="original_script({{k}},'script-original','{{k.confirmkey}}')" download><img
2024-04-27 09:33:09 +00:00
src="{%static '/media/download-icon-img.png'%}">
Original Script</a>
</li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#downloadpopclose"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
2024-04-30 04:59:37 +00:00
onclick="original_script({{k}},'script-docx','{{k.confirmkey}}')"
target="_blank" class="navi-link_new"
2024-04-27 09:33:09 +00:00
style="color: #000000;"><img src="{%static '/media/download-icon-img.png'%}">
Audited
Script (DOCX) </a>
</li>
2024-04-30 04:59:37 +00:00
2024-04-27 09:33:09 +00:00
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#downloadpopclose"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
2024-04-30 04:59:37 +00:00
onclick="original_script({{k}},'script-pdf','{{k.confirmkey}}')"
target="_blank" class="navi-link_new"
2024-04-27 09:33:09 +00:00
style="color: #000000;"><img src="{%static '/media/download-icon-img.png'%}">
Audited
Script (PDF) </a>
</li>
2024-04-30 04:59:37 +00:00
{% if k.isfdx == "True" %}
<li>
<a
target="_self" style="color: #000000;cursor:pointer;margin-left:17px;font-size:12px;"><img
src="{%static '/media/download-icon-img.png'%}" disabled>
Audited
Report
</a>
</li>
{% else %}
<li>
<a class="dropdown-item" href="#"
onclick="original_script({{k}},'audit-report','{{k.confirmkey}}')"
2024-04-27 09:33:09 +00:00
target="_blank" class="navi-link_new" style="color: #000000;"><img
src="{%static '/media/download-icon-img.png'%}">
Audited
2024-04-30 04:59:37 +00:00
Report
2024-04-27 09:33:09 +00:00
</a>
</li>
2024-04-30 04:59:37 +00:00
{% endif %}
2024-04-27 09:33:09 +00:00
</ul>
{% elif k.iscomplete == "R" %}
<Button class="card-link edit-btnn cpointerrr" onclick=redirectToScriptPad('{{k.scriptid}}')>
<img src="{%static '/media/pencil.png'%}" class="pencil_image" width="19">
{% trans "Edit" %}
</Button>
<Button class="card-link cpointerrr" type="button" data-bs-toggle="dropdown"
aria-expanded="false">Download</Button>
2024-04-30 04:59:37 +00:00
2024-04-27 09:33:09 +00:00
{% elif k.iscomplete == "F" %}
<Button class="card-link edit-btnn cpointerrr" onclick=redirectToScriptPad('{{k.scriptid}}')>
<img src="{%static '/media/pencil.png'%}" class="pencil_image" width="19">
{% trans "Edit" %}
</Button>
<Button class="card-link cpointerrr" type="button" data-bs-toggle="dropdown"
aria-expanded="false">Download</Button>
2024-04-30 04:59:37 +00:00
2024-04-27 09:33:09 +00:00
{% endif%}
</div>
</div>
{% if k.iscomplete == "R" %}
<div id="script_con_card_expected" class="script_con_card_expected active">
<div>
<p>Your script is in progress.</p>
<p>Please wait.We will notify you when it's complete.</p>
</div>
</div>
{% endif %}
{% if k.iscomplete == "F" %}
<div id="script_con_card_expected" class="script_con_card_expected active">
<div>
<p>For some reason the Screenplay could not be completed</p>
<p>We will investigate it and revert to you.</p>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center my-3">
<h2 style=" font-size: 24px; font-weight: 700;">My Audited Scripts</h2>
</div>
<div class="row align-items-center justify-content-center my-5">
<div class="col-md-8">
<div class="card text-center">
<div class="card-body bgcolor">
<h5 class="card-title">Oops! You are yet to Audit your first script!!</h5>
<div class="card-btn">
<a href="#" onclick="window.location.replace('/audit/home')" class="btn btn-primary btnn">Audit your
script
Now</a>
</div>
<p class="card-texts">P.S. - if you uploaded your script for Audit and are not yet seeing the Audited
script
OR<br>
2024-04-30 04:59:37 +00:00
had some difficulty in uploading your script, please"
2024-04-27 09:33:09 +00:00
</p>
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
2024-04-30 04:59:37 +00:00
<script>
var URL = window.location.origin
</script>
2024-04-27 09:33:09 +00:00
<script>
document.addEventListener('DOMContentLoaded', function () {
// Select all elements with class .formattedDate
var formattedDateElements = document.querySelectorAll('.formattedDate');
// Loop through each element and format the date
formattedDateElements.forEach(function (element) {
// Get the original date string from the element's content
var dateString = element.textContent.trim();
// Parse the date string
var originalDate = new Date(dateString);
// Format the date
var formattedDate = new Intl.DateTimeFormat('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
hour12: true
}).format(originalDate);
// Update the element with the formatted date
element.textContent = formattedDate;
});
});
</script>
<script>
function deleteFile(filename) {
var xhr = new XMLHttpRequest();
var url = 'data-url';
var params = 'filename=' + encodeURIComponent(filename);
xhr.open('DELETE', url, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
console.log('File deleted:', filename);
} else {
console.error('Error deleting file:', filename);
}
}
};
xhr.send(params);
}
function deletescript() {
var fileNameToDelete = 'example-file.txt';
deleteFile(fileNameToDelete);
}
</script>
<script>
function downloadAuditedScript(url, id) {
const accessToken = localStorage.getItem('accessToken')
const apiUrl = `${url}/audit/download?script_id=${id}&type=script-pdf`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
const request = new Request(apiUrl, {
method: 'GET',
headers: headers,
});
{% comment %} window.location.reload() {% endcomment %}
fetch(request)
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.blob();
})
.then((blob) => {
const blobUrl = window.URL.createObjectURL(blob);
const downloadLink = document.createElement('a');
downloadLink.setAttribute('target', '_blank');
downloadLink.href = blobUrl;
downloadLink.download = 'AuditedPDF.pdf';
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
downloadLink.click();
window.URL.revokeObjectURL(blobUrl);
})
.catch((error) => {
console.error('Error downloading file:', error);
});
alert("Your Script is Downloading")
}
function downloadAuditedScriptDocs(url, id) {
const apiUrl = `${url}/audit/download?script_id=${id}&type=script-docx`;
const headers = new Headers();
const accessToken = localStorage.getItem('accessToken')
headers.append('Authorization', `Bearer ${accessToken}`);
const request = new Request(apiUrl, {
method: 'GET',
headers: headers,
});
{% comment %} window.location.reload() {% endcomment %}
fetch(request)
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.blob();
})
.then((blob) => {
const blobUrl = window.URL.createObjectURL(blob);
const downloadLink = document.createElement('a');
downloadLink.setAttribute('target', '_blank');
downloadLink.href = blobUrl;
downloadLink.download = 'AuditedDocument.docx';
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
downloadLink.click();
window.URL.revokeObjectURL(blobUrl);
})
.catch((error) => {
console.error('Error downloading file:', error);
});
alert("Your Script is Downloading")
}
function downloadAuditedScriptOrigianal(url, id) {
const apiUrl = `${url}/audit/download?script_id=${id}&type=script-original`;
const headers = new Headers();
const accessToken = localStorage.getItem('accessToken')
headers.append('Authorization', `Bearer ${accessToken}`);
const request = new Request(apiUrl, {
method: 'GET',
headers: headers,
});
{% comment %} window.location.reload() {% endcomment %}
fetch(request)
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.blob();
})
.then((blob) => {
const blobUrl = window.URL.createObjectURL(blob);
const downloadLink = document.createElement('a');
downloadLink.setAttribute('target', '_blank');
downloadLink.href = blobUrl;
downloadLink.download = 'OriginalFile';
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
downloadLink.click();
window.URL.revokeObjectURL(blobUrl);
})
.catch((error) => {
console.error('Error downloading file:', error);
});
alert("Your Script is Downloading")
}
function downloadAuditedScriptReport(url, id) {
const apiUrl = `${url}/audit/download?script_id=${id}&type=audit-report`;
const headers = new Headers();
const accessToken = localStorage.getItem('accessToken')
headers.append('Authorization', `Bearer ${accessToken}`);
const request = new Request(apiUrl, {
method: 'GET',
headers: headers,
});
{% comment %} window.location.reload() {% endcomment %}
fetch(request)
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.blob();
})
.then((blob) => {
const blobUrl = window.URL.createObjectURL(blob);
const downloadLink = document.createElement('a');
downloadLink.setAttribute('target', '_blank');
downloadLink.href = blobUrl;
downloadLink.download = 'Audit Report';
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
downloadLink.click();
window.URL.revokeObjectURL(blobUrl);
})
.catch((error) => {
console.error('Error downloading file:', error);
});
alert("Your Script is Downloading")
}
// Handling Footer as per scrollbar - Aris
// Check if the browser has a scrollbar
function hasVerticalScrollbar() {
const page = document.querySelector(".split-pane-component");
return page.scrollHeight > window.innerHeight;
}
// Function to toggle the footer's position
// Call the function when the page loads and when it resizes
</script>
<script>
function redirectToScriptPad(id) {
2024-04-30 04:59:37 +00:00
window.location.href = window.location.origin + "/scriptpad2#/" + id;
2024-04-27 09:33:09 +00:00
}
function openURL() {
let idd = document.getElementById('transaction_iddetails').innerText
var url = "https://mumbai.polygonscan.com/tx/" + idd;
window.open(url, "_blank");
}
function original_script(key_value, script_format, confirmkey) {
let scriptid = `${key_value.scriptid}`;
var accessToken = localStorage.getItem("accessToken");
2024-04-30 04:59:37 +00:00
var apiEndpoint = window.location.origin + '/audit/download?' + 'script_id=' + scriptid + '&type='
+ script_format;
2024-04-27 09:33:09 +00:00
location.href = apiEndpoint;
}
let script_completed_val = '';
function delete_script_card(vall) {
script_completed_val = vall;
document.getElementById('d-delete').style.display = 'block';
var elements = document.getElementsByClassName("shadowpop");
elements[0].classList.add("show");
elements[0].classList.add("modal-backdrop");
document.getElementById('delete').style.display = 'block';
var elements = document.getElementsByClassName('card-height');
}
//function delete_script_confirm() {
const deleteBtn = document.getElementById("delete_auideted_script");
deleteBtn.addEventListener("click", async () => {
const csrftoken = '{{csrf_token}}';
// This line seems to be a template placeholder, replace it with the actual value of the CSRF token
const accessToken = localStorage.getItem("accessToken");
try {
const response = await fetch(`/audit/delete_scripts/${script_completed_val}`, {
method: "DELETE",
headers: {
'X-CSRFToken': csrftoken,
'Authorization': `Bearer ${accessToken}`
},
body: JSON.stringify({ id: script_completed_val })
});
console.log(response);
if (response.ok) {
console.log("Deleted successfully");
window.location.reload();
} else {
console.error("Error in deletion process:", response.statusText);
}
} catch (error) {
console.error("An error occurred during deletion:", error);
}
});
function delete_script_btn() {
document.getElementById("delete").style.display = "none";
document.getElementById("delete").removeAttribute("role");
document.getElementsByClassName("modal")[0].classList.remove("show");
document.getElementsByClassName("modal")[0].removeAttribute("aria-modal");
document.getElementsByClassName("modal")[0].setAttribute("aria-hidden", "true");
//document.getElementsByTagName("body")[0].classList.remove("modal-open");
// document.getElementsByTagName("body")[0].style.overflow = "";
// document.getElementsByTagName("body")[0].style.paddingRight = "";
document.getElementsByClassName("cpointer")[0].click();
var elements = document.getElementsByClassName("modal-backdrop");
elements[0].classList.remove("show");
var elements = document.getElementsByClassName("modal-backdrop");
elements[0].classList.add("shadowpop");
var fade_elements = document.getElementsByClassName("modal-backdrop");
fade_elements[0].classList.remove("modal-backdrop");
}
function downloadpopupClose() {
let myModal = new bootstrap.Modal(document.getElementById('downloadpopclose'));
myModal.hide();
// document.getElementsByClassName("modal")[1].classList.remove("show");
// document.getElementsByClassName("modal")[1].style.display = "none";
// document.getElementsByClassName("modal")[1].removeAttribute("aria-modal");
// document.getElementsByClassName("modal")[1].setAttribute("aria-hidden", "true");
// document.getElementById("downloadpopclose").removeAttribute("role");
// document.getElementsByTagName("body")[0].classList.remove("modal-open");
// document.getElementsByTagName("body")[0].style.overflow = "";
// document.getElementsByTagName("body")[0].style.paddingRight = "";
// var elements = document.getElementsByClassName("modal-backdrop");
// elements[0].classList.remove("show");
// var elements = document.getElementsByClassName("modal-backdrop");
// elements[0].classList.add("shadowpop");
// var fade_elements = document.getElementsByClassName("modal-backdrop");
// fade_elements[0].classList.remove("modal-backdrop");
// document.getElementById('scipt_original_download').click();
}
2024-04-30 04:59:37 +00:00
function latest_auditapi_dowload() {
let scriptid = document.getElementById('scriptid').innerText;
let script_format = document.getElementById('script_format').innerText;
var accessToken = localStorage.getItem("accessToken");
var apiEndpoint = window.location.origin + '/audit/download?' + 'script_id=' + scriptid + '&type='
+ script_format
location.href = apiEndpoint;
2024-04-27 09:33:09 +00:00
2024-04-30 04:59:37 +00:00
}
function auditapi_dowload() {
2024-04-27 09:33:09 +00:00
let scriptid = document.getElementById('Script_idd').innerText;
let script_format = document.getElementById('transaction_iddetails').innerText;
let primary_key_value = document.getElementById('primary_key_value_get').value;
let confirmkey_details = document.getElementById('confirmkey_details').innerText;
confirmkey_details = confirmkey_details.trim();
primary_key_value = primary_key_value.trim();
// alert(confirmkey_details)
if (primary_key_value != '') {
let scriptid = document.getElementById('scriptid').innerText;
let script_format = document.getElementById('script_format').innerText;
var accessToken = localStorage.getItem("accessToken");
var apiEndpoint = window.location.origin + '/audit/downloadScriptFromBlockchain?type='
+ script_format + '&script_id=' + scriptid + '&privatekey=' + primary_key_value;
location.href = apiEndpoint;
} else {
alert("Please enter a valid primary key ");
}
}
</script>
<script>
function showmodal(script_idd, format, confirmkey) {
document.getElementById('popupShow').style.display = "block";
document.getElementsByTagName('body')[0].style.overflow = "hidden";
document.getElementById('Script_idd').innerHTML = script_idd;
document.getElementById('transaction_iddetails').innerHTML = format;
var newDiv = document.createElement("div");
newDiv.className = "modal-backdrop show";
document.body.appendChild(newDiv);
}
function hidemodal() {
document.getElementById('popupShow').style.display = "none";
document.getElementsByTagName('body')[0].style.overflow = "scroll";
var elements = document.getElementsByClassName("modal-backdrop");
elements[0].classList.remove("show");
var elements = document.getElementsByClassName("modal-backdrop");
elements[0].classList.add("shadowpop");
var fade_elements = document.getElementsByClassName("modal-backdrop");
fade_elements[0].classList.remove("modal-backdrop");
window.location.reload();
}
2024-05-03 05:53:28 +00:00
function closeFeedback(){
document.getElementById('feedback-thanks-container').style.display="none";
}
2024-04-27 09:33:09 +00:00
</script>
2024-04-30 04:59:37 +00:00
2024-04-27 09:33:09 +00:00
</body>
</html>
{% endblock content %}