diff options
-rw-r--r-- | inc/poche/Poche.class.php | 7 | ||||
-rw-r--r-- | inc/poche/Tools.class.php | 3 | ||||
-rw-r--r-- | themes/default/edit-tags.twig | 18 | ||||
-rw-r--r-- | themes/default/view.twig | 2 |
4 files changed, 29 insertions, 1 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 802ec542..5d368842 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -430,6 +430,13 @@ class Poche | |||
430 | ); | 430 | ); |
431 | Tools::logm('config view'); | 431 | Tools::logm('config view'); |
432 | break; | 432 | break; |
433 | case 'edit-tags': | ||
434 | # tags | ||
435 | $tags = $this->store->retrieveTagsByEntry($id); | ||
436 | $tpl_vars = array( | ||
437 | 'tags' => $tags, | ||
438 | ); | ||
439 | break; | ||
433 | case 'tags': | 440 | case 'tags': |
434 | $tags = $this->store->retrieveAllTags(); | 441 | $tags = $this->store->retrieveAllTags(); |
435 | $tpl_vars = array( | 442 | $tpl_vars = array( |
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 5bb65fe9..9d911699 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -106,6 +106,9 @@ class Tools | |||
106 | case 'tags': | 106 | case 'tags': |
107 | $tpl_file = 'tags.twig'; | 107 | $tpl_file = 'tags.twig'; |
108 | break; | 108 | break; |
109 | case 'edit-tags': | ||
110 | $tpl_file = 'edit-tags.twig'; | ||
111 | break; | ||
109 | case 'view': | 112 | case 'view': |
110 | $tpl_file = 'view.twig'; | 113 | $tpl_file = 'view.twig'; |
111 | break; | 114 | break; |
diff --git a/themes/default/edit-tags.twig b/themes/default/edit-tags.twig new file mode 100644 index 00000000..0bd1aba7 --- /dev/null +++ b/themes/default/edit-tags.twig | |||
@@ -0,0 +1,18 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | {% block title %}edit tags{% endblock %} | ||
3 | {% block menu %} | ||
4 | {% include '_menu.twig' %} | ||
5 | {% endblock %} | ||
6 | {% block content %} | ||
7 | {% if tags is empty %} | ||
8 | no tags | ||
9 | {% endif %} | ||
10 | <ul> | ||
11 | {% for tag in tags %}<li>{{ tag.value }} <a href="#">✘</a></li>{% endfor %} | ||
12 | </ul> | ||
13 | <form method="post" action="#"> | ||
14 | <label for="value">New tags: </label><input type="text" id="value" name="value" required="required" /> | ||
15 | {% trans "you can type several tags, separated by comma" %}<br /> | ||
16 | <input type="submit" value="add tags" /> | ||
17 | </form> | ||
18 | {% endblock %} \ No newline at end of file | ||
diff --git a/themes/default/view.twig b/themes/default/view.twig index 5a7c9165..9f9e23c8 100644 --- a/themes/default/view.twig +++ b/themes/default/view.twig | |||
@@ -21,7 +21,7 @@ | |||
21 | <h1>{{ entry.title|raw }}</h1> | 21 | <h1>{{ entry.title|raw }}</h1> |
22 | </header> | 22 | </header> |
23 | <aside class="tags"> | 23 | <aside class="tags"> |
24 | tags: {% for tag in tags %}<a href="#">{{ tag.value }}</a> {% endfor %}<a href="#" title="{% trans "edit tags" %}">✎</a> | 24 | tags: {% for tag in tags %}<a href="#">{{ tag.value }}</a> {% endfor %}<a href="./?&view=edit-tags&id={{ entry.id|e }}" title="{% trans "edit tags" %}">✎</a> |
25 | </aside> | 25 | </aside> |
26 | <article> | 26 | <article> |
27 | {{ content | raw }} | 27 | {{ content | raw }} |