Browse Source

Evolution #817: Playlists: ne pas afficher tous les tags

Bastien Sevajol 11 years ago
parent
commit
8f39379424

+ 6 - 0
src/Muzich/CoreBundle/Resources/public/js/muzich.js View File

@@ -2568,6 +2568,12 @@ $(document).ready(function(){
2568 2568
     $(this).hide();
2569 2569
   });
2570 2570
   
2571
+  $('a.display_all_cloud_tag').click(function(){
2572
+    $(this).parents('ul.tags_cloud').find('li').show();
2573
+    $(this).parent().remove();
2574
+    return false;
2575
+  });
2576
+  
2571 2577
   $('input#cloud_tags_filter').keyup(function(){
2572 2578
     var search_string = $(this).val();
2573 2579
     

+ 15 - 1
src/Muzich/CoreBundle/Resources/views/Tag/tag_cloud.html.twig View File

@@ -1,10 +1,24 @@
1
+{% if tags_display_limit is not defined %}
2
+  {% set tags_display_limit = cloud_tags_limit_to_display %}
3
+{% endif %}
4
+
1 5
 <ul class="tags_cloud">
2 6
   {% for key, tag in tags %}
3
-    <li class="{{ css_list_length_class(key, tags|length) }}" {% if loop.index0 > cloud_tags_limit_to_display %}style="display: none;"{% endif %}>
7
+    <li class="{{ css_list_length_class(key, tags|length) }}" {% if loop.index0 > tags_display_limit %}style="display: none;"{% endif %}>
4 8
       <a data-tagid="{{ tag.id }}" href="#" class="tag">
5 9
         {{ tag.name }}
6 10
       </a>
7 11
     </li>
8 12
   {% endfor %}
13
+  
14
+  {% if (tags|length)-1 > tags_display_limit %}
15
+    
16
+    <li>
17
+      <a class="display_all_cloud_tag" href="#" class="tag">
18
+        ...
19
+      </a>
20
+    </li>
21
+  {% endif %}
22
+    
9 23
 </ul>
10 24
 <div class="clearboth" ></div>

+ 2 - 1
src/Muzich/PlaylistBundle/Resources/views/Show/user.html.twig View File

@@ -105,7 +105,8 @@
105 105
           
106 106
 
107 107
           {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
108
-            'tags' : playlist.tags
108
+            'tags' : playlist.tags,
109
+            'tags_display_limit' : playlist_tags_count_displayed_max
109 110
           } %}
110 111
 
111 112
         </li>