spejstore-new/storage/templates/item.html

153 lines
6.0 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% block content %}
<ol class="breadcrumb">
2020-05-11 18:26:59 +00:00
<li><a href="/item/">All</a></li>
{% for ancestor in ancestors %}
<li><a href="{{ ancestor.get_absolute_url }}">{{ ancestor.name }}</a></li>
{% endfor %}
<li class="active">{{ item.name }}</li>
</ol>
2017-02-28 23:16:10 +00:00
<h2>
{% include "widgets/categoryicon.html" with category=item.primary_category %}
2023-12-03 18:55:26 +00:00
{% if item.wiki_link %}
<a href="{{item.wiki_link}}" target="_blank">{{ item.name }}</a>
{% else %}
{{ item.name }}
{% endif %}
2017-02-28 23:16:10 +00:00
</h2>
2023-12-03 18:55:26 +00:00
{% if item.wiki_link %}
<span>Click <a href="{{item.wiki_link}}" target="_blank">HERE</a> or title for wiki</span>
{% endif %}
<div class="row">
<div class="col-md-4">
2020-05-20 20:48:23 +00:00
<iframe name="printframe" style="display: none"></iframe>
<div class="btn-group" role="group" style="margin-bottom: 10px">
<div class="btn-group">
<button type="button" class="btn btn-default btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="glyphicon glyphicon-print"></i>&nbsp;&nbsp;Print labels <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><div style="padding: 5px 10px">Put one label in front, one on the back!</div></li>
<li role="separator" class="divider"></li>
<li style="padding: 5px 10px">
<form action="/api/1/items/{{ item.short_id }}/print/?quantity=2" method="POST" target="printframe" style="display:inline-block">
{% csrf_token %}
<button class="btn btn-default btn-lg">Print 2 labels (recommended)</button>
</form>
</li>
<li style="padding: 5px 10px">
<form action="/api/1/items/{{ item.short_id }}/print/" method="POST" target="printframe" style="display:inline-block">
{% csrf_token %}
<button class="btn btn-default btn-lg">Print 1 label</button>
</form>
</li>
</ul>
</div>
<a href="{% url 'admin:storage_item_change' item.pk %}" class="btn btn-default">Edit</a>
2024-08-27 20:55:16 +00:00
{% if item.props.wiki %}
<a href="https://wiki.hswro.org/{{ item.props.wiki }}" class="btn btn-info">Wiki</a>
{% endif %}
</div>
2020-05-20 20:48:23 +00:00
<table class="table table-hover table-striped">
{% if item.owner %}
<tr><td>owner</td><td>{{ item.owner }}</td></tr>
{% endif %}
2020-05-11 18:09:02 +00:00
{% if item.state != "present" %}
<tr><td>state</td><td>{{ item.state }}</td></tr>
2020-05-11 18:09:02 +00:00
{% endif %}
{% if item.taken_by %}
<tr><td>taken by</td><td>{{ item.taken_by }}</td></tr>
{% endif %}
{% if item.taken_on %}
<tr><td>taken on</td><td>{{ item.taken_on }}</td></tr>
{% endif %}
{% if item.taken_until %}
<tr><td>taken until</td><td>{{ item.taken_until }}</td></tr>
{% endif %}
2020-05-11 18:09:02 +00:00
<!-- no one cares, except for dev? -->
<!-- <tr><td>pk</td><td><small>{{ item.pk }}</small></td></tr> -->
2020-05-20 20:48:23 +00:00
<!-- <tr><td>short_id</td><td><small>{{ item.short_id }}</small></td></tr> -->
{% for category in categories %}
<tr>
2020-05-20 20:48:23 +00:00
<td>
category
</td>
<td>
2020-05-20 20:48:23 +00:00
{% include "widgets/categoryicon.html" with category=category %}
<span style="padding-top: 1rem; padding-left: 10px">{{ category.name }}</span>
</td>
</tr>
{% endfor %}
2020-05-20 20:48:23 +00:00
{% for k, v in item.props.items %}
<tr><td>{{ k }}</td><td>{{ v|urlize }}</td></tr>
{% endfor %}
{% if labels %}
<tr><td>legacy labels</td><td>
2020-05-20 20:48:23 +00:00
{% for label in labels %}
<code>{{ label.id }}</code>,
{% endfor %}
</td></tr>
{% endif %}
</table>
2017-02-28 23:16:10 +00:00
{% if images %}
<h3>Photos</h3>
<div class="row">
{% for image in images %}
<div class="col-md-6">
<a href="{{ image.image.url }}">
<img src="{{ image.image.url }}" class="img-responsive img-thumbnail" />
</a>
</div>
{% endfor %}
</div>
{% endif %}
2017-04-28 12:14:27 +00:00
2017-10-24 18:59:58 +00:00
{% if history %}
2020-05-11 18:55:57 +00:00
<div class="row" style="margin-top: 20px">
<div class="col-md-6">
<a class="btn btn-default btn-sm" data-toggle="collapse" data-target="#hs-item-history" >Toggle changes</a>
</div>
</div>
<div id="hs-item-history" class="collapse">
2017-10-24 18:59:58 +00:00
<h3>Changes</h3>
<table class="table table-striped table-hover">
{% for entry in history %}
<tr>
<td class="{% if entry.is_addition %}text-success{% endif %}">
<b>{{ entry.user }}</b>
<small>@ {{ entry.action_time }}</small><br />
{{ entry.get_change_message }}</td>
</tr>
{% endfor %}
</table>
2020-05-11 18:55:57 +00:00
</div>
2017-10-24 18:59:58 +00:00
{% endif %}
</div>
2017-02-28 23:16:10 +00:00
<div class="col-md-8">
{% if item.description %}
{% load md2 %}
{{ item.description|markdown:"code-color" }}
{% endif %}
2017-02-28 23:16:10 +00:00
2020-05-11 18:55:57 +00:00
<h3>What's inside?</h3>
{% include "widgets/itemlist.html" with list=children|dictsort:"name" item=item %}
2017-02-28 23:16:10 +00:00
</div>
</div>
{% endblock %}