Add ability to display and edit the team's description
This commit is contained in:
parent
fd68564b3f
commit
97fa69a361
5 changed files with 72 additions and 13 deletions
|
@ -1404,6 +1404,12 @@ p.editable:hover i {
|
|||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.org-view .team-listing .team-description {
|
||||
margin-top: 6px;
|
||||
margin-left: 37px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Overrides for typeahead to work with bootstrap 3. */
|
||||
|
||||
.twitter-typeahead .tt-query,
|
||||
|
|
|
@ -688,7 +688,7 @@ function UserAdminCtrl($scope, $timeout, Restangular, PlanService, UserService,
|
|||
$scope.planUsagePercent = sub.usedPrivateRepos * 100 / $scope.subscribedPlan.privateRepos;
|
||||
|
||||
if (sub.usedPrivateRepos > $scope.subscribedPlan.privateRepos) {
|
||||
$scope.errorMessage = 'You are using more private repositories than your plan allows, please upgrate your subscription to avoid disruptions in your service.';
|
||||
$scope.errorMessage = 'You are using more private repositories than your plan allows, please upgrade your subscription to avoid disruptions in your service.';
|
||||
} else {
|
||||
$scope.errorMessage = null;
|
||||
}
|
||||
|
@ -1131,10 +1131,22 @@ function TeamViewCtrl($rootScope, $scope, Restangular, $routeParams) {
|
|||
});
|
||||
};
|
||||
|
||||
$scope.updateForDescription = function(content) {
|
||||
$scope.organization.teams[teamname].description = content;
|
||||
|
||||
var updateTeam = Restangular.one(getRestUrl('organization', orgname, 'team', teamname));
|
||||
var data = $scope.organization.teams[teamname];
|
||||
updateTeam.customPUT(data).then(function(resp) {
|
||||
}, function() {
|
||||
$('#cannotChangeTeamModal').modal({});
|
||||
});
|
||||
};
|
||||
|
||||
var loadOrganization = function() {
|
||||
var getOrganization = Restangular.one(getRestUrl('organization', orgname))
|
||||
getOrganization.get().then(function(resp) {
|
||||
$scope.organization = resp;
|
||||
$scope.team = $scope.organization.teams[teamname];
|
||||
$scope.loading = !$scope.organization || !$scope.members;
|
||||
}, function() {
|
||||
$scope.organization = null;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="org-view container" ng-show="!loading && organization">
|
||||
<div class="organization-header" organization="organization"></div>
|
||||
|
||||
<div class="team-listing" ng-repeat="team in organization.teams">
|
||||
<div class="team-listing" ng-repeat="(name, team) in organization.teams">
|
||||
<div class="team-title">
|
||||
<i class="fa fa-group"></i>
|
||||
<span ng-show="team.can_view">
|
||||
|
@ -19,6 +19,6 @@
|
|||
{{ team.name }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="team-description markdown-view" content="team.description"></div>
|
||||
<div class="team-description markdown-view" content="team.description" first-line-only="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
<div class="team-view container" ng-show="!loading && organization">
|
||||
<div class="organization-header" organization="organization" team-name="teamname"></div>
|
||||
|
||||
<div class="description markdown-input" content="team.description" can-write="organization.is_admin"
|
||||
content-changed="updateForDescription" field-title="'team description'"></div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Team Members
|
||||
<i class="info-icon fa fa-info-circle" data-placement="left" data-content="Users that inherit all permissions delegated to this team"></i>
|
||||
|
@ -39,6 +42,24 @@
|
|||
</div>
|
||||
|
||||
|
||||
<!-- Modal message dialog -->
|
||||
<div class="modal fade" id="cannotChangeTeamModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Cannot change team</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
You do not have permission to change properties of this team.
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal message dialog -->
|
||||
<div class="modal fade" id="cannotChangeMembersModal">
|
||||
<div class="modal-dialog">
|
||||
|
|
Reference in a new issue