aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xinc/poche/Poche.class.php2
-rwxr-xr-xthemes/_global/js/autoCompleteTags.js14
-rwxr-xr-xthemes/baggy/edit-tags.twig4
3 files changed, 19 insertions, 1 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index c6c91c4a..bf323c49 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -465,9 +465,11 @@ class Poche
465 Tools::redirect(); 465 Tools::redirect();
466 } 466 }
467 $tags = $this->store->retrieveTagsByEntry($id); 467 $tags = $this->store->retrieveTagsByEntry($id);
468 $all_tags = $this->store->retrieveAllTags($this->user->getId());
468 $tpl_vars = array( 469 $tpl_vars = array(
469 'entry_id' => $id, 470 'entry_id' => $id,
470 'tags' => $tags, 471 'tags' => $tags,
472 'alltags' => $all_tags,
471 'entry' => $entry, 473 'entry' => $entry,
472 ); 474 );
473 break; 475 break;
diff --git a/themes/_global/js/autoCompleteTags.js b/themes/_global/js/autoCompleteTags.js
index 90bc982c..986e71d1 100755
--- a/themes/_global/js/autoCompleteTags.js
+++ b/themes/_global/js/autoCompleteTags.js
@@ -43,5 +43,19 @@ jQuery(function($) {
43 } 43 }
44 }); 44 });
45 45
46 $('.suggestedtag').click(function(){
47 var input = $("#value");
48 var value = input.val();
49 var tag = $(this).text();
50 var terms = value.split(','); // tags into the <input>
51 if (jQuery.inArray(tag, terms) == -1 ) { // if the tag hasn't already been added
52 value += tag + ",";
53 input.val(value);
54 }
55 input.focus();
56 input[0].selectionStart = input[0].selectionEnd = input.val().length;
57
58 });
59
46 60
47}); 61});
diff --git a/themes/baggy/edit-tags.twig b/themes/baggy/edit-tags.twig
index 15f15560..ae6684f2 100755
--- a/themes/baggy/edit-tags.twig
+++ b/themes/baggy/edit-tags.twig
@@ -16,7 +16,7 @@
16<div class="notags">{% trans "no tags" %}</div> 16<div class="notags">{% trans "no tags" %}</div>
17{% endif %} 17{% endif %}
18<ul> 18<ul>
19{% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %} 19{% for tag in tags %}<li><span class="alreadytagged">{{ tag.value }}</span> <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %}
20</ul> 20</ul>
21<form method="post" action="./?action=add_tag"> 21<form method="post" action="./?action=add_tag">
22 <input type="hidden" name="entry_id" value="{{ entry_id }}" /> 22 <input type="hidden" name="entry_id" value="{{ entry_id }}" />
@@ -25,5 +25,7 @@
25 <p>{% trans "Start typing for auto complete." %}<br> 25 <p>{% trans "Start typing for auto complete." %}<br>
26 {% trans "You can enter multiple tags, separated by commas." %}</p> 26 {% trans "You can enter multiple tags, separated by commas." %}</p>
27</form> 27</form>
28All existing tags :
29<ul>{% for eachtag in alltags %}<li class="suggestedtag" style="display: inline-block; margin:10px;">{{ eachtag.value }}</li>{% endfor %}</ul>
28<a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> 30<a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a>
29{% endblock %} 31{% endblock %}