added generic base template
authorSven Arnold <sven@internetallee.de>
Mon, 8 Feb 2016 19:07:28 +0000 (20:07 +0100)
committerSven Arnold <sven@internetallee.de>
Mon, 8 Feb 2016 19:08:16 +0000 (20:08 +0100)
project/books/migrations/0002_auto_20160208_1741.py [new file with mode: 0644]
project/books/static/books/style.css [new file with mode: 0644]
project/books/templates/base_generic.html [new file with mode: 0644]
project/books/templates/books/index.html
project/books/templates/books/lease.html
project/books/templates/books/persons.html
project/books/templates/books/returned.html

diff --git a/project/books/migrations/0002_auto_20160208_1741.py b/project/books/migrations/0002_auto_20160208_1741.py
new file mode 100644 (file)
index 0000000..65e2b62
--- /dev/null
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('books', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Person',
+            fields=[
+                ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
+                ('name', models.CharField(max_length=200)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.AlterField(
+            model_name='lease',
+            name='leasee',
+            field=models.ForeignKey(to='books.Person'),
+            preserve_default=True,
+        ),
+    ]
diff --git a/project/books/static/books/style.css b/project/books/static/books/style.css
new file mode 100644 (file)
index 0000000..b6df870
--- /dev/null
@@ -0,0 +1,3 @@
+* {
+       font-family: Arial;
+}
diff --git a/project/books/templates/base_generic.html b/project/books/templates/base_generic.html
new file mode 100644 (file)
index 0000000..1018021
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="de">
+<head>
+       {% load staticfiles %}
+       <link rel="stylesheet" type="text/css" href="{% static 'books/style.css' %}" />
+       <title>{% block title %}Titel{% endblock %}</title>
+</head>
+<body>
+       <div id="content">{% block content %}{% endblock %}</div>
+</body>
+</html>
index 6a5a740..aafd88e 100644 (file)
@@ -1,3 +1,8 @@
+{% extends "base_generic.html" %}
+
+{% block title %}Urte's Bücher{% endblock %}
+
+{% block content %}
 <a href="{% url 'persons' %}">Personen</a>
 <div>
 {% if book_list %}
@@ -20,3 +25,4 @@
        <input type="submit" value="Neues Buch" />
 </form>
 </div>
+{% endblock %}
index bcc905f..5e343df 100644 (file)
@@ -1,6 +1,14 @@
-Leihe {{ book }} an 
+{% extends 'base_generic.html' %}
+
+ {% block title %}
+Leihe »{{ book }}« an 
+{% endblock %}
+
+{% block content %}
+Leihe »{{ book }}« an
 <form action="{% url 'lease_book' book.id %}" method="post">
        {% csrf_token %}
        <input type="text" name="leasee" />
        <input type="submit" value="Verleihe" />
 </form>
+{% endblock %}
index 5943315..df19003 100644 (file)
@@ -1,3 +1,10 @@
+{% extends 'base_generic.html' %}
+
+{% block title %}
+Liste der Ausleiher
+{% endblock %}
+
+{% block content %}
 <a href="{% url 'index' %}">Bücher</a>
 <div>
 {% if person_list %}
@@ -16,3 +23,4 @@
        Keine Personen eingetragen.
 {% endif %}
 </div>
+{% endblock %}
index 8870a62..d6ed34f 100644 (file)
@@ -1,3 +1,9 @@
+{% extends 'base_generic.html' %}
+
+{% block title %}Buch wurde zurückgegeben{% endblock %}
+
+{% block content %}
 <a href="{% url 'index' %}">
 {{ lease.leasee }} returned »{{ lease.book }}«.
 </a>
+{% endblock %}