introduce db, some changes to UI

This commit is contained in:
Pavol Rusnak 2011-06-19 02:22:08 +02:00
parent 57f8f51b4f
commit e3c99305cc
17 changed files with 151 additions and 18 deletions

View file

@ -1,7 +0,0 @@
{% extends "base.html" %}
{% block title %}Admin{% endblock %}
{% block content %}
<p><a href="barcode-generator.txt">barcode generator input</a></p>
{% endblock %}

View file

@ -1,12 +1,13 @@
<html>
<head>
<title>BrmBar: {% block title %}{% endblock %}</title>
<link rel="icon" type="image/png" href="/static/favicon.png">
<link rel="icon" type="image/png" href="/static/favicon.png" />
<link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
<h1><img src="/static/favicon.png" valign="middle" /> BrmBar: {{ self.title() }}</h1>
<div id="menu">
<a href="/">home</a> | <a href="/stats/">stats</a> | <a href="/log/">log</a> | <a href="/admin/">admin</a>
<p><a href="/">home</a> | <a href="/stats/">stats</a> | <a href="/log/">log</a> | <a href="/items/">items</a></p>
</div>
<div id="content">
{% block content %}{% endblock %}

View file

@ -1,5 +1,13 @@
{% extends "base.html" %}
{% block title %}Welcome{% endblock %}
{% block content %}
welcome
{% for item in items %}
<div class="block">
<img src="/static/items/{{ item.code|safe }}.jpg"><br/>
{{ item.name|safe }}<br/>
<strong>{{ item.price }} Kc</strong>
</div>
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block title %}Items{% endblock %}
{% block content %}
<form action="" method="post">
<table>
<tr><th>image</th><th>code</th><th>item</th><th>price</th><th>action</th></tr>
<tr><td></td><td><input name="code" size="14"/></td><td><input name="name" size="30"/></td><td><input name="price" size="2"/></td><td><input type="submit" name="action" value="add"/></tr>
{% for item in items %}
<tr><td><img src="/static/items/{{ item.code|safe }}.jpg" width="64" height="64"/></td><td>{{ item.code|safe }}</td><td>{{ item.name|safe }}</td><td>{{ item.price }}</td><td><input type="submit" name="action" value="delete:{{ item.id }}"/></tr>
{% endfor %}
</table>
</form>
{% endblock %}