diff --git a/app/assets/javascripts/application/collections.coffee b/app/assets/javascripts/application/collections.coffee index 0289e4e56c771c88f98948a2259740103a4cf2af..cb07ce3352406fda2aa39219941e727a641f371a 100644 --- a/app/assets/javascripts/application/collections.coffee +++ b/app/assets/javascripts/application/collections.coffee @@ -172,6 +172,13 @@ $(document).on 'refresh_comments', (e) -> $.get url, (data) -> $parent.html('<br>' + data) + num = $('.learning-object-vertical').length + if num == 0 + $('.object-number').html("coleção vazia") + else if num == 1 + $('.object-number').html("1 objeto") + else + $('.object-number').html( num + " objetos") $(document).trigger 'create-learning-object-columns' $(document).trigger 'add_collection_selector' diff --git a/app/views/bookmarks/show.html.erb b/app/views/bookmarks/show.html.erb index db21f6fefae40a4476214574027cbdbf157b6a8b..e82c8621ed7bb0c887a9ca7e9a365fca62ce7d74 100644 --- a/app/views/bookmarks/show.html.erb +++ b/app/views/bookmarks/show.html.erb @@ -7,7 +7,7 @@ <li><h2>Favoritos</h2></li> <li> <input type="checkbox" class="count-collections-objects" data-toggle="tooltip" data-placement="bottom" title="Selecionar todos"> - <%= bookmark_length @user %> + <span class="object-number"><%= bookmark_length @user %></span> </li> </ul> </div> diff --git a/app/views/collections/show.html.erb b/app/views/collections/show.html.erb index 6c38c9115ef3fcb632c965a3d1a6c3ee82d0e5a9..8957332fafc2c77d830f26d4ef793f270612be22 100644 --- a/app/views/collections/show.html.erb +++ b/app/views/collections/show.html.erb @@ -29,8 +29,8 @@ <li><h2><%= (@collection.class != Bookmark) ? @collection.name : "Favoritos" %></h2></li> <li> <input type="checkbox" class="count-collections-objects" data-toggle="tooltip" data-placement="bottom" title="Selecionar todos"> - <%= collection_length @collection %> - </a> + <span class="object-number"><%= collection_length @collection %> + </span> </li> </ul> </div>