Abstract out the display of entities (users, robot accounts, and teams) into a nice directive to ensure that we always display the correctly formatted entity information (icon and name)

This commit is contained in:
Joseph Schorr 2013-11-26 14:37:55 -05:00
parent 72acc8769b
commit d5c0f768c2
8 changed files with 63 additions and 35 deletions

View file

@ -52,8 +52,7 @@
<!-- Team Permissions -->
<tr ng-repeat="(name, permission) in permissions['team']">
<td class="team entity">
<i class="fa fa-group" title="Team" bs-tooltip="tooltip.title"></i>
<span><a href="/organization/{{ repo.namespace }}/teams/{{ name }}">{{name}}</a></span>
<span class="entity-reference" orgname="repo.namespace" team="name"></span>
</td>
<td class="user-permissions">
<span class="role-group" current-role="permission.role" role-changed="setRole(role, name, 'team')" roles="roles"></span>
@ -69,9 +68,7 @@
<!-- User Permissions -->
<tr ng-repeat="(name, permission) in permissions['user']">
<td class="{{ 'user entity ' + (permission.is_org_member ? '' : 'outside') }}">
<i class="fa fa-user" ng-show="!permission.is_robot" title="User" bs-tooltip="tooltip.title"></i>
<i class="fa fa-wrench" ng-show="permission.is_robot" title="Robot Account" bs-tooltip="tooltip.title"></i>
<span class="prefix">{{getPrefix(name)}}</span><span>{{getShortenedName(name)}}</span>
<span class="entity-reference" name="name" isrobot="permission.is_robot"></span>
<i class="fa fa-exclamation-triangle" ng-show="permission.is_org_member === false" data-trigger="hover" bs-popover="{'content': 'This user is not a member of the organization'}"></i>
</td>
<td class="user-permissions">