220 lines
9.4 KiB
HTML
Executable File
220 lines
9.4 KiB
HTML
Executable File
<!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.0">
|
|
<title>My Next Film | Manually Assign Task</title>
|
|
<style>
|
|
#delete-button{
|
|
background-color: red;
|
|
|
|
}
|
|
#delete-button a{
|
|
color:white;
|
|
text-decoration:none;
|
|
}
|
|
#cancelit{
|
|
background-color: green;
|
|
}
|
|
|
|
|
|
</style>
|
|
</head>
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
|
|
<body>
|
|
<div id="multilingual">
|
|
<div id="example_wrapper" class="dataTables_wrapper" style="padding: 5%;">
|
|
<table id="example" class="display" style="width:100%;">
|
|
<thead>
|
|
<tr>
|
|
<th>Task ID</th>
|
|
<th>User Note</th>
|
|
<th>Assigned LPP</th>
|
|
<th>Date At</th>
|
|
<th>Status</th>
|
|
<th>Generated From</th>
|
|
<th>Source Language</th>
|
|
<th>Target Language</th>
|
|
<th>Source File</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% if data %}
|
|
{% for i in data %}
|
|
{% if i.translated_script %}
|
|
<tr>
|
|
<td> {{i.task_id}}</td>
|
|
<td>{{i.usernote}}</td>
|
|
{% if i.status == "dialogue_lppassigned" or i.status == "dialogue_inprogress" %}
|
|
<td>{{i.assignedlpp_dialogue.first_name}} {{i.assignedlpp_dialogue.last_name}}</td>
|
|
{% elif i.status == "actionline_lppassigned" or i.status == "actionline_inprogress" %}
|
|
<td>{{i.assignedlpp_action.first_name}} {{i.assignedlpp_action.last_name}}</td>
|
|
{% else %}
|
|
<td>None Assigned</td>
|
|
{% endif %}
|
|
<td>{{i.date_at}}</td>
|
|
<td>{{i.status}}</td>
|
|
<td>{{i.generated_from}}</td>
|
|
<td>{{i.translated_script.nondial_src_language}} (Actionline), {{i.translated_script.dial_src_language}} (Dialogues)</td>
|
|
<td>{{i.translated_script.nondial_dest_language}} (Actionline), {{i.translated_script.dial_dest_language}} (Dialogues)</td>
|
|
{% if i.generated_from == "subtitling" %}
|
|
<td>Yet to be filled</td>
|
|
{% elif i.generated_from == "onepager" %}
|
|
<td>Yet to be filled</td>
|
|
{% elif i.generated_from == "translate_srt" %}
|
|
<td>Yet to be filled</td>
|
|
{% else %}
|
|
<td><a href="../../../media/{{i.translated_script.script_title}}" download>Click to download Script</a></td>
|
|
{% endif %}
|
|
<td style="display:flex">
|
|
<button onclick="assign_task('{{i.task_id}}', '{{lpp_id}}')" style="margin-left:5px">Assign This Task</button>
|
|
</td>
|
|
</tr>
|
|
{% elif i.translated_ppt %}
|
|
<tr style="background-color:rgb(243, 227, 223)">
|
|
<td> {{i.task_id}}</td>
|
|
<td>{{i.usernote}}</td>
|
|
{% if i.status == "dialogue_lppassigned" or i.status == "dialogue_inprogress" %}
|
|
<td>{{i.assignedlpp_dialogue.first_name}} {{i.assignedlpp_dialogue.last_name}}</td>
|
|
{% else %}
|
|
<td>None Assigned</td>
|
|
{% endif %}
|
|
<td>{{i.date_at}}</td>
|
|
<td>{{i.status}}</td>
|
|
<td>{{i.generated_from}}</td>
|
|
<td>{{i.translated_ppt.source_lang}}<b>(PPT)</b></td>
|
|
<td>{{i.translated_ppt.target_lang}}<b>(PPT)</b></td>
|
|
{% if i.generated_from == "subtitling" %}
|
|
<td>Yet to be filled</td>
|
|
{% elif i.generated_from == "onepager" %}
|
|
<td>Yet to be filled</td>
|
|
{% elif i.generated_from == "translate_srt" %}
|
|
<td>Yet to be filled</td>
|
|
{% else %}
|
|
<td><a href="../../../media/{{i.translated_ppt.upload_ppt}}" download>Click to download PPT</a></td>
|
|
{% endif %}
|
|
<td style="display:flex">
|
|
<button onclick="assign_task('{{i.task_id}}','{{lpp_id}}')" style="margin-left:5px">Assign This Task</button>
|
|
</td>
|
|
</tr>
|
|
{% elif i.translated_subtitle %}
|
|
<tr style="background-color:rgb(191, 128, 255)">
|
|
<td> {{i.task_id}}</td>
|
|
<td>{{i.usernote}}</td>
|
|
{% if i.status == "subtitle_lppassigned" or i.status == "subtitle_vetting_inprogress" %}
|
|
<td>{{i.assignedlpp_dialogue.first_name}} {{i.assignedlpp_dialogue.last_name}}</td>
|
|
{% else %}
|
|
<td>None Assigned</td>
|
|
{% endif %}
|
|
<td>{{i.date_at}}</td>
|
|
<td>{{i.status}}</td>
|
|
<td>{{i.generated_from}}</td>
|
|
<td>{{i.translated_subtitle.subtitles_id.src_languages.language}} <b>(Subtitle)</b></td>
|
|
{% if i.translated_subtitle.tar_languages and i.translated_subtitle.tar_languages.language != i.translated_subtitle.subtitles_id.src_languages.language %}
|
|
<td>{{i.translated_subtitle.tar_languages.language}} <b>(Subtitle)</b></td>
|
|
{% else %}
|
|
<td>N/A</td>
|
|
{% endif %}
|
|
<td><a href="../../../media/{{i.translated_subtitle.subtitles_id.src_video}}" download>Click to download Video</a></td>
|
|
<td style="display:flex">
|
|
<button onclick="assign_task('{{i.task_id}}', '{{lpp_id}}')" style="margin-left:5px">Assign This Task</button>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
|
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
// Setup - add a text input to each footer cell
|
|
$('#example tfoot th').each( function () {
|
|
var title = $('#example thead th').eq( $(this).index() ).text();
|
|
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
|
|
} );
|
|
|
|
// DataTable
|
|
var table = $('#example').DataTable( {
|
|
stateSave: true
|
|
} );
|
|
|
|
// Restore state
|
|
var state = table.state.loaded();
|
|
if ( state ) {
|
|
table.columns().eq( 0 ).each( function ( colIdx ) {
|
|
var colSearch = state.columns[colIdx].search;
|
|
|
|
if ( colSearch.search ) {
|
|
$( 'input', table.column( colIdx ).footer() ).val( colSearch.search );
|
|
}
|
|
} );
|
|
|
|
table.draw();
|
|
}
|
|
|
|
|
|
// Apply the search
|
|
table.columns().eq( 0 ).each( function ( colIdx ) {
|
|
$( 'input', table.column( colIdx ).footer() ).on( 'keyup change', function () {
|
|
table
|
|
.column( colIdx )
|
|
.search( this.value )
|
|
.draw();
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
<!-- <script>-->
|
|
<!-- $(document).ready(function() {-->
|
|
<!-- $('#example').DataTable({-->
|
|
<!-- "pagingType": "full_numbers"-->
|
|
<!-- });-->
|
|
<!-- });-->
|
|
|
|
<!-- function deleteRow(btn) {-->
|
|
<!-- var row = btn.parentNode.parentNode;-->
|
|
<!-- row.parentNode.removeChild(row);-->
|
|
<!-- }-->
|
|
|
|
<!-- // ///////////////-->
|
|
<!-- $(".button").on("click", function() {-->
|
|
<!-- $('input:checked').not('.all').parents("tr").remove();-->
|
|
<!-- });-->
|
|
<!-- $('.all').on('click', function() {-->
|
|
<!-- var $inputs = $('table').find('input');-->
|
|
<!-- $inputs.prop('checked', 'checked');-->
|
|
<!-- });-->
|
|
<!-- </script>-->
|
|
<script>
|
|
function assign_task(task, lpp){
|
|
console.log(task);
|
|
console.log(lpp);
|
|
var lpp1 = lpp;
|
|
console.log(lpp1);
|
|
url1 = '{% url "manualassign" 0 %}'.replace('0', lpp1);
|
|
$.ajax({
|
|
type:"POST",
|
|
url:url1,
|
|
data:{
|
|
'task':task,
|
|
'lpp':lpp,
|
|
csrfmiddlewaretoken: '{{ csrf_token }}'
|
|
|
|
|
|
},
|
|
success:function(response){
|
|
console.log("Raaaan successfully");
|
|
window.location.href = url1;
|
|
}
|
|
});
|
|
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |