You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.2 KiB
HTML

{% extends 'base.html' %}
{% block title %}{{ location.city }} |{{ location.name }}{% endblock %}
{% block header %}<h1>{{ location.city }} |{{ location.name }}</h1>{% endblock %}
{% block content %}
<div class="detail-container">
<p>
<a class="btn" href="{% url 'mensaviewer:news_add' location.pk %}">Add News</a>
<a class="btn" href="{% url 'mensaviewer:menu_add' location.pk %}">Add Menu</a>
<a class="btn" href="{% url 'mensaviewer:location_update' location.pk %}">Edit</a>
<a class="btn" href="{% url 'mensaviewer:location_delete' location.pk %}">Delete</a>
</p>
<div class="related-items">
<h2>News</h2>
<table class="news-list">
<tr>
<th>Title</th>
<th>Author</th>
<th>Timestamp</th>
<th>Menu</th>
<th></th>
<th></th>
</tr>
{% for newsarticle in location.news_articles %}
<tr>
<td><a href="{% url 'mensaviewer:news_detail' newsarticle.pk %}">{{ newsarticle.title }}</a></td>
<td>{{ newsarticle.author }}</td>
<td>{{ newsarticle.timestamp }}</td>
<td><a href="{% url 'mensaviewer:location_detail' newsarticle.location.pk %}">{{ newsarticle.location.city }} - {{ newsarticle.location.name }}</a></td>
<td class="fit-width"><a href="{% url 'mensaviewer:news_update' newsarticle.pk %}">Edit</a></td>
<td class="fit-width"><a href="{% url 'mensaviewer:news_delete' newsarticle.pk %}">Delete</a></td>
</tr>
{% endfor %}
</table>
</div>
<div class="related-items">
<h2>Menus</h2>
<table class="menu-list">
<tr>
<th>Name</th>
<th>Location</th>
<th>Day</th>
<th>Edit</th>
<th>Delete</th>
</tr>
{% for menu in location.menus %}
<tr>
<td><a href="{% url 'mensaviewer:menu_detail' menu.pk %}">{{ menu.name }}</a></td>
<td><a href="{% url 'mensaviewer:location_detail' menu.location.pk %}">{{ menu.location.name }}</a></td>
<td>{{ menu.day }}</td>
<td class="fit-width"><a href="{% url 'mensaviewer:menu_update' menu.pk %}">Edit</a></td>
<td class="fit-width"><a href="{% url 'mensaviewer:menu_delete' menu.pk %}">Delete</a></td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}