Toggle for add permissions dialog

Fixes #1553
This commit is contained in:
Joseph Schorr 2016-06-20 14:33:40 -04:00
parent af430d26fe
commit 41ae47c995
4 changed files with 43 additions and 2 deletions

View file

@ -1107,6 +1107,19 @@ a:focus {
text-align: center;
}
.co-table .checkbox-col .co-checkable-menu a {
color: black;
text-transform: none;
}
.co-table thead td.checkbox-menu-col:after {
display: none;
}
.co-table .offset-check-col {
padding-left: 22px;
}
.co-table td.options-col {
width: 36px;
text-align: center;

View file

@ -31,7 +31,19 @@
<table class="co-table" style="margin-bottom: 210px;">
<thead>
<td class="checkbox-col"></td>
<td class="checkbox-col checkbox-menu-col">
<span class="cor-checkable-menu" controller="checkedRepos">
<div class="cor-checkable-menu-item" item-filter="allRepositoriesFilter(item)">
<i class="fa fa-check-square-o"></i>All Repositories
</div>
<div class="cor-checkable-menu-item" item-filter="noRepositoriesFilter(item)">
<i class="fa fa-square-o"></i>No Repositories
</div>
<div class="cor-checkable-menu-item" item-filter="missingPermsRepositoriesFilter(item)">
<i class="fa fa-circle-o"></i>Missing Permissions
</div>
</span>
</td>
<td ng-class="TableService.tablePredicateClass('name', options.predicate, options.reverse)">
<a ng-click="TableService.orderBy('name', options)">Repository Name</a>
</td>
@ -45,7 +57,7 @@
ng-repeat="repo in orderedRepositories.visibleEntries"
ng-class="checkedRepos.isChecked(repo, checkedRepos.checked) ? 'checked' : ''"
bindonce>
<td>
<td class="offset-check-col">
<span class="cor-checkable-item" controller="checkedRepos" item="repo"></span>
</td>
<td>

View file

@ -659,6 +659,10 @@ angular.module("core-ui", [])
},
controller: function($rootScope, $scope, $element) {
$scope.getClass = function(items, checked) {
if (!checked) {
return 'none';
}
if (checked.length == 0) {
return 'none';
}

View file

@ -175,6 +175,18 @@ angular.module('quay').directive('createEntityDialog', function () {
});
};
$scope.allRepositoriesFilter = function(item) {
return true;
};
$scope.noRepositoriesFilter = function(item) {
return false;
};
$scope.missingPermsRepositoriesFilter = function(item) {
return !item.perm;
};
$scope.$watch('options.predicate', setRepoState);
$scope.$watch('options.reverse', setRepoState);
$scope.$watch('options.filter', setRepoState);