/
view.html
46 lines (40 loc) · 1.36 KB
/
view.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% extends "games/base.html" %}
{% block content %}
<h1>{{ game.name }}</h1>
<article class="game single">
<section class="screenshots">
<h2>Screenshots</h2>
<ul class="screenshots">
{% for screenshot in game.screenshot_set.all %}
<li id="screenshot-{{ screenshot.id }}">
<img src="{{ screenshot.get_absolute_url }}" height="{{ screenshot.file.height }}" width="{{ screenshot.file.width }}">
</li>
{% empty %}
<li>No Screenshots Available</li>
{% if game.creator == request.user %}
<h3><a href="{% url games.edit game.id %}">Add Screenshots</a></h3>
{% endif %}
{% endfor %}
</ul>
</section>
<section class="description">
<ul class="links">
<li><a href="{{ game.url }}">Play the game</a></li>
{% if game.source %}
<li><a href="{{ game.source }}">See the source</a></li>
{% endif %}
{% if game.creator == request.user %}
<li><a href="{% url games.edit game.id %}">Edit</a></li>
{% endif %}
</ul>
<h2>Description</h2>
<p>{{ game.description|linebreaks }}</p>
{% if game.resources %}
<h2>Resources Used</h2>
<p>{{ game.resources|linebreaks }}</p>
{% endif %}
</section>
{% if not game.screenshot_set.all %}
{% endif %}
</article>
{% endblock %}