digitaleagenturnc/news/templates/news/news_management_SAVE.html

69 lines
2.8 KiB
HTML

{% extends "users/base.html" %}
{% block content %}
<div class="content-section col-12">
<h3>News</h3>
<hr>
<p>
Hier können aktuelle Nachrichten für die Agentur erstellt und verwaltet werden.
</p>
<div class="row">
<div class="content-section col-4">
<a class="btn btn-primary" href="{% url 'news-add' %} ">News anlegen</a>
</div>
</div>
<hr>
<div class="row">
<div class="form-group mb-2">
<input class="form-control" id="tableSearch" size="50" type="text" placeholder="Suche in Tabelle...">
</div>
<div class="table-responsive">
<table class="table table-hover" >
<thead>
<tr>
<th scope="col">Titel</th>
<th scope="col">Erstellt von</th>
<th scope="col">Erstellt am</th>
<th scope="col">Sichtbar von/bis</th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
<tbody id="tableresults">
{% for news_single in news %}
<tr>
<td><a href="{% url 'news-single' news_single.pk %}">{{news_single.name }}</a></td>
<td>{{ news_single.created_by.first_name }} {{ news_single.created_by.last_name }}</td>
<td>{{ news_single.created_date }}</td>
<td>{{ news_single.go_online_on|date:"d.m.Y, H:i"}} bis {{ news_single.go_offline_on|date:"d.m.Y, H:i"}}</td>
<td>
{% if news_single.created_by == request.user or perms.users.news_management %}
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="{% url 'news-update' news_single.pk %}" class="btn">Bearbeiten</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger" href="{% url 'news-delete' news_single.pk %}">Löschen</a>
</div>
</div>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<script>
$(document).ready(function(){
$("#tableSearch").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#tableresults tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
</script>
{% endblock content %}