Commit 995a05a6 authored by Nezael's avatar Nezael
Browse files

Merge branch '159-renommer-un-tableau-collaboratif' into paperboard

parents e06832b5 407d39b4
......@@ -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,31 @@ root.controller('OverviewWorkshopCtrl', ['$scope', '$stateParams', '$http', '$wo
workshopsCtrl.currentWorkshop = workshop;
}
/*
* Modify the name of the paperboard or the workshop, there id two different methods because paperboard is separated from every workshops
*/
workshopsCtrl.modifyWorkshopName = function(workshop){
let newName = prompt($languageFactory._labels.newWorkshopName);
if(newName != null)
{
if(workshop.type == 1)
{
$paperboardFactory.modifyPaperBoardName($scope._getProject(), workshop.id, newName, function (data){
if (data.status == "success"){
workshopsCtrl.refreshWorkshops("all");
}
});
}
else
{
$workshopFactory.modifyWorkshopName($scope._getProject(), workshop.id, newName, function (data){
if (data.status == "success"){
workshopsCtrl.refreshWorkshops("all");
}
});
}
}
}
}]);
......@@ -17,6 +17,20 @@ function $paperboardFactory($rootScope, $serverFactory) {
params: params
}, success, failure);
};
/**
* [modifyPaperBoardName : The aim of this method is to change the title of the paperboard in the DB]
* @param {[type]} projectId [id of the project]
* @param {[type]} id [id of the paperboard]
* @param {[type]} success [description]
* @param {[type]} failure [description]
*/
returns.modifyPaperBoardName = function (projectId, id, params, success, failure){
return $serverFactory.runCommand("put_paperboard_name", {
projectId: projectId,
id: id,
params: params
}, success, failure);
};
/**
* [getPaperboard description]
......
......@@ -126,6 +126,21 @@ function $workshopFactory($rootScope, $serverFactory) {
}, success, failure);
};
/**
* [modifyWorkshopName : The aim of this method is to change the title of the workshop in the DB]
* @param {[type]} projectId [id of the project]
* @param {[type]} id [id of the workshop]
* @param {[type]} success [description]
* @param {[type]} failure [description]
*/
returns.modifyWorkshopName = function (projectId, id, params, success, failure){
return $serverFactory.runCommand("put_workshop_name", {
projectId: projectId,
id: id,
params: params
}, success, failure);
};
return returns;
}
......
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