do not link machine if no url present

This commit is contained in:
Tomáš Mládek 2020-07-15 15:43:24 +02:00
parent cabe3baeb1
commit 41c1f38cdb

View file

@ -63,22 +63,30 @@
VPS STATS — {{ vps_stats|safe }} VPS STATS — {{ vps_stats|safe }}
</section> </section>
{% for machine in machines %} {% for machine in machines %}
<a class="machine box status-{{ machine.status }}" href="{{ machine.url|default:"#" }}"> {% if machine.url %}
<section class="box-content"> <a class="machine box status-{{ machine.status }}" href="{{ machine.url }}">
{% if machine.image_url %} {% else %}
<img src="{{ machine.image_url }}" alt="image for {{ machine.short_name }}"/> <div class="machine box status-{{ machine.status }}">
{% endif %} {% endif %}
<div class="label"> <section class="box-content">
<h3>{{ machine.short_name }}</h3> {% if machine.image_url %}
{% if machine.description %} <img src="{{ machine.image_url }}" alt="image for {{ machine.short_name }}"/>
<p class="description">{{ machine.description }}</p> {% endif %}
{% endif %} <div class="label">
</div> <h3>{{ machine.short_name }}</h3>
</section> {% if machine.description %}
<section class="status" title="Last ping at: {{ machine.last_ping|default:"UNKNOWN" }}"> <p class="description">{{ machine.description }}</p>
STATUS: {{ machine.status }} {% endif %}
</section> </div>
</section>
<section class="status" title="Last ping at: {{ machine.last_ping|default:"UNKNOWN" }}">
STATUS: {{ machine.status }}
</section>
{% if machine.url %}
</a> </a>
{% else %}
</div>
{% endif %}
{% endfor %} {% endfor %}
</section> </section>
{% endif %} {% endif %}