Add the tag count to the tag icon in the repo view

This commit is contained in:
Joseph Schorr 2013-10-02 01:05:36 -04:00
parent 7d6c9a88df
commit 060f3a9ff2
3 changed files with 30 additions and 2 deletions

View file

@ -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 {

View file

@ -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;

View file

@ -59,7 +59,7 @@
<ul class="nav nav-tabs">
<li>
<span class="tag-dropdown dropdown" title="Tags">
<i class="icon-bookmark"></i>
<i class="icon-bookmark"><span class="tag-count">{{getTagCount(repo)}}</span></i>
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">{{currentTag.name}} <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ng-repeat="tag in repo.tags">