- Fix namespace drop down to save the namespace last selected (and validate)

- 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
This commit is contained in:
Joseph Schorr 2013-11-07 00:49:13 -05:00
parent 4b460be4dd
commit 0c4dec6de4
10 changed files with 89 additions and 14 deletions

View file

@ -10,11 +10,17 @@
{{namespace}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="org in user.organizations">
<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>
<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>