example of repair manuals

This commit is contained in:
Cayo Puigdefabregas 2023-07-06 17:49:54 +02:00
parent 5e3af04a8c
commit 748516edaf
3 changed files with 24 additions and 4 deletions

View File

@ -65,9 +65,6 @@
<div class="card">
<div class="card-body">
{% for m in manuals.ifixit %}
{{ m }}<br />
{% endfor %}
<h3 class="nav-link mt-5" style="color: #993365">{{ device_real.type }} - {{ device_real.verbose_name }}</h3>
<div class="row">
<div class="col-12">

View File

@ -223,6 +223,27 @@
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<h5 class="card-title">Repair manuals</h5>
<div class="row">
<div class="list-group col">
{% for m in manuals.ifixit %}
<div class="list-group-item d-flex align-items-center">
{% if m.image %}
<img style="max-width: 100px; margin-right: 15px;" src="{{ m.image }}" />
{% endif %}
{% if m.url %}
<a href="{{ m.url }}" target="_blank">{{ m.title }}</a><br />
{% else %}
{{ m.title }}<br />
{% endif %}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -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': {}}