cambio de tipo de tabla, filtro de busqueda, paginación

parent d8aaa25e
...@@ -9,7 +9,9 @@ function refresh() { ...@@ -9,7 +9,9 @@ function refresh() {
dataType: "json", dataType: "json",
url: '../reports/ws/process_progress', url: '../reports/ws/process_progress',
success: function (data) { success: function (data) {
$.each(data, function (key, val) { $.each(data, function (key, val) {
console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
if (val.progress != 100) { if (val.progress != 100) {
$('#progress_bar' + val.purchase_id).attr("aria-valuenow", val.progress); $('#progress_bar' + val.purchase_id).attr("aria-valuenow", val.progress);
$('#progress_bar' + val.purchase_id).attr('style', 'width:' + val.progress + '%'); $('#progress_bar' + val.purchase_id).attr('style', 'width:' + val.progress + '%');
...@@ -43,54 +45,52 @@ $(function () { ...@@ -43,54 +45,52 @@ $(function () {
$(document).ready(function () { $(document).ready(function () {
$('#example').DataTable $('#example').DataTable
({ ({
language: language:
{
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate":
{ {
"sProcessing": "Procesando...", "sFirst": "Primero",
"sLengthMenu": "Mostrar _MENU_ registros", "sLast": "Último",
"sZeroRecords": "No se encontraron resultados", "sNext": "Siguiente",
"sEmptyTable": "Ningún dato disponible en esta tabla", "sPrevious": "Anterior"
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate":
{
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria":
{
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
}, },
responsive: "oAria":
{ {
details: "sSortAscending": ": Activar para ordenar la columna de manera ascendente",
{ "sSortDescending": ": Activar para ordenar la columna de manera descendente"
type: 'column', }
target: 'tr' },
} responsive:
}, {
columnDefs: details:
[{ {
className: 'control', type: 'column',
orderable: false, target: 'tr'
targets: 0 }
}], },
order: [1, 'asc'] columnDefs:
}); [{
}); className: 'control',
orderable: false,
targets: 0
}],
order: [1, 'asc']
});
});
$(function () { $(function () {
......
...@@ -96,16 +96,19 @@ def Reports(request): ...@@ -96,16 +96,19 @@ def Reports(request):
##################################################### #####################################################
# progress bar # # progress bar #
##################################################### #####################################################
if 'Linking Products...' in open(log_info).read(): if os.stat(log_info).st_size == 0:
progress = 20 progress = 0
if 'Merging Images...' in open(log_info).read(): else:
progress = 40 if 'Linking Products...' in open(log_info).read():
if 'Deleting Images...' in open(log_info).read(): progress = 20
progress = 50 if 'Merging Images...' in open(log_info).read():
if 'Extracting SCL information...' in open(log_info).read(): progress = 40
progress = 60 if 'Deleting Images...' in open(log_info).read():
if 'Finalizing...' in open(log_info).read(): progress = 50
progress = 100 if 'Extracting SCL information...' in open(log_info).read():
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
with open(log_info, 'r') as myfile: with open(log_info, 'r') as myfile:
log = myfile.read().replace('\n', '') log = myfile.read().replace('\n', '')
...@@ -129,7 +132,10 @@ def Reports(request): ...@@ -129,7 +132,10 @@ def Reports(request):
"progress": progress, "progress": progress,
"log_info": log, "log_info": log,
}) })
size = 0
final_size = 0
log_info = ""
progress = 0
############################################## ##############################################
# paginacion # # paginacion #
############################################## ##############################################
...@@ -154,21 +160,28 @@ def wsProcessProgress(request): ...@@ -154,21 +160,28 @@ def wsProcessProgress(request):
##################################################### #####################################################
# progress bar # # progress bar #
##################################################### #####################################################
if 'Linking Products...' in open(log_info).read(): if os.stat(log_info).st_size == 0:
progress = 20 progress = 0
if 'Merging Images...' in open(log_info).read(): else:
progress = 40 if 'Linking Products...' in open(log_info).read():
if 'Deleting Images...' in open(log_info).read(): progress = 20
progress = 50 if 'Merging Images...' in open(log_info).read():
if 'Extracting SCL information...' in open(log_info).read(): progress = 40
progress = 60 if 'Deleting Images...' in open(log_info).read():
if 'Finalizing...' in open(log_info).read(): progress = 50
progress = 100 if 'Extracting SCL information...' in open(log_info).read():
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
productList2.append({ productList2.append({
"purchase_id": producto['id'], "purchase_id": producto['id'],
"progress": progress, "progress": progress,
}) })
progress = 0
log_info = ""
return HttpResponse(json.dumps(productList2)) return HttpResponse(json.dumps(productList2))
else: else:
raise Http404 raise Http404
......
...@@ -2,114 +2,115 @@ ...@@ -2,114 +2,115 @@
{% load static %} {% load static %}
{% block headMedia %} {% block headMedia %}
<link rel="stylesheet" href="{% static 'catalog/css/login.css'%}" type="text/css"> <link rel="stylesheet" href="{% static 'catalog/css/login.css' %}" type="text/css">
{% endblock %} {% endblock %}
{% block budy %} {% block budy %}
<div class="visible-lg-block visible-md-block"> <div class="visible-lg-block visible-md-block">
<video id="bgvid" playsinline autoplay muted loop poster="{% static 'images/poster.jpg'%}" > <video id="bgvid" playsinline autoplay muted loop poster="{% static 'images/poster.jpg' %}">
<!-- WCAG general accessibility recommendation is that media such as background video play through only once. Loop turned on for the purposes of illustration; if removed, the end of the video will fade in the same way created by pressing the "Pause" button --> <!-- WCAG general accessibility recommendation is that media such as background video play through only once. Loop turned on for the purposes of illustration; if removed, the end of the video will fade in the same way created by pressing the "Pause" button -->
<source src="{% static 'catalog/images/background.mp4'%}" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <source src="{% static 'catalog/images/background.mp4' %}"
<source src="{% static 'catalog/images/background.ogv'%}" type='video/ogg; codecs="theora, vorbis"' /> type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'/>
<source src="{% static 'catalog/images/background.webm'%}" type='video/webm; codecs="vp8, vorbis"' /> <source src="{% static 'catalog/images/background.ogv' %}" type='video/ogg; codecs="theora, vorbis"'/>
<source src="{% static 'catalog/images/background.webm' %}" type='video/webm; codecs="vp8, vorbis"'/>
</video>
</div> </video>
</div>
<div class="login-box">
<!-- /.login-logo --> <div class="login-box">
<div class="login-box-body"> <!-- /.login-logo -->
<div class="login-logo"> <div class="login-box-body">
<div class="login-logo">
<img src="{% static 'catalog/images/geoint_med.png' %}" width="256px"/> <img src="{% static 'catalog/images/geoint_med.png' %}" width="256px"/>
<br> <br>
<b><span>Rep</span>Sat</b> <b><span>Rep</span>Sat</b>
</div> </div>
<p class="login-box-msg"> <p class="login-box-msg">
{% if form.errors %} {% if form.errors %}
<p>Your username and password didn't match. Please try again.</p> <p>Your username and password didn't match. Please try again.</p>
{% endif %} {% endif %}
{% if next %} {% if next %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed, please login with an account that has access.</p> <p>Your account doesn't have access to this page. To proceed, please login with an account that has
{% else %} access.</p>
<p>Favor de firmarse para tener acceso.</p> {% else %}
{% endif %} <p>Favor de firmarse para tener acceso.</p>
{% endif %} {% endif %}
</p> {% endif %}
</p>
<form role="form" method="post" action="{% url 'login' %}">
{% csrf_token %} <form role="form" method="post" action="{% url 'login' %}">
<div class="form-group has-feedback"> {% csrf_token %}
<!-- <input type="text" class="form-control" placeholder="username">--> <div class="form-group has-feedback">
<input class="form-control" placeholder="nombre de usuario" name="{{ form.username.name }}" type="{{ form.username.class.name}}" id="{{ form.username.auto_id }}" autofocus> <!-- <input type="text" class="form-control" placeholder="username">-->
<span class="glyphicon glyphicon-envelope form-control-feedback"></span> <input class="form-control" placeholder="nombre de usuario" name="{{ form.username.name }}"
</div> type="{{ form.username.class.name }}" id="{{ form.username.auto_id }}" autofocus>
<div class="form-group has-feedback"> <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
<!-- <input type="password" class="form-control" placeholder="assword">--> </div>
<input class="form-control" placeholder="contraseña" name="{{ form.password.name }}" type="password" id="{{ form.password.auto_id }}" autofocus> <div class="form-group has-feedback">
<span class="glyphicon glyphicon-lock form-control-feedback"></span> <!-- <input type="password" class="form-control" placeholder="assword">-->
</div> <input class="form-control" placeholder="contraseña" name="{{ form.password.name }}" type="password"
<div class="row"> id="{{ form.password.auto_id }}" autofocus>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
<!-- /.col --> </div>
<div class="col-xs-12"> <div class="row">
<button type="submit" class="btn btn-primary btn-block btn-flat btnGeo">Login</button>
</div> <!-- /.col -->
<!-- /.col --> <div class="col-xs-12">
</div> <button type="submit" class="btn btn-primary btn-block btn-flat btnGeo">Login</button>
</form> </div>
<!-- /.col -->
</div>
<br> </form>
<a href="#">I forgot my password</a><br>
<a href="register.html" class="text-center">Register a new membership</a>
<br>
</div> <a href="#">I forgot my password</a><br>
<!-- /.login-box-body --> <a href="register.html" class="text-center">Register a new membership</a>
</div>
<!-- /.login-box --> </div>
<!-- /.login-box-body -->
<div class="row geointInfo" > </div>
<!-- /.login-box -->
<div class="col-md-12">
<div class="row geointInfo">
<a href="http://www.centrogeo.org.mx/">© 2018 Centro de Investigación en Ciencias de Información Geoespacial</a>
<div class="col-md-12">
</div>
<a href="http://www.centrogeo.org.mx/">© 2018 Centro de Investigación en Ciencias de Información
</div> Geoespacial</a>
</div>
</div>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script> <script>
var vid = document.getElementById("bgvid"); var vid = document.getElementById("bgvid");
if (window.matchMedia('(prefers-reduced-motion)').matches) if (window.matchMedia('(prefers-reduced-motion)').matches) {
{ vid.removeAttribute("autoplay");
vid.removeAttribute("autoplay"); vid.pause();
vid.pause(); pauseButton.innerHTML = "Paused";
pauseButton.innerHTML = "Paused"; }
}
function vidFade() function vidFade() {
{ vid.classList.add("stopfade");
vid.classList.add("stopfade"); }
}
vid.addEventListener('ended', function() vid.addEventListener('ended', function () {
{ // only functional if "loop" is removed
// only functional if "loop" is removed vid.pause();
vid.pause(); // to capture IE10
// to capture IE10 vidFade();
vidFade(); });
});
</script>
</script>
{% endblock %} {% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment