]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[add] edit tags page
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Fri, 6 Dec 2013 13:03:14 +0000 (14:03 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Fri, 6 Dec 2013 13:03:14 +0000 (14:03 +0100)
inc/poche/Poche.class.php
inc/poche/Tools.class.php
themes/default/edit-tags.twig [new file with mode: 0644]
themes/default/view.twig

index 802ec542f462d44f7119dd6f87e8288e1994e928..5d36884273ce677ee63163a184da484fcff9ea3e 100644 (file)
@@ -430,6 +430,13 @@ class Poche
                 );
                 Tools::logm('config view');
                 break;
+            case 'edit-tags':
+                # tags
+                $tags = $this->store->retrieveTagsByEntry($id);
+                $tpl_vars = array(
+                    'tags' => $tags,
+                );
+                break;
             case 'tags':
                 $tags = $this->store->retrieveAllTags();
                 $tpl_vars = array(
index 5bb65fe9a743e272c94203cca5dca21c36466602..9d9116990292c74c52fdaaca4cd71f1dc03e769e 100644 (file)
@@ -106,6 +106,9 @@ class Tools
             case 'tags':
                 $tpl_file = 'tags.twig';
                 break;
+            case 'edit-tags':
+                $tpl_file = 'edit-tags.twig';
+                break;
             case 'view':
                 $tpl_file = 'view.twig';
                 break;
diff --git a/themes/default/edit-tags.twig b/themes/default/edit-tags.twig
new file mode 100644 (file)
index 0000000..0bd1aba
--- /dev/null
@@ -0,0 +1,18 @@
+{% extends "layout.twig" %}
+{% block title %}edit tags{% endblock %}
+{% block menu %}
+{% include '_menu.twig' %}
+{% endblock %}
+{% block content %}
+{% if tags is empty %}
+no tags
+{% endif %}
+<ul>
+{% for tag in tags %}<li>{{ tag.value }} <a href="#">✘</a></li>{% endfor %}
+</ul>
+<form method="post" action="#">
+    <label for="value">New tags: </label><input type="text" id="value" name="value" required="required" />
+    {% trans "you can type several tags, separated by comma" %}<br />
+    <input type="submit" value="add tags" />
+</form>
+{% endblock %}
\ No newline at end of file
index 5a7c9165d714cf8fce44cc47fa58f6ae07005e45..9f9e23c8166b8a55d2d73dd0bebdfc3b48101f07 100644 (file)
@@ -21,7 +21,7 @@
                 <h1>{{ entry.title|raw }}</h1>
             </header>
             <aside class="tags">
-                tags: {% for tag in tags %}<a href="#">{{ tag.value }}</a> {% endfor %}<a href="#" title="{% trans "edit tags" %}">✎</a>
+                tags: {% for tag in tags %}<a href="#">{{ tag.value }}</a> {% endfor %}<a href="./?&amp;view=edit-tags&amp;id={{ entry.id|e }}" title="{% trans "edit tags" %}">✎</a>
             </aside>
             <article>
                 {{ content | raw }}