From 060f3a9ff292091802654a87ce209cf2ff119769 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 2 Oct 2013 01:05:36 -0400 Subject: [PATCH] Add the tag count to the tag icon in the repo view --- static/css/quay.css | 19 +++++++++++++++++++ static/js/controllers.js | 11 ++++++++++- static/partials/view-repo.html | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/static/css/quay.css b/static/css/quay.css index 51f71c9c9..df169c03e 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -305,6 +305,25 @@ p.editable:hover i { border: 1px solid #ddd; margin-right: 15px; margin-bottom: 5px; + font-size: 1.15em; +} + +.tag-dropdown i.icon-bookmark { + font-size: 125%; + position: relative; + margin-left: 2px; + margin-right: 4px; +} + +.tag-dropdown i.icon-bookmark .tag-count { + color: #aaa; + position: absolute; + top: 0px; + left: 0px; + font-size: 55%; + display: inline-block; + width: 14px; + text-align: center; } .modal-body textarea { diff --git a/static/js/controllers.js b/static/js/controllers.js index 594c98ec7..f23400b6e 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -231,6 +231,15 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) { }); }; + $scope.getTagCount = function(repo) { + if (!repo) { return 0; } + var count = 0; + for (var tag in repo.tags) { + ++count; + } + return count; + }; + var namespace = $routeParams.namespace; var name = $routeParams.name; var tag = $routeParams.tag || 'latest'; @@ -389,7 +398,7 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) { $('#cannotchangeModal').modal({}); }); }; - + $('.spin').spin(); $scope.loading = true; diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index e0d33f9bb..17af414bd 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -59,7 +59,7 @@