]> Johnzone git - stable.git/commitdiff
small changes and test for better nav
authorJohn Janus <j.janus@lighthouse-it.de>
Wed, 10 Apr 2019 16:02:31 +0000 (18:02 +0200)
committerJohn Janus <j.janus@lighthouse-it.de>
Wed, 10 Apr 2019 16:02:31 +0000 (18:02 +0200)
core/admin.py
core/templates/core/stablepart_list.html
stable/settings.py

index 153f502..1b930ed 100644 (file)
@@ -1,5 +1,5 @@
 from django.contrib import admin
-from core.models import StablePart, Bay, Horse, FodderPlan, Misc
+from core.models import StablePart, Bay, Horse, FodderPlan, Misc, IsInBay
 
 # Register your models here.
 admin.site.register(StablePart)
@@ -7,3 +7,4 @@ admin.site.register(Bay)
 admin.site.register(Horse)
 admin.site.register(FodderPlan)
 admin.site.register(Misc)
+admin.site.register(IsInBay)
index af24e12..284fa00 100644 (file)
@@ -3,12 +3,31 @@
 {% block title %}Stable Parts - {{ block.super }}{% endblock %}
 
 {% block main %}
+<ul>
+  {% for sp in object_list %}
+  <li>{{ sp }}
     <ul>
-      {% for sp in object_list %}
-        <li><a href="/stablepart/{{sp.id}}">{{ sp }}</a></li>
-      {% empty %}
-        <li>No Stable yet</li>
+      {% for bay in sp.bays.all %}
+      <li>
+        <div class="card">
+          <h3>{{ bay }}</h3>
+          {% for inbay in bay.isinbay_set.all %}
+          <div>{{ inbay.in_bay_since }} bis {{ inbay.in_bay_until }}: {{ inbay.horse }}</div>
+          {% endfor %}
+        </div>
+      </li>
       {% endfor %}
     </ul>
+  </li>
+  {% endfor %}
+</ul>
 {% endblock %}
-  
+<!-- {% block nav %}
+<ul>
+  {% for sp in object_list %}
+  <li><a href="/stablepart/{{sp.id}}">{{ sp }}</a></li>
+  {% empty %}
+  <li>No Stable yet</li>
+  {% endfor %}
+</ul>
+{% endblock %} -->
\ No newline at end of file
index 5ec8e75..51db7cd 100644 (file)
@@ -81,7 +81,7 @@ DATABASES = {
         'NAME': 'stable', 
         'USER': 'stable', 
         'PASSWORD': 'po1Ahf5eph7dogh1', 
-            }
+    }
 }