fix bugs en reports

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