summaryrefslogtreecommitdiffstats
path: root/inventar/templates/item.html
blob: 84a8fad96bedc0d794ecb33c11bd8d246ab021f3 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{% extends "base.html" %}
{% load i18n %}

{% block content %}
		{% if user.is_authenticated %}
		<h1>{{ name }} <a href="{% url "admin:inventory_item_change" id %}"><img src="/static/edit.svg" width="20" height="20" alt="[edit]"/></a></h1>
		{% else %}
		<h1>{{ name }}</h1>
		{% endif %}

		<table>
			<tr class="{% cycle 'row1' 'row2' as rowcolor %}">
				<th>{% trans "Name" %}</th>
				<td>{{ name }}</td>
			</tr>

			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/barcode.svg" width="32" height="32" title="{% trans "Codes" %}" alt="{% trans "Codes" %}" /></th>
				<td>{{ codes }}</td>
			</tr>

			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/info.svg" width="32" height="32" title="{% trans "Description" %}" alt="{% trans "Description" %}" /></th>
				<td><pre>{{ description }}</pre></td>
			</tr>

			{% if note %}
			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/note.svg" width="32" height="32" title="{% trans "Note" %}" alt="{% trans "Note" %}" /></th>
				<td><pre>{{ note }}</pre></td>
			</tr>
			{% endif %}

			{% if image %}
			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/image.svg" width="32" height="32" title="{% trans "Image" %}" alt="{% trans "Image" %}" /></th>
				<td><a href="/uploaded/{{ image }}"><img src="/uploaded/{{ image }}" width="640" alt="{% trans "image from item" %}" /></a></td>
			</tr>
			{% endif %}

			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/used.svg" width="32" height="32" title="{% trans "in use" %}" alt="{% trans "in use" %}" /></th>
				{% if in_use %}
				<td><img src="/static/true.svg" width="24" height="24" alt="True" title="True" /></td>
				{% else %}
				<td><img src="/static/false.svg" width="24" height="24" alt="False" title="False" /></td>
				{% endif %}
			</tr>

			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/parent.svg" width="32" height="32" title="{% trans "Parent" %}" alt="{% trans "Parent" %}" /></th>
				<td>
					{% for p in parentpath %}
					{% if p.one_barcode %}
					<ul class="path"><li><a href="{% url "item" selectedid=p.one_barcode %}">{{ p.name }} [{{ p.barcodes }}]</a>
					{% else %}
					<ul class="path"><li>{{ p.name }} [{{ p.barcodes }}]
					{% endif %}
					{% endfor %}
					{% for p in parentpath %}
					</li></ul>
					{% endfor %}
				</td>
			</tr>

			{% if temporary_parent %}
			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/temporary_parent.svg" width="32" height="32" title="{% trans "temporary Parent" %}" alt="{% trans "temporary Parent" %}" /></th>
				<td>
					{% for p in temporary_parentpath %}
					{% if p.one_barcode %}
					<ul class="path"><li><a href="{% url "item" selectedid=p.one_barcode %}">{{ p.name }} [{{ p.barcodes }}]</a>
					{% else %}
					<ul class="path"><li>{{ p.name }} [{{ p.barcodes }}]
					{% endif %}
					{% endfor %}
					{% for p in temporary_parentpath %}
					</li></ul>
					{% endfor %}
				</td>
			</tr>
			{% endif %}

			{% if children %}
			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/children.svg" width="32" height="32" title="{% trans "Children" %}" alt="{% trans "Children" %}" /></th>
				<td>
					{% if children %}
					<ul>
					{% for child in children %}
						{% if child.one_barcode %}
						<li><a href="{% url "item" selectedid=child.one_barcode %}">{{ child.name }} [{{ child.barcodes }}]</a></li>
						{% else %}
						<li>{{ child.name }} [{{ child.barcodes }}]</li>
						{% endif %}
					{% endfor %}
					</ul>
					{% else %}
					{% trans "No Children defined!" %}
					{% endif %}
				</td>
			</tr>
			{% endif %}

			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/tag.svg" width="32" height="32" title="{% trans "Tags" %}" alt="{% trans "Tags" %}" /></th>
				<td>
					{% if tags %}
					<ul>
					{% for tag in tags %}
						{% if tag.icon %}
						<li><img src="/uploaded/{{ tag.icon }}" width="32" height="32" alt="{{ tag.name }}" title="{{ tag.name }}" /></li>
						{% else %}
						<li>{{ tag.name }}</li>
						{% endif %}
					{% endfor %}
					</ul>
					{% else %}
					{% trans "No Tags defined!" %}
					{% endif %}
				</td>
			</tr>

			{% if supplier %}
			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/truck.svg" width="32" height="32" title="{% trans "Supplier" %}" alt="{% trans "Supplier" %}" /></th>
				<td>{{ supplier }}</td>
			</tr>
			{% endif %}

			{% if owner %}
			<tr class="{% cycle rowcolor %}">
				<th><img src="/static/owner.svg" width="32" height="32" title="{% trans "Owner" %}" alt="{% trans "Owner" %}" /></th>
				<td>{{ owner }}</td>
			</tr>
			{% endif %}
		</table>
{% endblock %}