Merge pull request #261 from coreos-inc/decibel

Small improvements for the table view
This commit is contained in:
Jimmy Zelinskie 2015-07-22 14:35:16 -04:00
commit d19da364bd
3 changed files with 14 additions and 3 deletions

View file

@ -29,4 +29,8 @@
.repo-list-table .popularity {
line-height: 10px;
}
.repo-list-table .repo-star i {
color: #ccc;
}

View file

@ -43,7 +43,8 @@
<span class="empty" ng-if="!repository.last_modified">(Empty Repository)</span>
</td>
<td class="popularity hidden-xs">
<span class="strength-indicator" value="repository.popularity" maximum="maxPopularity"></span>
<span class="strength-indicator" value="repository.popularity" maximum="maxPopularity"
log-base="10"></span>
</td>
<td>
<span class="repo-star" repository="repository"

View file

@ -10,7 +10,8 @@ angular.module('quay').directive('strengthIndicator', function () {
restrict: 'C',
scope: {
'value': '=value',
'maximum': '=maximum'
'maximum': '=maximum',
'logBase': '=logBase'
},
controller: function($scope, $element) {
$scope.strengthClass = '';
@ -22,8 +23,13 @@ angular.module('quay').directive('strengthIndicator', function () {
}
var value = Math.round(($scope.value / $scope.maximum) * 4);
if ($scope.logBase) {
var currentValue = Math.log($scope.value) / Math.log($scope.logBase * 1);
var maximum = Math.log($scope.maximum) / Math.log($scope.logBase * 1);
value = Math.round((currentValue / maximum) * 4);
}
if (value <= 0) {
if (value <= 0) {
$scope.strengthClass = 'none';
return;
}