mirror of
https://github.com/sismics/docs.git
synced 2025-12-22 14:11:39 +00:00
Closes #252: route model permissions
This commit is contained in:
@@ -59,26 +59,6 @@ angular.module('docs').controller('SettingsWorkflowEdit', function($scope, $dial
|
||||
return $stateParams.id;
|
||||
};
|
||||
|
||||
/**
|
||||
* In edit mode, load the current workflow.
|
||||
*/
|
||||
if ($scope.isEdit()) {
|
||||
Restangular.one('routemodel', $stateParams.id).get().then(function (data) {
|
||||
$scope.workflow = data;
|
||||
$scope.workflow.steps = JSON.parse(data.steps);
|
||||
_.each($scope.workflow.steps, function (step) {
|
||||
if (!step.transitions) {
|
||||
// Patch for old route models
|
||||
$scope.updateTransitions(step);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$scope.workflow = {
|
||||
steps: []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the current workflow.
|
||||
*/
|
||||
@@ -188,4 +168,25 @@ angular.module('docs').controller('SettingsWorkflowEdit', function($scope, $dial
|
||||
Restangular.one('tag/list').get().then(function(data) {
|
||||
$scope.tags = data.tags;
|
||||
});
|
||||
|
||||
/**
|
||||
* In edit mode, load the current workflow.
|
||||
*/
|
||||
if ($scope.isEdit()) {
|
||||
Restangular.one('routemodel', $stateParams.id).get().then(function (data) {
|
||||
$scope.workflow = data;
|
||||
$scope.workflow.steps = JSON.parse(data.steps);
|
||||
_.each($scope.workflow.steps, function (step) {
|
||||
if (!step.transitions) {
|
||||
// Patch for old route models
|
||||
$scope.updateTransitions(step);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$scope.workflow = {
|
||||
steps: []
|
||||
};
|
||||
$scope.addStep();
|
||||
}
|
||||
});
|
||||
@@ -311,7 +311,8 @@
|
||||
"target_help": "<strong>Approve:</strong> Accept or reject the review<br/><strong>Validate:</strong> Review and continue the workflow",
|
||||
"add_step": "Add a workflow step",
|
||||
"actions": "What happens after?",
|
||||
"remove_action": "Remove action"
|
||||
"remove_action": "Remove action",
|
||||
"acl_info": "Only users and groups defined here will be able to start this workflow on a document"
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
|
||||
@@ -136,6 +136,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default mt-30" ng-show="isEdit()">
|
||||
<div class="panel-body">
|
||||
<p translate="settings.workflow.edit.acl_info"></p>
|
||||
<acl-edit source="workflow.id"
|
||||
acls="workflow.acls"
|
||||
writable="workflow.writable"
|
||||
creator="workflow.creator"></acl-edit>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix form-group mt-10">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary" ng-click="edit()" ng-disabled="!editWorkflowForm.$valid">
|
||||
|
||||
@@ -607,6 +607,10 @@ input[readonly].share-link {
|
||||
margin-bottom: 19px;
|
||||
}
|
||||
|
||||
.mt-30 {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.ml-10 {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user