Add the team membership to the robots view

This commit is contained in:
Joseph Schorr 2015-04-01 13:56:30 -04:00
parent e6354571f6
commit fde9666647
6 changed files with 112 additions and 28 deletions

View file

@ -28,16 +28,17 @@
<table class="co-table" ng-if="robots.length">
<thead>
<td class="caret-col" ng-if="organization.is_admin"></td>
<td class="caret-col" ng-if="organization.is_admin && Config.isNewLayout()"></td>
<td>Robot Account Name</td>
<td>Repository Permissions</td>
<td ng-if="organization && Config.isNewLayout()">Teams</td>
<td ng-if="Config.isNewLayout()">Repository Permissions</td>
<td class="options-col"></td>
</thead>
<tbody ng-repeat="robotInfo in robots">
<tr ng-class="robotInfo.showing_permissions ? 'open' : 'closed'">
<td class="caret-col" ng-if="organization.is_admin">
<span ng-if="robotInfo.permission_count > 0" ng-click="showPermissions(robotInfo)">
<td class="caret-col" ng-if="organization.is_admin && Config.isNewLayout()">
<span ng-if="robotInfo.repositories.length > 0" ng-click="showPermissions(robotInfo)">
<i class="fa"
ng-class="robotInfo.showing_permissions ? 'fa-caret-down' : 'fa-caret-right'"
data-title="View Permissions List" bs-tooltip></i>
@ -49,13 +50,29 @@
<span class="prefix">{{ getPrefix(robotInfo.name) }}+</span>{{ getShortenedName(robotInfo.name) }}
</a>
</td>
<td>
<span class="empty" ng-if="robotInfo.permission_count == 0">(No permissions on any repositories)</span>
<span ng-if="robotInfo.permission_count > 0">
<td ng-if="organization && Config.isNewLayout()">
<span class="empty" ng-if="robotInfo.teams.length == 0">
(Not a member of any team)
</span>
<span class="empty" ng-if="robotInfo.teams.length > 0">
<span ng-repeat="team in robotInfo.teams"
data-title="Team {{ team.name }}" bs-tooltip>
<span class="anchor" is-text-only="!organization.admin" href="/organization/{{ organization.name }}/teams/{{ team.name }}">
<span class="avatar" size="24" data="team.avatar"></span>
</span>
</span>
</span>
</td>
<td ng-if="Config.isNewLayout()">
<span class="empty" ng-if="robotInfo.repositories.length == 0">
(No permissions on any repositories)
</span>
<span class="member-perm-summary" ng-if="robotInfo.repositories.length > 0">
Permissions on
<span class="anchor" href="javascript:void(0)" is-text-only="!organization.is_admin" ng-click="showPermissions(robotInfo)">{{ robotInfo.permission_count }}
<span ng-if="robotInfo.permission_count == 1">repository</span>
<span ng-if="robotInfo.permission_count > 1">repositories</span>
<span class="anchor" href="javascript:void(0)" is-text-only="!organization.is_admin" ng-click="showPermissions(robotInfo)">{{ robotInfo.repositories.length }}
<span ng-if="robotInfo.repositories.length == 1">repository</span>
<span ng-if="robotInfo.repositories.length > 1">repositories</span>
</span>
</span>
</td>