Skip to content

Commit bf75fc0

Browse files
authored
Merge pull request #2 from TheJolman/ui
fixed image hiding
2 parents f4e56ce + b44a2c3 commit bf75fc0

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

spotify/templates/spotify/rate.html

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,23 @@ <h3>
4646
❓/ 100
4747
{% endif %}
4848
</h3>
49-
<br>
50-
<img id="HideImg"
51-
src="{{ reaction }}"
52-
alt="Rating reaction"
53-
onerror="hideImg()"
54-
width="65%"
55-
height="70%">
56-
<p>{{ description }}</p>
49+
{% if reaction %}
50+
<br>
51+
<img src="{{ reaction }}" alt="Rating reaction" width="65%" height="70%">
52+
<p>{{ description }}</p>
53+
{% endif %}
5754
</div>
5855
{% endif %}
5956
</div>
6057
<div class="col">
6158
<div class="image-container">
6259
<br>
63-
<h5>{{ name }}</h5>
64-
<img id="HideImg2"
65-
src="{{ image }}"
66-
alt="Music artwork"
67-
onerror="hideImg2()"
68-
width="300"
69-
height="300">
60+
{% if image %}
61+
<h5>{{ name }}</h5>
62+
<img src="{{ image }}" alt="Music artwork" width="300" height="300">
63+
{% endif %}
7064
</div>
7165
</div>
7266
</div>
7367
</div>
7468
{% endblock content %}
75-
{% block extra_js %}
76-
<script>
77-
function hideImg() {
78-
document.getElementById("HideImg").style.display = "none";
79-
}
80-
81-
function hideImg2() {
82-
document.getElementById("HideImg2").style.display = "none";
83-
}
84-
</script>
85-
{% endblock extra_js %}

0 commit comments

Comments
 (0)