From 748516edaf1cafd7d87a309c0b6093678d11eabf Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 6 Jul 2023 17:49:54 +0200 Subject: [PATCH] example of repair manuals --- .../modules/did/templates/anonymous.html | 3 --- .../modules/did/templates/operator.html | 21 +++++++++++++++++++ ereuse_devicehub/modules/did/views.py | 4 +++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/modules/did/templates/anonymous.html b/ereuse_devicehub/modules/did/templates/anonymous.html index 9eeb5898..b2efdadc 100644 --- a/ereuse_devicehub/modules/did/templates/anonymous.html +++ b/ereuse_devicehub/modules/did/templates/anonymous.html @@ -65,9 +65,6 @@
- {% for m in manuals.ifixit %} - {{ m }}
- {% endfor %}
diff --git a/ereuse_devicehub/modules/did/templates/operator.html b/ereuse_devicehub/modules/did/templates/operator.html index d472450a..fff3018c 100644 --- a/ereuse_devicehub/modules/did/templates/operator.html +++ b/ereuse_devicehub/modules/did/templates/operator.html @@ -223,6 +223,27 @@
+
+
+
Repair manuals
+
+
+ {% for m in manuals.ifixit %} +
+ {% if m.image %} + + {% endif %} + {% if m.url %} + {{ m.title }}
+ {% else %} + {{ m.title }}
+ {% endif %} +
+ {% endfor %} +
+
+
+
diff --git a/ereuse_devicehub/modules/did/views.py b/ereuse_devicehub/modules/did/views.py index 6b3f992e..bd7e0ab5 100644 --- a/ereuse_devicehub/modules/did/views.py +++ b/ereuse_devicehub/modules/did/views.py @@ -1,3 +1,5 @@ +import json + import flask import requests from ereuseapi.methods import API @@ -191,7 +193,7 @@ class DidView(View): def get_manuals(self): params = { "manufacturer": 'HP' or self.device.manufacturer, - "model": self.device.model, + "model": 'Pavilion dv6000' or self.device.model, } self.params = json.dumps(params) manuals = {'ifixit': {}, 'icecat': {}}