fix bugs en reports

parent cc96be5e
......@@ -106,8 +106,7 @@
{% endblock %}
{% block sidebar %}
{% include 'administration_aside.html' %}
<!-- form-group-->
{% include 'administration_aside.html' %}
{% endblock %}
{% block user %}
......@@ -141,30 +140,33 @@
<td>{{ user.first_name }}</td>
<td>{{ user.last_name }}</td>
<td>{{ user.email }}</td>
<form method="post" action="../update/">
<form method="post" action="../update/">
{% csrf_token %}
<input type="hidden" name="request_path" value="{{ request.path }}">
<input type="hidden" name="user_id" value="{{ user.user_id }}">
<td>
<input type="checkbox" name="is_active" value="1"
{% if user.status == True %}checked{% endif %}>
{% csrf_token %}
<input type="hidden" name="request_path" value="{{ request.path }}">
<input type="hidden" name="user_id" value="{{ user.user_id }}">
<td>
<input type="checkbox" name="is_active" value="1"
{% if user.status == True %}checked{% endif %}>
</td>
<td>
<input type="checkbox" name="is_staff" value="1"
{% if user.staff == True %}checked{% endif %}>
</td>
<td>
<input type="checkbox" name="is_superuser" value="1"
{% if user.superuser == True %}checked{% endif %}>
</td>
<td>
<button title="save" type="submit" class="btn btn-success"><i class="fa fa-save"></i></button>
<!--a href="#" class="btn btn-danger"><i class="fa fa-trash"></i></a-->
</td>
</form>
</tr>
</td>
<td>
<input type="checkbox" name="is_staff" value="1"
{% if user.staff == True %}checked{% endif %}>
</td>
<td>
<input type="checkbox" name="is_superuser" value="1"
{% if user.superuser == True %}checked{% endif %}>
</td>
<td>
<button title="save" type="submit" class="btn btn-success"><i
class="fa fa-save"></i></button>
<a href="#" class="btn btn-info" title="View profile"><i
class="fa fa-user-circle"></i></a>
</td>
</form>
</tr>
{% endfor %}
</tbody>
</table>
......
from django.contrib import messages
from django.contrib.auth.models import User
from django.db.models import Count
from django.shortcuts import render, redirect
import json
from django.http import HttpResponse, HttpResponseRedirect, HttpRequest
......@@ -7,8 +8,18 @@ from PIL import Image
# Create your views here.
from catalog.models import Purchase
def Dashboard(request):
return render(request, 'dashboard.html', {"Viewname": "Dashboard"})
data =[]
compras = Purchase.objects.filter(purchased=True)
total = compras.count()
data.append({
"Total_compras": total ,
})
print(total)
return render(request, 'dashboard.html', {"Viewname": "Dashboard","Datos":data})
# ----------------------------------------------------------
......
......@@ -210,8 +210,7 @@
<div class="col-lg-10 col-md-9 col-xs-10 col-lg-offset-1" id="showImage">
<img onclick="window.open(this.src)" class="img-responsive" id="satImage"
width="400"
height="400px" src="../../static/reports/tmpImages/repsat_test_dev/
{{ IMAGE_PATH }}{{ dafaultLabel }}_TCI_60m.jpg"
height="400px" src="../../static/reports/tmpImages/repsat_test_dev/{{ IMAGE_PATH }}{{ dafaultLabel }}_TCI_60m.jpg"
style="margin-left: auto; margin-right: auto; display: block;">
</div>
<div class="col-lg-1 col-md-1 col-xs-1 next" style="display: none">
......@@ -289,6 +288,7 @@
maintainAspectRatio: false,
// scales: { xAxes: [{ stacked: true }], yAxes: [{ stacked: true }] },
};
console.log(config);
{% endautoescape %}
// Creamos una gráfica con los datos al macenados en config
var ctx = document.getElementById('myChart').getContext('2d');
......@@ -329,12 +329,13 @@
// $(".next").hide();
// $(".prev").hide();
// $("#showImage").addClass('col-lg-offset-1');
playImages = setInterval(() = > {
next();
},
4000
)
;
playImages = setInterval(function(){ next(); }, 4000);
{# playImages = setInterval(() = > {#}
{# next();#}
{# },#}
{# 4000#}
{# )#}
{# ;#}
}
function stop() {
......
......@@ -33,6 +33,7 @@ def report_L2ASCL(request, report, purchase_id):
reporteDir = report.replace('_sclData','')
image_path = request.user.email + "/" + purchase_id + "/" + "out/"+reporteDir+"/TCI/thumbnails/"
print(image_path)
absolute_path = USERS_PATH + request.user.email + "/" + purchase_id + "/out"
folders = os.listdir(path=absolute_path)
json_route= USERS_PATH + request.user.email + "/" + purchase_id + "/"
......
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