mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-27 11:22:17 -05:00
Add warning message when there is no entry in current view
This commit is contained in:
parent
093f1efb21
commit
3eb049036e
@ -259,13 +259,17 @@ class Poche
|
|||||||
break;
|
break;
|
||||||
default: # home, favorites and archive views
|
default: # home, favorites and archive views
|
||||||
$entries = $this->store->getEntriesByView($view, $this->user->getId());
|
$entries = $this->store->getEntriesByView($view, $this->user->getId());
|
||||||
$this->pagination->set_total(count($entries));
|
|
||||||
$page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&');
|
|
||||||
$datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit());
|
|
||||||
$tpl_vars = array(
|
$tpl_vars = array(
|
||||||
'entries' => $datas,
|
'entries' => '',
|
||||||
'page_links' => $page_links,
|
'page_links' => '',
|
||||||
);
|
);
|
||||||
|
if (count($entries) > 0) {
|
||||||
|
$this->pagination->set_total(count($entries));
|
||||||
|
$page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&');
|
||||||
|
$datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit());
|
||||||
|
$tpl_vars['entries'] = $datas;
|
||||||
|
$tpl_vars['page_links'] = $page_links;
|
||||||
|
}
|
||||||
Tools::logm('display ' . $view . ' view');
|
Tools::logm('display ' . $view . ' view');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,10 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ page_links | raw }}
|
{{ page_links | raw }}
|
||||||
{% for entry in entries %}
|
{% if entries is empty %}
|
||||||
|
<div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
|
||||||
|
{% else %}
|
||||||
|
{% for entry in entries %}
|
||||||
<div id="entry-{{ entry.id|e }}" class="entrie">
|
<div id="entry-{{ entry.id|e }}" class="entrie">
|
||||||
<h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
|
<h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
|
||||||
<ul class="tools">
|
<ul class="tools">
|
||||||
@ -31,6 +34,7 @@
|
|||||||
<p>{{ entry.content|striptags|slice(0, 300) }}...</p>
|
<p>{{ entry.content|striptags|slice(0, 300) }}...</p>
|
||||||
<p class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></p>
|
<p class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></p>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{{ page_links | raw }}
|
{{ page_links | raw }}
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user