Merge "Add a notice when worklists or boards are private or archived"

This commit is contained in:
Jenkins 2016-09-08 16:04:16 +00:00 committed by Gerrit Code Review
commit 275780922d
5 changed files with 65 additions and 2 deletions

View File

@ -139,6 +139,16 @@ angular.module('sb.board').controller('BoardDetailController',
});
};
$scope.unarchive = function() {
$scope.board.archived = false;
$scope.board.$update().then(function() {
angular.forEach($scope.board.lanes, function(lane) {
lane.worklist.archived = false;
Worklist.update(lane.worklist);
});
});
};
/**
* Open a modal to handle archiving the board.
*/

View File

@ -14,6 +14,28 @@
~ under the License.
-->
<div class="container-fluid">
<div class="alert alert-warning" ng-show="board.archived">
<p>
<i class="fa fa-archive"></i>
<strong>This board is archived</strong>.
It can still be interacted with, but won't show up in search results.
</p>
<div class="text-center alert-button">
<button type="button"
class="btn btn-success"
ng-click="unarchive()"
ng-show="permissions.editBoard">
Unarchive this Board
</button>
</div>
</div>
<div class="alert alert-danger" ng-show="board.private">
<i class="fa fa-eye-slash"></i>
<strong>This board is private</strong>.
<span ng-show="permissions.editBoard">
Edit this board to change the privacy settings.
</span>
</div>
<div ng-include
src="'/inline/board_detail.html'"
ng-hide="showEditForm">

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Codethink Limited
* Copyright (c) 2015-2016 Codethink Limited
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
@ -83,6 +83,11 @@ angular.module('sb.worklist').controller('WorklistDetailController',
});
};
$scope.unarchive = function() {
$scope.worklist.archived = false;
$scope.worklist.$update();
};
/**
* Toggle edit mode on the worklist. If going on->off then
* save changes.

View File

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2015 Codethink Limited
~ Copyright (c) 2015-2016 Codethink Limited
~
~ Licensed under the Apache License, Version 2.0 (the "License"); you may
~ not use this file except in compliance with the License. You may obtain
@ -33,6 +33,28 @@
<script type="text/ng-template" id="/inline/worklist_title.html">
<div class="row">
<div class="col-sm-12" ng-show="!editing">
<div class="alert alert-warning" ng-show="worklist.archived">
<p>
<i class="fa fa-archive"></i>
<strong>This worklist is archived</strong>.
It can still be interacted with, but won't show up in search results.
</p>
<div class="text-center alert-button">
<button type="button"
class="btn btn-success"
ng-click="unarchive()"
ng-show="permissions.editWorklist">
Unarchive this Worklist
</button>
</div>
</div>
<div class="alert alert-danger" ng-show="worklist.private">
<i class="fa fa-eye-slash"></i>
<strong>This worklist is private</strong>.
<span ng-show="permissions.editWorklist">
Edit this worklist to change the privacy settings.
</span>
</div>
<h1 view-title>
{{worklist.title}}
<small ng-show="isLoggedIn">

View File

@ -303,3 +303,7 @@
}
}
}
.alert-button {
padding-top: 10px;
}