diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index bf323c49c..4ec724f9f 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -466,6 +466,26 @@ class Poche } $tags = $this->store->retrieveTagsByEntry($id); $all_tags = $this->store->retrieveAllTags($this->user->getId()); + $maximus = 0; + foreach ($all_tags as $eachtag) { // search for the most times a tag is present + if ($eachtag["entriescount"] > $maximus) $maximus = $eachtag["entriescount"]; + } + foreach ($all_tags as $key => $eachtag) { // get the percentage of presence of each tag + $percent = floor(($eachtag["entriescount"] / $maximus) * 100); + + if ($percent < 20): // assign a css class, depending on the number of entries count + $cssclass = 'smallesttag'; + elseif ($percent >= 20 and $percent < 40): + $cssclass = 'smalltag'; + elseif ($percent >= 40 and $percent < 60): + $cssclass = 'mediumtag'; + elseif ($percent >= 60 and $percent < 80): + $cssclass = 'largetag'; + else: + $cssclass = 'largesttag'; + endif; + $all_tags[$key]['cssclass'] = $cssclass; + } $tpl_vars = array( 'entry_id' => $id, 'tags' => $tags, diff --git a/themes/_global/js/autoCompleteTags.js b/themes/_global/js/autoCompleteTags.js index 986e71d15..8b32f8ca8 100755 --- a/themes/_global/js/autoCompleteTags.js +++ b/themes/_global/js/autoCompleteTags.js @@ -48,6 +48,9 @@ jQuery(function($) { var value = input.val(); var tag = $(this).text(); var terms = value.split(','); // tags into the + $(".alreadytagged").each(function(index) { + terms.push($(this).text() ); + }); if (jQuery.inArray(tag, terms) == -1 ) { // if the tag hasn't already been added value += tag + ","; input.val(value); diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 5319fd681..91c1ab9f3 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css @@ -960,6 +960,35 @@ pre code { font-size: 0.96em; } +/* ========================================================================== + 5.1 = Tags-related styles + ========================================================================== */ + +.suggestedtag { + padding: 4px; + cursor: pointer; + display: inline-block; +} + +#tagcloud .smallesttag { + font-size: x-small; +} + +#tagcloud .smalltag { + font-size: small; +} + +#tagcloud .mediumtag { + font-size:medium; +} + +#tagcloud .largetag { + font-size:large; +} + +#tagcloud .largesttag { + font-size:larger; +} /* ========================================================================== 6 = Media Queries diff --git a/themes/baggy/edit-tags.twig b/themes/baggy/edit-tags.twig index ae6684f2a..3b829eaed 100755 --- a/themes/baggy/edit-tags.twig +++ b/themes/baggy/edit-tags.twig @@ -26,6 +26,6 @@ {% trans "You can enter multiple tags, separated by commas." %}
All existing tags : -