websegura/_includes/details.njk
2021-02-15 12:15:32 +01:00

72 lines
2.4 KiB
Plaintext

{% macro details(web, results, history, path, type, parent, location) %}
<p id="breadcumbs">
<a href="/">España</a>{% if type %} - <a href="/{{ type }}/{{ parent }}">{{ location.name }}</a>{% endif %} - {{ web.name }}</p>
<h1>{{ web.name }}</h1>
<div id="score" class="{{ results | color }}">{% if results.tests_passed < 5 %}☠️{% else %}{{ results.grade }}{% endif %}</div>
<h2>🔎 Resultado del análisis</h2>
<ul>
<li><strong>Nombre:</strong> {{ web.name }}</li>
<li><strong>Dirección:</strong> <a href="https://{{ web.url }}">{{ web.url }}</a></li>
{% if web.twitter %}<li><strong>Twitter:</strong> <a href="https://twitter.com/{{ web.twitter }}">@{{ web.twitter }}</a></li>{% endif %}
{% if type %}
<li><strong>Ubicación:</strong> <a href="/{{ type }}/{{ parent }}">{{ location.name }}</a></li>
{% endif %}
<li><strong>Puntuación:</strong> {{ results.score }}/100</li>
{% if web.tags %}
<li class="icon-list">🏷️
{% for tag in web.tags %}
<a href="/l/{{ tag }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</li>
{% endif %}
</ul>
<p>
{{ results | abbr }}.<br >
<a href="https://observatory.mozilla.org/analyze/{{ web.url }}">🖥 Leer el informe técnico completo.</a>
</p>
{% if (web.twitter) and (results.score < 70) %}
<p><a class="twitter-share-button" href="https://twitter.com/intent/tweet/?text={{ 'Hola @' + web.twitter + '
🔒 La seguridad de vuestra web y usuarios puede ser comprometida si no actualizáis vuestras conexiones seguras (HTTPS).
⚠️ ¡Por favor, revisadlo cuanto antes!
https://websegura.pucelabits.org'| urlEncode }}{{ path | urlEncode }}{{ '?pk_campaign=HazseloSaber&pk_source=twitter
#websegura /vía @PucelaBits' | urlEncode }}" target="_blank" rel="noopener" aria-label="Twitter">
<span class="icon brands fa-twitter">
<span><strong>¡Házselo saber en Twitter!</strong></span>
</a></p>
{% endif %}
<h2 id="historial">🕐 Historial</h2>
<table>
<thead>
<tr>
<th id="nota">Nota</th>
<th id="nota">Puntuación</th>
<th id="fecha">Fecha</th>
</tr>
</thead>
<tbody>
{% for h in history | sort(reverse=true, attribute="end_time_unix_timestamp") %}
<tr class="{{ h | color }}">
<td>{{ h.grade }}</td>
<td>{{ h.score }}/100</td>
<td>{{ h.end_time }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p><small>🔄 Última actualización: {{ results.end_time }}</small></p>
{% endmacro %}