Commit ee2336e7 authored by Nezael's avatar Nezael
Browse files

We can nom change name of paperboard

An icon was added near the delete one, on click a prompt comes in order for the user to type the new name wanted.
parent 86cbc357
......@@ -65,7 +65,17 @@
<div class="group-tutor-icons">
<div style="display: inline-block;text-align: right;width:48%">
<div style="display: inline-block;text-align: right;width:5%;">
<p class="custom-tooltip smalltooltip"
ng-click="workshopsCtrl.modifyWorkshopName(workshop);">
<i class="fa fa-edit" aria-hidden="true"></i>
<span class="tooltiptext">{{::_labels.modifyWorkshopName}}</span>
</p>
</div>
<div style="display: inline-block;text-align: right;width:5%">
<p class="custom-tooltip smalltooltip"
ng-click="workshopsCtrl.deleteWorkshop(workshop);">
......
......@@ -196,4 +196,16 @@ root.controller('OverviewWorkshopCtrl', ['$scope', '$stateParams', '$http', '$wo
workshopsCtrl.currentWorkshop = workshop;
}
workshopsCtrl.modifyWorkshopName = function(workshop){
let newName = prompt($languageFactory._labels.newWorkshopName);
if(newName != null)
{
$paperboardFactory.modifyPaperBoardName($scope._getProject(), workshop.id, newName, function (data){
if (data.status == "success"){
workshopsCtrl.refreshWorkshops("all");
}
});
}
}
}]);
......@@ -18,6 +18,14 @@ function $paperboardFactory($rootScope, $serverFactory) {
}, success, failure);
};
returns.modifyPaperBoardName = function (projectId, id, params, success, failure){
return $serverFactory.runCommand("put_paperboard_name", {
projectId: projectId,
id: id,
params: params
}, success, failure);
};
/**
* [getPaperboard description]
* @param {[int]} projectId [description]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment