Challenges now connected to items and added items hidden field

This commit is contained in:
teras
2017-12-03 15:46:54 +02:00
committed by Lauri Võsandi
parent 8fe36ecefc
commit 47d6741493
6 changed files with 70 additions and 70 deletions

View File

@@ -8,12 +8,6 @@
<div class="col m8">
<h3 class="">{{ challenge.name }}</h3>
<div>
{% for tag in challenge.tags.all %}
<div class="chip">{{ tag.name }}</div>
{% endfor %}
</div>
<p style="">{{ challenge.description | markdownify }}</p>
<div class="section">
@@ -25,7 +19,8 @@
<br>
{% endif %}
{% if challenge.creator.profile.phone_number %}
<div class="valign-wrapper"><i class="material-icons">phone</i>&nbsp;{{ challenge.creator.profile.phone_number }}</div>
<div class="valign-wrapper"><i
class="material-icons">phone</i>&nbsp;{{ challenge.creator.profile.phone_number }}</div>
{% endif %}
</div>
</div>
@@ -41,33 +36,31 @@
</ul>
{% if challenge.tags|length > 0 %}
<ul class="collection with-header">
<li class="collection-header">
<span class="title"><b>Tags</b></span>
<ul class="collection with-header">
<li class="collection-header">
<span class="title"><b>Tags</b></span>
</li>
{% for tag in challenge.tags.all %}
<li class="collection-item">
<span class="">{{ tag.name }}</span>
</li>
{% endfor %}
</ul>
{% for tag in challenge.tags.all %}
<ul class="collection with-header">
<li class="collection-header">
<span class="title"><b>Inventory Items</b></span>
</li>
{% for item in challenge.required_items.all %}
{% if not item.hidden %}
<li class="collection-item">
<span class="">{{ tag.name }}</span>
<span class="">{{ item.item_name }}</span>
</li>
{% endfor %}
</ul>
{% endif %}
{% if challenge.tags|length > 0 %}
<ul class="collection with-header">
<li class="collection-header">
<span class="title"><b>Tags</b></span>
</li>
{% for tag in challenge.tags.all %}
<li class="collection-item">
<span class="">{{ tag.name }}</span>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</div>

View File

@@ -9,28 +9,30 @@
<div class="row container challenges">
<div class="row">
{% for item in inventory %}
<div class="col s12 m3">
<div class="card" style="height:350px;">
<div class="card-content">
<div class="row" style="height:210px;">
<div class="col s12 m12">
<div class="card-title"><b>{{ item.item_name }}</b></div>
<p>Serial: {{ item.serial_nr }}</p>
<p style="text-align: justify; max-height: 120px; overflow: auto;">{{ item.description }}</p>
{% if not item.hidden %}
<div class="col s12 m3">
<div class="card" style="height:350px;">
<div class="card-content">
<div class="row" style="height:210px;">
<div class="col s12 m12">
<div class="card-title"><b>{{ item.item_name }}</b></div>
<p>Serial: {{ item.serial_nr }}</p>
<p style="text-align: justify; max-height: 120px; overflow: auto;">{{ item.description }}</p>
<div class="card-image">
{% if item.photo %}
<img src='/media/{{ item.photo }}'>
{% else %}
<img src='/media/missing_photo.png'>
{% endif %}
<div class="card-image">
{% if item.photo %}
<img src='/media/{{ item.photo }}'>
{% else %}
<img src='/media/missing_photo.png'>
{% endif %}
</div>
</div>
</div>
</br>
</div>
</br>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>