add fragment_child_models.html
This commit is contained in:
parent
f1b58f11b8
commit
e8260189f3
3 changed files with 14 additions and 6 deletions
|
@ -0,0 +1,8 @@
|
|||
<div class="list-group">
|
||||
{% for model in child_models %}
|
||||
<a href="{{ model.url }}" class="list-group-item">
|
||||
{% if model.count %}<span class="badge">{{ model.count }}</span>{% endif %}
|
||||
{{ model.title }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
|
@ -14,8 +14,4 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="locationgroup">
|
||||
<a href="{% url 'editor.locationgroups.list' %}" class="list-group-item">
|
||||
Locationgroups
|
||||
</a>
|
||||
</div>
|
||||
{% include 'editor/fragment_child_models.html' %}
|
||||
|
|
|
@ -8,7 +8,7 @@ from django.urls import reverse
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
from c3nav.mapdata.models import Section
|
||||
from c3nav.mapdata.models import LocationGroup, Section
|
||||
from c3nav.mapdata.models.base import EDITOR_FORM_MODELS
|
||||
|
||||
|
||||
|
@ -28,6 +28,10 @@ def sidebar_view(func):
|
|||
def main_index(request):
|
||||
return render(request, 'editor/index.html', {
|
||||
'sections': Section.objects.all(),
|
||||
'child_models': [{
|
||||
'title': LocationGroup._meta.verbose_name_plural,
|
||||
'url': reverse('editor.locationgroups.list'),
|
||||
}],
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue