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)
admin.site.register(Horse)
admin.site.register(FodderPlan)
admin.site.register(Misc)
+admin.site.register(IsInBay)
{% 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