Conversion_Kitchen_Code/kitchen_counter/conversion/templates/conversion/conversion.html

1143 lines
169 KiB
HTML
Raw Normal View History

2024-04-27 09:33:09 +00:00
{% extends 'mnfapp/base.html'%}
{% load static %}
{% load poll_extras1 %}
{% csrf_token %}
{% load i18n %}
{% block title %}Conversion Room {%endblock%}
{% block content1 %}
{% endblock %}
{%block content%}
<head>
<title>{% trans 'Conversion Studio' %}</title>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/static/assets/css/split-pane.css" rel="stylesheet" type="text/css" />
<link href="/static/assets/css/pretty-split-pane.css" rel="stylesheet" type="text/css" />
<!-- Latest compiled and minified CSS -->
<!-- Importing Poppins font family -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
font-family: var(--font-family) !important;
}
:root {
--primary-btn-bg: #33B0CA;
--disabled-btn-bg: #616161;
--primary-bg: #FAFAFA;
--heading-bg: #EAEAEA;
--heading-color: #252525;
--text-color: #616161;
--cards-text-size: 10px;
--para-text-size: 12px;
--fullpage-para-text-size: 14px;
--seb-heading-text-size: 16px;
--menu-text-size: 16px;
--primary-heading-text-size: 24px;
--font-family: "Poppins", sans-serif;
}
.primary-btn-greeen {
background: var(--primary-btn-bg) !important;
font-family: var(--font-family) !important;
border: none !important;
}
.primary-heading {
font-size: var(--primary-heading-text-size) !important;
color: var(--heading-color) !important;
}
.sub-heading {
font-size: var(--seb-heading-text-size) !important;
color: var(--heading-color) !important;
font-weight: 600;
}
.full-page-para {
font-size: var(--fullpage-para-text-size) !important;
color: var(--text-color) !important;
}
.sub-para {
color: var(--text-color) !important;
font-size: 14px !important;
}
label {
font-weight: 500 !important;
}
#language4, #language6, #language80, #language8{
max-width: 200px!important;
}
a{
color:#ee3c4d;
}
a:hover{
color:#ee3c4d;
}
.error {
color: rgb(228, 68, 68);
}
.uploadFile button {
border: solid grey dashed 1px;
padding-left: 1em;
padding-right: 1em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 10px;
border: 0;
background-color: rgb(228, 68, 68);
color: white;
font-size: 1.3em;
width: 130px;
margin-top: 0.3em;
margin-left: -130px;
}
.new_txt p{
font-size: 1.2em;
padding-top: 0.2em;
padding-bottom:0.2em ;
width: 94vw;
margin: auto;
}
.new_txt select{
font-size: 1em;
padding: 0.2em;
border-radius: 4px;
}
#language6_error, #language6_error{
font-size: 0.6em;
}
.upload-position{
width: 50%;
position: relative;
right: 90px;
}
.postion-data-text{
width: 45%;
}
/* new add */
.from_label_custom{
cursor: pointer;
background-color: white;
border: 1px solid black;
color: black;
padding: 5px 10px;
border-radius: 5px;
}
/* new add */
@media (min-width:0px) and (max-width:830px) {
.uploadFile button {
width: max-content;
margin-left: 0;
margin-bottom: 12px;
}
.container-995 {
width: 100%;
padding: 0;
margin: auto;
}
.upload-position{
width: 100%;
}
.postion-data-text{
width: 100%;
margin: 0 3px;
}
}
.footer{
position: static;
}
.body-con{
min-height: 84vh !important;
}
.actconversion_studio{
background-color:#ee3c4d;
color:#fff;
}
.disabledbutton {
pointer-events: none;
opacity: 0.1;
}
.checkbox-square{
display: flex;
}
.container{
position: relative;
}
.OR_center{
position: absolute;
left: 34%;
bottom: -5px;
transform: translateX(-50%);
font-weight: bold;
}
#click_btn,
#submitForm {
font-weight: 700;
}
.card-body{
{% comment %} removed shadow from here {% endcomment %}
border-radius: 0.85rem;
margin-bottom: 25px;
}
.card-footer {
background: transparent;
}
.top_heading{
font-weight: 700;
}
.container-995{
min-width: 80%;
}
@media (width < 1025px){
.upload-position{
margin-left: 20px;
}
}
@media (width < 969px){
.upload-position{
margin-left: 37px;
}
}
@media (width < 930px){
.upload-position{
position: relative;
right: 80px;
}
}
@media (width < 608px){
.upload-position{
margin-left: 100px;
}
}
@media (width < 478px){
.upload-position{
margin-left: 60px;
}
.OR_center{
bottom: 12%;
}
.uploadFile button{
font-size: 3.5vw;
margin-left: 45px !important;
}
}
@media (width < 381px){
.OR_center{
left: 45%;
}
.uploadFile button{
font-size: 3vw;
}
}
.upload-script-container form {
display: flex;
justify-content: space-between;
align-items: center;
height: 160px;
}
.upload-script-container form .left-side {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.upload-script-container form .left-side h3 {
color: rgb(228, 68, 68);
font-size: 20px;
}
.upload-script-container form .left-side button {
font-size: 15px;
font-weight: bold;
padding: 10px;
}
.upload-script-container form .middle {
min-height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.upload-script-container form .right-side {
min-height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-end;
margin-bottom: 12px;
}
.upload-script-container form .right-side a {
background: rgb(228, 68, 68);
color: #fff;
padding: 10px;
border-radius: 10px;
font-size: 15px;
font-weight: bold;
text-transform: uppercase;
text-decoration: none;
}
@media screen and (max-width: 950px) {
.upload-script-container form {
height: 100%;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.upload-script-container form .middle {
min-height: 0;
display: block;
}
.upload-script-container form .right-side {
min-height: 0;
display: block;
}
}
@media screen and (max-width: 500px) {
.upload-script-container form .left-side h3 {
font-size: 4vw;
}
.upload-script-container form .left-side button {
font-size: 13px;
margin-left: 0 !important;
}
.upload-script-container form .right-side a {
font-size: 2.5vw;
}
}
@media screen and (max-width: 380px) {
.upload-script-container form .left-side h3 {
font-size: 3vw;
}
.upload-script-container form .left-side p {
font-size: 2.8vw;
}
.upload-script-container form .left-side input {
font-size: 2.4vw;
}
.upload-script-container form .right-side a {
font-size: 2vw;
}
}
.scripts-radio-container {
margin-top: -7px;
}
.scripts-radio-container input {
display: inline !important;
cursor: pointer;
}
.scripts-radio-container label {
cursor: pointer;
margin-right: 8px;
font-weight: 500;
}
#existing-scripts-dropdown {
display: none;
}
select {
font-size: 12px !important;
}
</style>
<script>
function sortOptions(options){
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value }; }).get();
arr.sort(function(o1, o2) { return o1.t > o2.t ? 1 : o1.t < o2.t ? -1 : 0; });
options.each(function(i, o) {
o.value = arr[i].v;
$(o).text(arr[i].t);
});
}
$(document).ready(function(){
var options = $('select#language4 options');
// sortOptions(options);
})
</script>
{%if dataP3 or user.is_staff or dataP4 or 'id == 1234567890'%}
{% if messages %}
<ul class="messages">
{% for message in messages %}
{% if message.tags %} <script>alert("{{message}}");</script>{% endif %}>
{% endfor %}
</ul>
{% endif %}
<div class="body-con">
<div class="container-995" id="div_original_script">
<div class="card-body">
<h3 class="mb-5 top_heading primary-heading">{% trans 'Welcome to the Conversion Studio !' %}</h3>
<p class="full-page-para">{% trans 'By converting your screenplay in several different languages, you can significantly increase the possibility of getting a film made on it.' %}</p>
<p class="full-page-para">{% trans 'In MNF Conversion Studio you can convert your screenplay written in any language into 114 more languages.' %}</p>
<p class="full-page-para">{% trans "It's simple. Upload your screenplay, wait for a few minutes and be ready to send it to many more producers." %}</p>
<p class="full-page-para">{% trans 'You may even opt for dual language dialogues in which dialogues in source language and destination language are written side by side.' %}</p>
<div class="upload-script-container">
<form id="import" name="UScript" class="uploadFile upload-script-form" action="{% url 'conversion' %}" method="post" enctype="multipart/form-data">
<div class="left-side">
<h3 class="sub-heading">Upload on Blockchain and Convert your Screenplay !</h3>
<p class="sub-para">Please upload your script in "Docx", "Fdx", "Pdf" format only..</p>
<div class="scripts-radio-container">
<input type="radio" name="conversion-scripts" id="new-script" checked>
<label for="new-script" class="sub-para">Upload your Script</label>
<input type="radio" name="conversion-scripts" id="existing-scripts">
<label for="existing-scripts" class="sub-para">Choose from existing Scripts</label>
</div>
<input id="con_file" class="sub-para" type="file" name="script" value="add files" accept=".docx, .fdx, .pdf"/>
<select id="existing-scripts-dropdown" onchange="put_existing_link_url()">
<option value="" hidden selected>Choose existing Scripts</option>
{% for script in exsiting_scripts %}
<option value="{{script.0}}">{{script.1|get_script_name}}</option>
{% endfor %}
</select>
<button onclick="displayFileName(event)" type="submit" class="ml-2 primary-btn-greeen">UPLOAD</button>
</div>
<div class="middle">
<h3>OR</h3>
</div>
<div class="right-side">
<a href="{% url 'sampleScriptC' %}" class="primary-btn-greeen">Test by converting a Sample Screenplay</a>
</div>
{% csrf_token%}
</form>
</div>
<!--begin::Form-->
<form class="form" action="{% url 'scriptC'%}" id="inputForm" method="post" enctype="multipart/form-data" onsubmit="uniq_btn.disabled = true; return true;">
{% csrf_token %}
{% if id != 1234567890 %}
<input type="hidden" name="id" value="{{id}}"/>
{%else%}
<input type="hidden" name="id" value="123456789"/>
<input type="hidden" name="sample_id" value="{{sample_id}}"/>
{%endif%}
<input type="text" name="fileUpload" value='{{fileName}}' id="filePath" style="display: none;" />
<input type="text" name="script_title" value='{{script_title}}' id="filePath1" style="display: none;" />
<input type="text" name="author_name" value='{{author_name}}' id="filePath2" style="display: none;" />
<input type="text" name="non_dial_src_lang" value='{{non_dial_src_lang}}' id="primary_lang2" style="display: none;" />
<input type="text" name="dial_src_lang" value='{{dial_src_lang}}' id="primary_lang" style="display: none;" />
<input type="text" name="" value='{{non_dial_src_lang_full}}' id="primary_lang2a" style="display: none;" />
<input type="text" name="" value='{{dial_src_lang_full}}' id="primary_langa" style="display: none;" />
<input type="text" name="dial_src_script" value='{{dial_src_script}}' id="primary_script" style="display: none;" />
<input type="text" name="non_dial_src_script" value='{{non_dial_src_script}}' id="secondary_script" style="display: none;" />
<input type="text" name="dial_src_script1" id="cscript" style="display: none;" />
<input type="text" name="non_dial_src_script1" id="actionscript" style="display: none;" />
<input type="number" name="numPages" value='{{numPages}}' style="display: none;" />
<input type="text" name="script_id" id="script_id" value="{{script_id}}" style="display: none;" >
<input type="hidden" name="centralised" value="{{centralised}}"/>
<input type="hidden" name="request_id" value="{{request_id}}"/>
<input type="hidden" name="existing_script" value="{{existing_script}}" />
<div class="container-995">
{% if user.is_authenticated %}
<div class="new_txt">
<p>
{% if centralised == 'yes' %}
<span class="sub-heading">
Thanks, actionlines of your script -{{script_title}} of {{numPages}} pages is in {{non_dial_src_lang_full}}.
</span>
<br>
<span class="sub-para">
{% trans 'In which language would you like to convert it.' %} <span style="color: red;">*</span>
</span>
{% else %}
<span style="margin-top: 20px;" class="sub-heading">Thanks, actionlines {{script_title}} of {{numPages}} pages is in {{non_dial_src_lang_full}}.</span>
<br><br>
<span class="sub-para">
{% trans 'In which language would you like to convert it.' %} <span style="color: red;">*</span> <br>
</span>
{% endif %}
<select name="nondial_dest_language" id="language4" required>
<option value="">{% trans 'Choose From The List' %}</option>
</select>
<span class='error' id="language4_error"></span>
</p><p>
<span class="sub-para">
Most characters speak {{dial_src_lang_full}}.
In which language would you like to convert the dialogues. <span style="color: red;">*</span>
</span>
<br>
<select name="dial_dest_language" id="language6" onchange="$('#opt3Dial,#opt4Dial,#opt5Dial,#opt6Dial').html(this.value);if (this.value == '{{non_dial_src_lang_full}}'){$('#opt3p,#opt5p').hide();$('#opt3radio1').removeAttr('required');$('#opt3radio2').removeAttr('required');$('#opt5radio1').removeAttr('required');$('#opt5radio2').removeAttr('required');}else{$('#opt3p,#opt5p').show();$('#opt3radio1').attr('required',true);$('#opt3radio2').attr('required',true);$('#opt5radio1').attr('required',true);$('#opt5radio2').attr('required',true);}" required>
<option value="">{% trans 'Choose From The List' %}</option>
</select>
<span class='error' id="language6_error"></span>
</p>
<div id="script_option">
<div>
{%if option3 == 'Yes'%}
<p>
<div id="opt3p">
If some dialogues are in {{non_dial_src_lang_full}}. How to treat these?<br>
<div style="display: flex;">
<input type="radio" name="opt3" id="opt3radio1" value="Yes" style="display: block;" required >&nbsp;&nbsp; Convert these to &nbsp;<span id="opt3Dial"></span> <br>
</div>
<div style="display: flex;">
<input type="radio" name="opt3" id="opt3radio2" value="no" style="display: block;" required>&nbsp;&nbsp;Let these remain in &nbsp;{{non_dial_src_lang_full}}
</div>
</div>
</p>
{%else%}
<input type="hidden" name="opt3" id="opt3radio1" value="Yes">
{%endif%}
{%if option4 == 'Yes'%}
<p>
{% trans 'If some dialogues are in languages other than the'%} {%if dial_src_lang_full != non_dial_src_lang_full%}&nbsp; {{dial_src_lang_full}} or {{non_dial_src_lang_full}}{%else%}&nbsp;{{non_dial_src_lang_full}}{%endif%}.{% trans 'How to treat these?' %}<br>
<div style="display: flex;">
<input type="radio" name="opt4" value="Yes" style="display: block;" required>&nbsp;&nbsp; {% trans 'Convert these to' %} &nbsp;<span id='opt4Dial'></span> <br>
</div>
<div style="display: flex;">
<input type="radio" name="opt4" value="no" style="display: block;" required>&nbsp;&nbsp; {% trans 'Let these remain in the language they are.' %}
</div>
</p>
{%else%}
<input type="hidden" name="opt4" value="Yes">
{%endif%}
</div>
<div id="option5" style="display: block;">
{%if option5 == 'Yes'%}
<p>
<div id="opt5p">
If in {{dial_src_lang_full}} dialogues, some words/sentences are in {{non_dial_src_lang_full}}. How to treat these?
<div style="display: flex;">
<input type="radio" name="opt5" id="opt5radio1" value="Yes" style="display: block;" required>&nbsp;&nbsp;{% trans 'Convert these to'%}&nbsp;<span id="opt5Dial"></span> <br>
</div>
<div style="display: flex;">
<input type="radio" name="opt5" id="opt5radio2" value="no" style="display: block;" required>&nbsp;&nbsp;Let these remain in &nbsp; {{non_dial_src_lang_full}}
</div>
</div>
</p>
{%else%}
<input type="hidden" name="opt5" id="opt5radio1" value="Yes">
{%endif%}
{%if option6 == 'Yes'%}
<p>
If Some words/sentences in {{dial_src_lang_full}} dialogues are in languages other than{%if dial_src_lang_full != non_dial_src_lang_full%}&nbsp; {{dial_src_lang_full}} or {{non_dial_src_lang_full}}{%else%}&nbsp;{{non_dial_src_lang_full}}{%endif%}. How to treat these?<br>
<div style="display: flex;">
<input type="radio" name="opt6" value="Yes" style="display: block;" required>&nbsp;&nbsp; {% trans 'Convert these to'%} &nbsp;<span id="opt6Dial"></span> <br>
</div>
<div style="display: flex;">
<input type="radio" name="opt6" value="no" style="display: block;" required>&nbsp;&nbsp; {% trans 'Let these remain in the language they are.'%}
</div>
</p>
{%else%}
<input type="hidden" name="opt6" value="Yes">
<h1></h1>
{%endif%}
</div>
<p>
<span class="sub-para">
{% trans 'Your converted action lines are written in' %} <span id="lang_script200"></span>.
</span>
<br>
<span class="sub-para">
{% trans 'Would you like to read the actionlines in some other script.'%} <br>
</span>
<select name="non_dial_dest_script" id="language80" required style="min-width: 180px; padding: 3px; margin-top: 0px; font-size: 15px;">
<option value="">{% trans 'Choose From The List' %}</option>
</select>
<span class='error' id="language8_error200"></span>
</p>
<p>
<span class="sub-para">
{% trans 'Your converted dialogues are written in'%} <span id="lang_script"></span>.
</span>
<br>
<span class="sub-para">
{% trans 'Would you like to read the dialogues in some other script.'%} <br>
</span>
<select name="dial_dest_script" id="language8" required style="min-width: 180px; padding: 3px; margin-top: 0px; font-size: 15px;">
<option value="">{% trans 'Choose From The List' %}</option>
</select>
<span class='error' id="language8_error"></span>
</p>
</p>
</div>
<div>
<div class="checkbox-list">
<label class="checkbox checkbox-square">
<input name="dual_dial_script" type="checkbox" />
<span></span>{% trans 'click here if you want dual language dialogues.'%}
</label>
</div>
</div>
<div class="card-footer" style=" margin: auto; text-align: center; background: transparent; border-top: none;" id="click_div">
<button type="button" id="click_btn" class="btn btn-primary primary-btn-greeen"style="
font-size: 1.3em;
border-radius: 10px;
padding-left: 30px;
padding-right: 30px;
">PROCEED</button>
<!-- <button type="reset" class="btn btn-secondary">Cancel</button> -->
</div>
{%if numPages%}
{%if numPages > 5%}
<input type = "hidden" value="No" id="some123"/>
<div class="checkbox-list" id="vetting_div">
<label class="checkbox checkbox-square">
<input name="to_be_vetted_by_lpp" id="vetting_input" onclick="change_sign();" type="checkbox" />
<span></span>{% trans 'Get it vetted by LPP' %}
</label>
</div>
<div class="checkbox-list">
<label class="checkbox checkbox-square">
<input id="sample_5_scenes" name="SampleScript" type="checkbox" onclick = "check_vetting_selected(this);" />
<span></span>{% trans 'Convert upto 5 scenes of the Script for free' %}
</label>
</div>
{%else%}
<input type="checkbox" name='SampleScript' value="off" style="display: none;">
{%endif%}
{%endif%}
<div class="card-footer" style=" margin: auto; text-align: center; border-top: none;" id="submit_btn">
<button type="submit" name="uniq_btn" id="submitForm" class="btn btn-primary primary-btn-greeen" style="margin:auto;
border-radius: 10px;
font-family:inherit;
font-weight: 700;
font-size:1.3em;
padding: 6px 30px 6px 30px;">{% trans 'CONVERT SCRIPT' %}</button>
</div>
</div>
{%endif%}
</div>
</form>
<!--end::Form-->
</div>
</div>
</div>
{% include 'mnfapp/footer.html' %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
function change_sign(){
if (document.getElementById('some123').value == 'Yes')
{
document.getElementById('some123').value = 'No';
}else
{
document.getElementById('some123').value = 'Yes';
}
}
</script>
<script>
function check_vetting_selected(sample_script){
if ($('#sample_5_scenes:checked').val() === "on"){
$('#vetting_div').hide();
}else{
$('#vetting_div').show();
}
countr = document.getElementById('some123').value;
if (countr == "Yes"){
alert("Vetting is not allowed for 5 Scene Sample Conversions!");
document.getElementById('some123').value = "No";
$('#vetting_div').hide();
$("#vetting_input").prop("checked", false);
//document.getElementById('vetting_input').value = ""
}else{console.log("44455");
//document.getElementById('some123').value = "Yes";
//$('#vetting_div').show();
}
}
</script>
<script>
$('#con_file').on( 'change', function() {
let myfile= $( this ).val();
var ext = myfile.split('.').pop();
if(ext=="docx" || ext=="fdx" || ext == "pdf" || ext == "number"){
} else{
alert('Please upload your script in "Docx" or "Fdx" or "Pdf" format only..');
location.reload();
}
});
const importForm = document.getElementById("import");
const conFile = document.getElementById("con_file");
const existingScripts = document.querySelector("#existing-scripts-dropdown");
importForm.addEventListener("submit", (e) => {
const uploadScriptRadio = document.querySelector("#new-script").checked;
const existingScriptRadio = document.querySelector("#existing-scripts").checked;
if (uploadScriptRadio && conFile.value === "") {
alert("Please choose a file");
e.preventDefault();
} else if (existingScriptRadio && existingScripts.value === "") {
alert("Please choose any existing file");
e.preventDefault();
}
});
document.querySelector(".scripts-radio-container").addEventListener("click", (event) => {
const button = event.target;
if (button.id === "new-script") {
document.querySelector("#existing-scripts-dropdown").style.display = "none";
document.querySelector("#con_file").style.display = "inline";
document.getElementById('import').action = "{% url 'conversion' %}"
} else if (button.id === "existing-scripts") {
document.querySelector("#con_file").style.display = "none";
document.querySelector("#existing-scripts-dropdown").style.display = "inline";
}
});
</script>
<script>
function put_existing_link_url(id){
var id11 = document.getElementById('existing-scripts-dropdown').value;
document.getElementById('import').action = "/conversion/load_existingscript/" + id11
}
</script>
<script>
function check(){
var name = $('#con_file').val()
var name1 = name.split("\\")
var name1 = name1[name1.length -1]
var name1 = name1.slice(0,-5)
// var passw= /^(?=.[!@#$%^&.])/;
var format = /[!@#$%^&*()+-=\[\]{};'"\\|,.<>\/?]+/;
if(format.test(name1)){
console.log("ya we did it")
alert("special characters not allowed")
window.location.reload()
}else{
}
}
</script>
<script>
function addRowCount(tableAttr) {
$(tableAttr).each(function(){
$('th:first-child, thead td:first-child', this).each(function(){
var tag = $(this).prop('tagName');
$(this).before('<'+tag+'>#</'+tag+'>');
});
$('td:first-child', this).each(function(i){
$(this).before('<td>'+(i+1)+'</td>');
});
});
}
// Call the function with table attr on which you want automatic serial number
addRowCount('.js-serial');
</script>
<script>
$('#submit_btn').hide();
$('.checkbox-list').hide()
$('#script_option').hide();
$('#click_btn').on('click',function(){
if (document.getElementById('language6').value !="" && document.getElementById('language4').value !="" ){
$('#script_option').show();
$('#submit_btn').show();
$('#click_div').hide();
// if(document.getElementById('primary_lang2a').value!= document.getElementById('language4').value || document.getElementById('primary_langa').value!= document.getElementById('language6').value && document.getElementById('language8').value != document.getElementById('primary_script').value){
// $('.checkbox-list').show()
// }
$('.checkbox-list').show()
}else{
alert("Please Choose both the languages");
}
})
var myfile = "";
$('#uploadFile').on('change', function () {
myfile = $(this).val();
var ext = myfile.split('.').pop();
if (ext == "docx" || ext == "fdx" || ext == "pdf") {
} else {
alert("File Type Not Allowed");
location.reload()
}
});
$('#inputForm').hide();
if (document.getElementById('filePath').value != '') {
$('#inputForm').show();
$('#import').hide();
$('.position').hide();
}
const obj = [
{'key': 'Afrikaans', 'options': ['Afrikaans', 'Albanian', 'Arabic', 'Azerbaijani', 'Basque', 'Bengali', 'Bosnian', 'Bulgarian', 'Catalan', 'Chinese (Simplified)', 'Chinese (Traditional)', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Estonian', 'Filipino', 'Finnish', 'French', 'Galician', 'Georgian', 'German', 'Gujarati', 'Haitian Creole', 'Hausa', 'Hebrew', 'Hindi', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish Gaelic', 'Italian', 'Japanese', 'Kannada', 'Kazakh', 'Khmer', 'Kinyarwanda', 'Korean', 'Kurdish (Kurmanji)', 'Kyrgyz', 'Lao', 'Latvian', 'Lithuanian', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Nepali', 'Norwegian', 'Odia (Oriya)', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala', 'Slovak', 'Slovenian', 'Somali', 'Spanish', 'Swahili', 'Swedish', 'Tamil', 'Tatar', 'Telugu', 'Thai', 'Turkish', 'Turkmen', 'Ukrainian', 'Urdu', 'Uyghur', 'Uzbek', 'Vietnamese', 'Welsh', 'Xhosa', 'Yoruba', 'Zulu'], 'codeSrc': 'af'}, {'key': 'Albanian', 'options': ['Albanian', 'Afrikaans', 'Arabic', 'Azerbaijani', 'Basque', 'Bengali', 'Bosnian', 'Bulgarian', 'Catalan', 'Chinese (Simplified)', 'Chinese (Traditional)', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Estonian', 'Filipino', 'Finnish', 'French', 'Galician', 'Georgian', 'German', 'Gujarati', 'Haitian Creole', 'Hausa', 'Hebrew', 'Hindi', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish Gaelic', 'Italian', 'Japanese', 'Kannada', 'Kazakh', 'Khmer', 'Kinyarwanda', 'Korean', 'Kurdish (Kurmanji)', 'Kyrgyz', 'Lao', 'Latvian', 'Lithuanian', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Nepali', 'Norwegian', 'Odia (Oriya)', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala', 'Slovak', 'Slovenian', 'Somali', 'Spanish', 'Swahili', 'Swedish', 'Tamil', 'Tatar', 'Telugu', 'Thai', 'Turkish', 'Turkmen', 'Ukrainian', 'Urdu', 'Uyghur', 'Uzbek', 'Vietnamese', 'Welsh', 'Xhosa', 'Yoruba', 'Zulu'], 'codeSrc': 'sq'}, {'key': 'Arabic', 'options': ['Arabic', 'Afrikaans', 'Albanian', 'Azerbaijani', 'Basque', 'Bengali', 'Bosnian', 'Bulgarian', 'Catalan', 'Chinese (Simplified)', 'Chinese (Traditional)', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Estonian', 'Filipino', 'Finnish', 'French', 'Galician', 'Georgian', 'German', 'Gujarati', 'Haitian Creole', 'Hausa', 'Hebrew', 'Hindi', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish Gaelic', 'Italian', 'Japanese', 'Kannada', 'Kazakh', 'Khmer', 'Kinyarwanda', 'Korean', 'Kurdish (Kurmanji)', 'Kyrgyz', 'Lao', 'Latvian', 'Lithuanian', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Nepali', 'Norwegian', 'Odia (Oriya)', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala', 'Slovak', 'Slovenian', 'Somali', 'Spanish', 'Swahili', 'Swedish', 'Tamil', 'Tatar', 'Telugu', 'Thai', 'Turkish', 'Turkmen', 'Ukrainian', 'Urdu', 'Uyghur', 'Uzbek', 'Vietnamese', 'Welsh', 'Xhosa', 'Yoruba', 'Zulu'], 'codeSrc': 'ar'}, {'key': 'Assamese', 'options': ['Assamese', 'Afrikaans', 'Albanian', 'Arabic', 'Azerbaijani', 'Basque', 'Bengali', 'Bosnian', 'Bulgarian', 'Catalan', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Estonian', 'Finnish', 'French', 'Galician', 'Georgian', 'German', 'Gujarati', 'Haitian Creole', 'Hausa', 'Hebrew', 'Hindi', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish Gaelic', 'Italian', 'Japanese', 'Kannada', 'Kazakh', 'Khmer', 'Kinyarwanda', 'Korean', 'Kurdish (Kurmanji)', 'Kyrgyz', 'Lao', 'Latvian', 'Lithuanian', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Nepali', 'Norwegian', 'Odia (Oriya)', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala', 'Slovak', 'Slovenian', 'Somali', 'Spanish
const primaryLangSelectElem2 = document.getElementById("primary_lang2");
const secondaryLangSelectElem2 = document.getElementById("language4");
const primaryLangSelectElem = document.getElementById("primary_lang");
const secondaryLangSelectElem = document.getElementById("language6");
const primaryLangSelectElem1 = document.getElementById("language2");
function clearOptions(elem) {
var length = elem.options.length;
for (i = length - 1; i >= 0; i--) {
elem.options[i] = null;
}
}
function createOption2(elem, key) {
var option = document.createElement("option");
option.value = key;
option.innerHTML = key;
elem.appendChild(option);
}
function renderSecondaryLang(codeSrc) {
const selectedPrimaryObj = obj.find(
(item) => item.codeSrc === codeSrc
);
// selectedPrimaryObj.options.sort();
selectedPrimaryObj.options.map((lang) => {
createOption2(secondaryLangSelectElem, lang);
});
}
function renderSecondaryLang2(codeSrc) {
const selectedPrimaryObj = obj.find(
(item) => item.codeSrc === codeSrc
);
// selectedPrimaryObj.options.sort();
selectedPrimaryObj.options.map((lang) => {
createOption2(secondaryLangSelectElem2, lang);
});
}
const codeValue = primaryLangSelectElem.value;
const codeValue2 = primaryLangSelectElem2.value;
renderSecondaryLang(codeValue);
renderSecondaryLang2(codeValue2);
// primaryLangSelectElem1.addEventListener("change", (e) => {
// clearOptions(secondaryLangSelectElem);
// renderSecondaryLang(e.target.value);
// });
// $("#language2 option").val(function (idx, val) {
// $(this).siblings('[value="' + val + '"]').remove();
// });
var seen = {};
jQuery('#language2').children().each(function() {
var txt = jQuery(this).attr('value');
if (seen[txt]) {
jQuery(this).remove();
} else {
seen[txt] = true;
}
});
</script>
<script>
const primaryLangSelectElemScr = document.getElementById("cscript");
const primaryLangSelectElemLang = document.getElementById("language6");
const secondaryLangSelectElemScr = document.getElementById("language8");
const scriptObj = {
'Afrikaans': 'Latin', 'Albanian': 'Latin', 'Arabic': 'Arabic', 'Assamese': 'Bengali', 'Aymara': 'Latin', 'Azerbaijani': 'Latin', 'Bambara': 'Latin', 'Basque': 'Latin', 'Belarusian': 'Cyrillic', 'Bengali': 'Bengali', 'Bhojpuri': 'Devanagari', 'Bosnian': 'Latin', 'Bulgarian': 'Cyrillic', 'Catalan': 'Latin', 'Cebuano': 'Latin', 'Chichewa': 'Latin', 'Chinese (Simplified)': 'Hanji', 'Chinese (Traditional)': 'Hanji', 'Corsican': 'Latin', 'Croatian': 'Latin', 'Czech': 'Latin', 'Danish': 'Latin', 'Dogri': 'Devanagari', 'Dutch': 'Latin', 'English': 'Latin', 'Esperanto': 'Latin', 'Estonian': 'Latin', 'Ewe': 'Latin', 'Filipino': 'Latin', 'Finnish': 'Latin', 'French': 'Latin', 'Frisian': 'Latin', 'Galician': 'Latin', 'Ganda': 'Latin', 'Georgian': 'Georgian', 'German': 'Latin', 'Guarani': 'Latin', 'Gujarati': 'Gujarati', 'Haitian Creole': 'Latin', 'Hausa': 'Latin', 'Hebrew': 'Hebrew', 'Hindi': 'Devanagari', 'Hmong': 'Latin', 'Hungarian': 'Latin', 'Icelandic': 'Latin', 'Igbo': 'Latin', 'Iloko': 'Latin', 'Indonesian': 'Latin', 'Irish Gaelic': 'Latin', 'Italian': 'Latin', 'Japanese': 'Hanji', 'Javanese': 'Latin', 'Kannada': 'Kannada', 'Kazakh': 'Cyrillic', 'Khmer': 'Khmer', 'Kinyarwanda': 'Latin', 'Konkani': 'Devanagari', 'Korean': 'Hangul', 'Krio': 'Latin', 'Kurdish (Kurmanji)': 'Latin', 'Kurdish (Sorani)': 'Arabic', 'Kyrgyz': 'Cyrillic', 'Lao': 'Lao', 'Latin': 'Latin', 'Latvian': 'Latin', 'Lingala': 'Latin', 'Lithuanian': 'Latin', 'Luxembourgish': 'Latin', 'Macedonian': 'Cyrillic', 'Maithili': 'Devanagari', 'Malagasy': 'Latin', 'Malay': 'Latin', 'Malayalam': 'Malayalam', 'Maltese': 'Latin', 'Maori': 'Latin', 'Marathi': 'Devanagari', 'Mizo': 'Latin', 'Mongolian': 'Cyrillic', 'Nepali': 'Devanagari', 'Northern Sotho': 'Latin', 'Norwegian': 'Latin', 'Odia (Oriya)': 'Oriya', 'Oromo': 'Latin', 'Pashto': 'Arabic', 'Persian': 'Arabic', 'Polish': 'Latin', 'Portuguese': 'Latin', 'Punjabi': 'Gurmukhi', 'Quechua': 'Latin', 'Romanian': 'Latin', 'Russian': 'Cyrillic', 'Samoan': 'Latin', 'Sanskrit': 'Devanagari', 'Serbian': 'Cyrillic', 'Sesotho': 'Latin', 'Shona': 'Latin', 'Sindhi': 'Arabic', 'Sinhala': 'Sinhala', 'Slovak': 'Latin', 'Slovenian': 'Latin', 'Somali': 'Latin', 'Spanish': 'Latin', 'Sundanese': 'Latin', 'Swahili': 'Latin', 'Swedish': 'Latin', 'Tajik': 'Cyrillic', 'Tamil': 'Tamil', 'Tatar': 'Cyrillic', 'Telugu': 'Telugu', 'Thai': 'Thai', 'Tsonga': 'Latin', 'Turkish': 'Latin', 'Turkmen': 'Latin', 'Twi': 'Latin', 'Ukrainian': 'Cyrillic', 'Urdu': 'Arabic', 'Uyghur': 'Arabic', 'Uzbek': 'Latin', 'Vietnamese': 'Latin', 'Welsh': 'Latin', 'Xhosa': 'Latin', 'Yiddish': 'Hebrew', 'Yoruba': 'Latin', 'Zulu': 'Latin'}
const obj2 = [
{
key: "Devanagari",
options: ["Devanagari","Latin","Oriya","Malayalam","Telugu","Gujarati","Tamil", "Arabic", "Bengali", "Kannada", "Cyrillic"],
},
{
key: "Arabic",
options: ["Arabic","Latin", "Gurmukhi", "Devanagari", "Gujarati", "Cyrillic", "Kannada", "Telugu", "Tamil", "Malayalam", "Bengali", "Oriya"],
},
{
key: "Malayalam",
options: ["Malayalam","Latin","Devanagari","Kannada","Tamil", "Telugu"],
},
{
key: "Telugu",
options: ["Telugu","Latin","Devanagari","Kannada","Tamil", "Malayalam"],
},
{
key: "Bengali",
options: ["Bengali","Latin", "Kannada", "Tamil", "Telugu", "Malayalam"],
},
{
key: "Kannada",
options: ["Kannada","Latin", "Devanagari", "Tamil","Telugu","Malayalam", "Bengali", "Cyrillic", "Telugu", "Gujarati", "Gurmukhi", "Oriya"],
},
{key: "Hanji",
options: ["Hanji", "Latin", "Devanagari", "Arabic", "Gurmukhi", "Gujarati", "Oriya"]
},
{key: "Gurmukhi",
options: ["Gurmukhi","Latin", "Gujarati", "Oriya", "Arabic"]
},
{key: "Gujarati",
options: ["Gujarati","Latin","Devanagari", "Gurmukhi", "Oriya", "Arabic"]
},
{key: "Oriya",
options: ["Oriya","Latin","Devanagari", "Gujarati", "Gurmukhi"]
},
{key: "Kana",
options: ["Kana"]
},
{key: "Javanese",
options: ["Javanese"]
},
{key: "Hangul",
options: ["Hangul"]
},
{key: "Burmese",
options: ["Burmese"]
},
{key: "Thai",
options: ["Thai", "Latin"]
},
{key: "Sundanese",
options: ["Sundanese"]
},
{key: "Lao",
options: ["Lao"]
},
{key: "Amharic",
options: ["Amharic"]
},
{key: "Sinhala",
options: ["Sinhala", "Latin"]
},
{key: "Hebrew",
options: ["Hebrew", "Latin"],
},
{key: "Cyrillic",
options: ["Cyrillic","Latin", "Tamil", "Arabic"],
},
{key: "Armanian",
options: ["Armanian"]
},
{key: "Khmer",
options: ["Khmer"]
},
{key: "Georgian",
options: ["Georgian"]
},
{key: "Mongolian",
options: ["Mongolian", "Latin"]
},
{
key: "Tamil",
options: ["Tamil","Latin","Kannada","Telugu","Devanagari","Malayalam", "Cyrillic", "Gujarati", "Gurmukhi", "Bengali", "Oriya"],
},
{
key: "Latin",
options: ["Latin","Bengali", "Devanagari","Gurmukhi","Cyrillic","Gujarati","Malayalam","Oriya","Tamil","Telugu","Kannada", "Arabic"],
},
];
var obj33 = '{{language_pairs | escapejs}}'
function createOption3(elem, key) {
var option = document.createElement("option");
option.value = key;
option.innerHTML = key;
elem.appendChild(option);
}
function clearOptions(elem) {
var length = elem.options.length;
for (i = length - 1; i >= 0; i--) {
elem.options[i] = null;
}
}
primaryLangSelectElemLang.addEventListener("change", (e) => {
if(document.getElementById('primary_lang2a').value== document.getElementById('language4').value && document.getElementById('primary_langa').value== document.getElementById('language6').value ){
console.log("i am in situation 1 ");
primaryLangSelectElemScr.value = document.getElementById('primary_script').value
document.getElementById('lang_script').innerHTML = document.getElementById('primary_script').value
console.log(document.getElementById('primary_script').value);
}else{
console.log("i am in situation 2");
primaryLangSelectElemScr.value = getKeyByValue(scriptObj,e.target.value)
document.getElementById('lang_script').innerHTML = getKeyByValue(scriptObj,e.target.value)
}
const selectedPrimaryObj2 = obj2.find(
(item) => item.key === primaryLangSelectElemScr.value
);
clearOptions(secondaryLangSelectElemScr)
selectedPrimaryObj2.options.map((lang) => {
createOption3(secondaryLangSelectElemScr, lang);
});
});
function getKeyByValue(object, value) {
return Object.values(object).find(key => object[value] === key);
}
$('#submitForm').on('click',function(){
if(document.getElementById('primary_lang2a').value== document.getElementById('language4').value && document.getElementById('primary_langa').value== document.getElementById('language6').value && document.getElementById('language8').value == document.getElementById('primary_script').value){
alert("your file wont change at all")
return false
}
}
)
const actionlineLangSelector = document.getElementById("language4");
const actionlinescript = document.getElementById("actionscript");
const actionline_Dest_Script = document.getElementById("language80");
actionlineLangSelector.addEventListener("change", (e) => {
if(document.getElementById('primary_lang2a').value== document.getElementById('language4').value && document.getElementById('primary_langa').value== document.getElementById('language6').value ){
console.log("i am in situation 1 ");
actionlinescript.value = document.getElementById('secondary_script').value
document.getElementById('lang_script200').innerHTML = document.getElementById('secondary_script').value
console.log(document.getElementById('secondary_script').value);
}else{
console.log("i am in situation 2");
actionlinescript.value = getKeyByValue(scriptObj,e.target.value)
document.getElementById('lang_script200').innerHTML = getKeyByValue(scriptObj,e.target.value)
}
const selectedPrimaryObj23 = obj2.find(
(item) => item.key === actionlinescript.value
);
clearOptions(actionline_Dest_Script)
selectedPrimaryObj23.options.map((lang) => {
createOption3(actionline_Dest_Script, lang);
});
});
function getKeyByValue(object, value) {
return Object.values(object).find(key => object[value] === key);
}
$('#submitForm').on('click',function(){
if(document.getElementById('primary_lang2a').value== document.getElementById('language4').value && document.getElementById('primary_langa').value== document.getElementById('language6').value && document.getElementById('language8').value == document.getElementById('primary_script').value){
alert("your file wont change at all")
return false
}
}
);
function displayFileName(e) {
const fileInput = document.getElementById("con_file");
const file = fileInput.files[0];
if (file) {
sessionStorage.setItem("fileName", file.name);
}
}
document.addEventListener("DOMContentLoaded", function () {
const filenameDiv = document.getElementById("file_name");
const fileName = sessionStorage.getItem("fileName");
if (fileName) {
filenameDiv.textContent += fileName;
sessionStorage.removeItem("fileName");
}
});
</script>
{%else%}
<h3 style="position:absolute; left:20%;top:20%;width:60%;text-align:center;">
{% trans 'You need to ' %}<a href="{% url 'payment' %}">
{% trans 'claim your privilege' %} </a>
&nbsp;{% trans 'to use this service.' %}</h3>
{% endif%}
{% endblock %}