diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-07-27 00:25:24 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-07-27 00:25:24 +0200 |
commit | 05b408ad3047e40a63c16c367500e925986490a1 (patch) | |
tree | e39bb7a292c6d11c5f5104a3dab3645382a23297 /inventar | |
parent | c8c21d921094a33585cc66d95eaac38d0a5dd388 (diff) | |
download | ktt-inventory-system-05b408ad3047e40a63c16c367500e925986490a1.tar.bz2 |
add templates
Diffstat (limited to 'inventar')
-rw-r--r-- | inventar/templates/404.html | 6 | ||||
-rw-r--r-- | inventar/templates/admin/inventory/change_form.html | 17 | ||||
-rw-r--r-- | inventar/templates/base.html | 33 | ||||
-rw-r--r-- | inventar/templates/graph.txt | 25 | ||||
-rw-r--r-- | inventar/templates/home.html | 50 | ||||
-rw-r--r-- | inventar/templates/item.html | 124 | ||||
-rw-r--r-- | inventar/templates/search.html | 27 |
7 files changed, 282 insertions, 0 deletions
diff --git a/inventar/templates/404.html b/inventar/templates/404.html new file mode 100644 index 0000000..52ec653 --- /dev/null +++ b/inventar/templates/404.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} + <h1>page not found.</h1> +{% endblock %} diff --git a/inventar/templates/admin/inventory/change_form.html b/inventar/templates/admin/inventory/change_form.html new file mode 100644 index 0000000..5ee5442 --- /dev/null +++ b/inventar/templates/admin/inventory/change_form.html @@ -0,0 +1,17 @@ +{% extends "admin/change_form.html" %} + +{% block extrahead %} + {{ block.super }} + <link rel="stylesheet" href="/static/chosen/chosen.css" /> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/chosen/chosen.jquery.js"></script> + <script type="text/javascript" src="/static/chosen/chosen.jquery_ready.js"></script> +{% endblock %} + +{% block after_related_objects %} + {{ block.super }} + <script type="text/javascript"> + $(".chzn-select").chosen(); + $(".chzn-select-deselect").chosen({allow_single_deselect:true}); + </script> +{% endblock %} diff --git a/inventar/templates/base.html b/inventar/templates/base.html new file mode 100644 index 0000000..c61e012 --- /dev/null +++ b/inventar/templates/base.html @@ -0,0 +1,33 @@ +{% load i18n %} +<!DOCTYPE html> +<html> + <head> + <title>{% block title %}KtT Inventory System{% endblock %}</title> + <link rel="stylesheet" href="/static/design.css" type="text/css" /> + </head> + <body> + <div class="header"> + <h1>{% block pagetitle %}KtT Inventory System{% endblock %}</h1> + </div> + + <div class="body"> + <div class="menu"> + <ul> + <li><a href="{% url home %}"><img src="/static/home.svg" width="24" height="24" /> {% trans "Home" %}</a></li> + <li><a href="{% url admin:index %}"><img src="/static/admin.svg" width="24" height="24" /> {% trans "Admin Area" %}</a></li> + <li><br></li> + <li>{% trans "Search Item" %}: + <ul> + <li><form action="?" target="_self" id="itemchooser" onsubmit="location.assign('/item/'+document.forms['itemchooser']['id'].value+'/'); return false;"><input maxlength="4" name="id" type="text" title="{% trans "Get Item by ID" %}"/></form></li> + <li><form action="?" target="_self" id="itemsearch" onsubmit="location.assign('/search/'+document.forms['itemsearch']['term'].value+'/'); return false;"><input name="term" type="text" title="{% trans "Search Item by Name and Description" %}"/></form></li> + </ul> + </li> + </ul> + </div> + + <div class="content"> + {% block content %}{% endblock %} + </div> + </div> + </body> +</html> diff --git a/inventar/templates/graph.txt b/inventar/templates/graph.txt new file mode 100644 index 0000000..74e26f0 --- /dev/null +++ b/inventar/templates/graph.txt @@ -0,0 +1,25 @@ +{% load graph_extras %} +# Graph of KtT Inventory +# +# Usage: +# wget -O graph.txt "http://hackspace.elektranox.org/graph/" +# graph-easy --dot graph.txt > graph.dot +# dot -Tsvg < graph.dot > graph1.svg +# twopi -Tsvg < graph.dot > graph2.svg +# circo -Tsvg < graph.dot > graph3.svg + +graph { + label: Graph of KtT Items; + autolink: name; + linkbase: http://hackspace.elektranox.org/item/ +} + +{% autoescape off %} +{% for item in items %} +{% if item.parent %} +[{{item.one_barcode}}] { label: "{{item.name|graphescape}}" } -> [{{item.parent.one_barcode}}] +{% else %} +[{{item.one_barcode}}] { label: "{{item.name|graphescape}}" } +{% endif %} +{% endfor %} +{% endautoescape %} diff --git a/inventar/templates/home.html b/inventar/templates/home.html new file mode 100644 index 0000000..567c39e --- /dev/null +++ b/inventar/templates/home.html @@ -0,0 +1,50 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} + <h2>Verwendung:</h2> + + <h3>Fall 1: Suchen eines Gegenstands</h3> + <p> + <ol> + <li>Den gesuchten Gegenstand links in die Suchmaske eingeben.</li> + <li>Die Suchergebnisse erscheinen im Hauptfenster.</li> + <li>Suchergebnis auswählen.</li> + <li>Der Pfad zum Gegenstand ist als Baum dargestellt.</li> + </ol> + </p> + + <h3>Fall 2: Zurückbringen eines Gegenstands</h3> + <p> + <ol> + <li>Alle Gegenständen ist mindestens ein viertstelliger Code zugewiesen.</li> + <li>Dieser kann einfach links in das Code Suchfeld eingetragen werden.</li> + <li>Man gelangt so direkt zu der Info Seite des Gegenstands.</li> + <li>Unter dem Pfad lässt sich der Ablageort des Gegenstands finden.</li> + </ol> + </p> + + <h3>Fall 3: Einräumen einer Kiste/eines Schrankes/...</h3> + <p> + <ol> + <li>Die Seite des Gegenstands öffnen, der befüllt werden soll.</li> + <li>Dort gibt es ein Feld "Kinderelemente", welche alle Gegenstände listet, + die Unterlemente sind.</li> + </ol> + </p> + + <h3>Sonstige Erklärungen</h3> + <p> + <ol> + <li>Einige Gegenstände haben temporär einen gesonderten Ort. Der Pfad zu diesem wird + direkt unter dem normalen Pfad dargestellt.</li> + <li>Ob Gegenstände frei zur Verfügung stehen lässt sich an dem "in Benutzung" Feld + erkennen (Das Icon sind zwei Zahnräder).</li> + <li>Bei einigen Gegenständen handelt es sich um Dauerleihgaben von Mitgliedern. Dies + lässt sich am Besitzer Feld erkennen. Das Feld ist nur bei Gegenständen vorhanden, + welche auch einen Besitzer haben (Das Icon ist eine Person).</li> + </ol> + </p> + + +{% endblock %} diff --git a/inventar/templates/item.html b/inventar/templates/item.html new file mode 100644 index 0000000..d144a18 --- /dev/null +++ b/inventar/templates/item.html @@ -0,0 +1,124 @@ +{% 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 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 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 %} diff --git a/inventar/templates/search.html b/inventar/templates/search.html new file mode 100644 index 0000000..5a1f1cf --- /dev/null +++ b/inventar/templates/search.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} + <h1>{% trans "searching for" %}: {{ term }}</h1> + + {% if results %} + <table> + <tr> + <th>{% trans "Name" %}</th> + <th>{% trans "Codes" %}</th> + </tr> + {% for result in results %} + {% cycle 'row1' 'row2' as rowcolor silent %} + <tr class="{{ rowcolor }}"> + {% if result.one_barcode %} + <td><a href="{% url item selectedid=result.one_barcode %}">{{ result.name }}</a></td> + {% else %} + <td>{{ result.name }}</td> + {% endif %} + <td>{{ result.barcodes }}</td> + </tr> + {% endfor %} + </table> + {% else %} + {% endif %} +{% endblock %} |