Commit 617c320e authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

add Not found

parent d47fb655
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
{% paginate news %} {% paginate news %}
<form class="form"> <form class="form">
<table class="table table-hover"> <table class="table table-hover">
<thead class="thead-inverse"> <thead class="thead-inverse">
...@@ -70,6 +71,9 @@ ...@@ -70,6 +71,9 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% if not news %}
<tr><td><h3>Not found</h3></td></tr>
{% endif %}
{% for i in news %} {% for i in news %}
<tr id="{{ i.id }}"> <tr id="{{ i.id }}">
<td> <td>
......
...@@ -31,9 +31,9 @@ class ListNewsView(ListView): ...@@ -31,9 +31,9 @@ class ListNewsView(ListView):
if search: if search:
news = news.filter(Q(title__icontains=search) | Q(description__icontains=search)) news = news.filter(Q(title__icontains=search) | Q(description__icontains=search))
if from_date: if from_date:
news = news.filter(record_date__gte=from_date) news = news.filter(publish_date__gte=from_date)
if to_date: if to_date:
news = news.filter(record_date__lte=to_date) news = news.filter(publish_date__lte=to_date)
if media: if media:
news = self._filter_by_media(news, media) news = self._filter_by_media(news, media)
media = WpEsiMedia.objects.all() media = WpEsiMedia.objects.all()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment