0c4dec6de4
- Add a "can_create_repo" entry to the organization and have orgs grayed out in the new repo view if the user cannot create a repo - Fix the multiple-orgs bug in the model - Have the "create new repository" button disappear on landing if the org is selected and the user does not have create permissions for that org
34 lines
1.6 KiB
HTML
34 lines
1.6 KiB
HTML
<span class="namespace-selector-dropdown">
|
|
<span ng-show="user.organizations.length == 0">
|
|
<img src="//www.gravatar.com/avatar/{{ user.gravatar }}?s=24&d=identicon" />
|
|
<span class="namespace-name">{{user.username}}</span>
|
|
</span>
|
|
|
|
<div class="btn-group" ng-show="user.organizations.length > 0">
|
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
|
<img src="//www.gravatar.com/avatar/{{ namespaceObj.gravatar }}?s=16&d=identicon" />
|
|
{{namespace}} <span class="caret"></span>
|
|
</button>
|
|
<ul class="dropdown-menu" role="menu">
|
|
<li class="namespace-item" ng-repeat="org in user.organizations"
|
|
ng-class="(requireCreate && !namespaces[org.name].can_create_repo) ? 'disabled' : ''">
|
|
<a class="namespace" href="javascript:void(0)" ng-click="setNamespace(org)">
|
|
<img src="//www.gravatar.com/avatar/{{ org.gravatar }}?s=24&d=identicon" />
|
|
<span class="namespace-name">{{ org.name }}</span>
|
|
</a>
|
|
|
|
<i class="fa fa-exclamation-triangle" ng-show="requireCreate && !namespaces[org.name].can_create_repo"
|
|
title="You do not have permission to create repositories for this organization"
|
|
data-placement="right"
|
|
bs-tooltip="tooltip.title"></i>
|
|
</li>
|
|
<li class="divider"></li>
|
|
<li>
|
|
<a class="namespace" href="javascript:void(0)" ng-click="setNamespace(user)">
|
|
<img src="//www.gravatar.com/avatar/{{ user.gravatar }}?s=24&d=identicon" />
|
|
<span class="namespace-name">{{ user.username }}</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</span>
|