mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-23 17:42:15 -05:00
[add] create tags page
This commit is contained in:
parent
68e2061666
commit
2e2ebe5ec7
@ -250,6 +250,14 @@ class Database {
|
||||
return $this->getHandle()->lastInsertId($column);
|
||||
}
|
||||
|
||||
public function retrieveAllTags() {
|
||||
$sql = "SELECT * FROM tags";
|
||||
$query = $this->executeQuery($sql, array());
|
||||
$tags = $query->fetchAll();
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
public function retrieveTagsByEntry($entry_id) {
|
||||
$sql =
|
||||
"SELECT * FROM tags
|
||||
|
@ -430,6 +430,12 @@ class Poche
|
||||
);
|
||||
Tools::logm('config view');
|
||||
break;
|
||||
case 'tags':
|
||||
$tags = $this->store->retrieveAllTags();
|
||||
$tpl_vars = array(
|
||||
'tags' => $tags,
|
||||
);
|
||||
break;
|
||||
case 'view':
|
||||
$entry = $this->store->retrieveOneById($id, $this->user->getId());
|
||||
if ($entry != NULL) {
|
||||
|
@ -103,14 +103,15 @@ class Tools
|
||||
case 'config':
|
||||
$tpl_file = 'config.twig';
|
||||
break;
|
||||
case 'tags':
|
||||
$tpl_file = 'tags.twig';
|
||||
break;
|
||||
case 'view':
|
||||
$tpl_file = 'view.twig';
|
||||
break;
|
||||
|
||||
case 'login':
|
||||
$tpl_file = 'login.twig';
|
||||
break;
|
||||
|
||||
case 'error':
|
||||
$tpl_file = 'error.twig';
|
||||
break;
|
||||
|
@ -2,6 +2,7 @@
|
||||
<li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
|
||||
<li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
|
||||
<li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
|
||||
<li><a href="./?view=tags" {% if view == 'tags' %}class="current"{% endif %}>{% trans "tags" %}</a></li>
|
||||
<li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
|
||||
<li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
|
||||
</ul>
|
8
themes/default/tags.twig
Normal file
8
themes/default/tags.twig
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "layout.twig" %}
|
||||
{% block title %}tags{% endblock %}
|
||||
{% block menu %}
|
||||
{% include '_menu.twig' %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% for tag in tags %}<a href="#">{{ tag.value }}</a> {% endfor %}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user