qa: new button to speed up +1
This commit is contained in:
parent
7c51ce7c4f
commit
70afa61814
@ -395,6 +395,22 @@ angular.module("FICApp")
|
||||
})
|
||||
}
|
||||
|
||||
$scope.thumbUp = function(qid) {
|
||||
$http({
|
||||
url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[qid].id + "/comments",
|
||||
method: "POST",
|
||||
data: { "content": "+1" },
|
||||
}).then(function(response) {
|
||||
$http({
|
||||
url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments"
|
||||
}).then(function(response) {
|
||||
$scope.queries_comments = response.data
|
||||
})
|
||||
}, function(response) {
|
||||
$scope.addToast('danger', 'An error occurs when trying to respond to QA entry:', response.data.errmsg);
|
||||
})
|
||||
}
|
||||
|
||||
$scope.updateQA = function(qid) {
|
||||
$scope.newQuery = $scope.queries[$scope.query_selected]
|
||||
}
|
||||
|
@ -38,11 +38,15 @@
|
||||
<th ng-repeat="field in fields">
|
||||
{{ field }}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-if="queries.length">
|
||||
<tr ng-repeat="(qid, q) in queries" ng-click="showComments(qid)" ng-class="{'bg-warning': qid == query_selected}">
|
||||
<td ng-repeat="field in fields" ng-bind-html="q[field]"></td>
|
||||
<td>
|
||||
<button type="button" ng-click="thumbUp(qid)" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody ng-if="!queries.length">
|
||||
|
Loading…
Reference in New Issue
Block a user