Streamline and cleanup the entity-reference so it can be used everywhere in a simple fashion. Also changes the entity-search to use the reference as its icon source when in persistent mode

This commit is contained in:
Joseph Schorr 2014-01-21 16:23:00 -05:00
parent c2928a96d0
commit 74df6b1df7
11 changed files with 87 additions and 46 deletions

View file

@ -1,8 +1,19 @@
<span class="entity-reference-element">
<i class="fa fa-user" ng-show="!team && !isrobot" title="User" bs-tooltip="tooltip.title" data-container="body"></i>
<i class="fa fa-wrench" ng-show="!team && isrobot" title="Robot Account" bs-tooltip="tooltip.title" data-container="body"></i>
<i class="fa fa-group" ng-show="team" title="Team" bs-tooltip="tooltip.title" data-container="body"></i>
<span ng-show="team && getIsAdmin(orgname)"><a href="/organization/{{ orgname }}/teams/{{ team }}">{{team}}</a></span>
<span ng-show="team && !getIsAdmin(orgname)">{{team}}</span>
<span ng-show="isrobot" class="prefix">{{getPrefix(name)}}</span><span>{{getShortenedName(name)}}</span>
<span ng-show="entity.kind == 'team'">
<i class="fa fa-group" title="Team" bs-tooltip="tooltip.title" data-container="body"></i>
<span class="entity-name">
<span ng-show="!getIsAdmin(namespace)">{{entity.name}}</span>
<span ng-show="getIsAdmin(namespace)"><a href="/organization/{{ namespace }}/teams/{{ entity.name }}">{{entity.name}}</a></span>
</span>
</span>
<span ng-show="entity.kind != 'team'">
<i class="fa fa-user" ng-show="!entity.is_robot" title="User" bs-tooltip="tooltip.title" data-container="body"></i>
<i class="fa fa-wrench" ng-show="entity.is_robot" title="Robot Account" bs-tooltip="tooltip.title" data-container="body"></i>
<span class="entity-name">
<span ng-show="entity.is_robot" class="prefix">{{getPrefix(entity.name)}}</span><span>{{getShortenedName(entity.name)}}</span>
</span>
</span>
<i class="fa fa-exclamation-triangle" ng-show="entity.is_org_member === false"
title="This user is not a member of the organization" bs-tooltip="tooltip.title" data-container="body">
</i>
</span>

View file

@ -1,12 +1,5 @@
<span class="entity-search-element" ng-class="isPersistent ? 'persistent' : ''"><input class="entity-search-control form-control">
<span class="entity-icon" ng-show="isPersistent">
<i class="fa fa-user" ng-show="currentEntity.kind == 'user' && !currentEntity.is_robot" title="User"
bs-tooltip="tooltip.title" data-container="body"></i>
<i class="fa fa-wrench" ng-show="currentEntity.kind == 'user' && currentEntity.is_robot" title="Robot Account"
bs-tooltip="tooltip.title" data-container="body"></i>
<i class="fa fa-group" ng-show="currentEntity.kind == 'team'" title="Team"
bs-tooltip="tooltip.title" data-container="body"></i>
</span>
<span class="entity-reference block-reference" ng-show="isPersistent && currentEntity" entity="currentEntity"></span>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="entityDropdownMenu" data-toggle="dropdown"
ng-click="lazyLoad()">

View file

@ -54,7 +54,7 @@
<td>{{ log.datetime }}</td>
<td>
<span ng-show="log.performer">
<span class="entity-reference" name="log.performer.username" isrobot="log.performer.is_robot"></span>
<span class="entity-reference" entity="log.performer" namespace="organization.name"></span>
</span>
<span ng-show="!log.performer && log.metadata.token">
<i class="fa fa-key"></i>

View file

@ -33,14 +33,10 @@
<tr ng-repeat="prototype in prototypes">
<td>
<span class="entity-reference" orgname="organization.name" name="prototype.activating_user.name"
isrobot="prototype.activating_user.is_robot"></span>
<span class="entity-reference block-reference" entity="prototype.activating_user" namespace="organization.name"></span>
</td>
<td>
<span class="entity-reference" orgname="organization.name"
name="prototype.delegate.kind == 'team' ? null :prototype.delegate.name"
team="prototype.delegate.kind == 'team' ? prototype.delegate.name : null"
isrobot="prototype.delegate.is_robot"></span>
<span class="entity-reference block-reference" entity="prototype.delegate" namespace="organization.name"></span>
</td>
<td>
<span class="role-group" current-role="prototype.role" role-changed="setRole(role, prototype)" roles="roles"></span>
@ -66,9 +62,9 @@
<div class="modal-body">
<table>
<tr>
<td>Activating User/Robot:</td>
<td>Creating User/Robot:</td>
<td>
<span class="entity-search" namespace="organization.name" input-title="'Activating User/Robot'"
<span class="entity-search" namespace="organization.name" input-title="'Creating User/Robot'"
is-organization="true" include-teams="false" current-entity="activatingForNew" is-persistent="true"
clear-now="clearCounter">
</span>