Delink the build-mini-status if the user is not the repo admin

This commit is contained in:
Joseph Schorr 2015-03-18 15:43:53 -04:00
parent ab2331a486
commit 99c56b7f98
3 changed files with 19 additions and 5 deletions

View file

@ -1,5 +1,17 @@
<a class="build-mini-status-element" href="/repository/{{ build.repository.namespace }}/{{ build.repository.name }}/build/{{ build.id }}">
<div>
<span class="build-mini-status-element">
<a href="/repository/{{ build.repository.namespace }}/{{ build.repository.name }}/build/{{ build.id }}"
ng-if="is_admin">
<div>
<span class="build-state-icon" build="build"></span>
<span class="timing">
<i class="fa fa-clock-o"></i><span am-time-ago="build.started || 0"></span>
</span>
<div class="build-description triggered-build-description" build="build"></div>
</div>
</a>
<div ng-if="!is_admin">
<span class="build-state-icon" build="build"></span>
<span class="timing">
<i class="fa fa-clock-o"></i><span am-time-ago="build.started || 0"></span>
@ -7,4 +19,4 @@
<div class="build-description triggered-build-description" build="build"></div>
</div>
</a>
</span>

View file

@ -48,7 +48,8 @@
<!-- Builds -->
<div ng-if="builds && builds.length">
<div class="build-mini-status" ng-repeat="build in builds" build="build"></div>
<div class="build-mini-status" ng-repeat="build in builds" build="build"
is-admin="repository.can_admin"></div>
</div>
<!-- View All -->

View file

@ -9,7 +9,8 @@ angular.module('quay').directive('buildMiniStatus', function () {
transclude: false,
restrict: 'C',
scope: {
'build': '=build'
'build': '=build',
'isAdmin': '=isAdmin'
},
controller: function($scope, $element) {
$scope.isBuilding = function(build) {