admin: Require to be identitied to change the history

This commit is contained in:
nemunaire 2024-03-17 11:20:38 +01:00
commit c638789b61
5 changed files with 44 additions and 8 deletions

View file

@ -516,6 +516,8 @@ angular.module("FICApp")
}, 750);
}
});
$rootScope.logged = parseInt(getCookie("myassignee")) > 0;
})
.controller("VersionController", function($scope, Version) {

View file

@ -85,7 +85,7 @@
<div class="btn-group mx-2" role="group">
<button type="button" ng-click="addChoice()" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter choix</button>
</div>
<div class="btn-group" role="group">
<div class="btn-group" role="group" ng-show="logged">
<button type="button" class="btn btn-sm btn-dark" data-toggle="modal" data-target="#validationModal" data-flag="{{ flag.label }}" data-flagid="{{ flag.id }}" data-kind="flag_found"><span class="glyphicon glyphicon-check" aria-hidden="true"></span> Valider pour &nbsp;</button>
</div>
</div>

View file

@ -306,11 +306,12 @@
</div>
</div>
<div class="mt-2" style="overflow-y: scroll; height: 450px" ng-controller="ExerciceHistoryController">
<div class="mt-2" style="overflow-y: scroll; height: 450px" id="exercicehistory" ng-controller="ExerciceHistoryController">
<div class="d-flex justify-content-between align-items-start">
<h3>Historique</h3>
<div class="btn-group" role="group">
<button type="button" class="btn btn-sm btn-dark" data-toggle="modal" data-target="#appendHistoryModal"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<button type="button" class="btn btn-sm btn-dark" data-toggle="modal" data-target="#appendHistoryModal" ng-show="logged"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<button type="button" class="btn btn-sm btn-primary" ng-click="refreshHistory()"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
</div>
</div>
<table class="table table-hover table-striped table-bordered bg-primary text-light">
@ -331,7 +332,7 @@
</span>
<span ng-if="!row.secondary_title && row.secondary && row.kind != 'solved'">: {{ row.secondary }}</span>
</td>
<td style="vertical-align: middle; padding: 0; background-color: {{ row.team_color }}">
<td style="vertical-align: middle; padding: 0; background-color: {{ row.team_color }}" ng-show="logged">
<button type="button" data-toggle="modal" data-target="#updHistory" ng-if="row.kind != 'flag_found' && row.kind != 'tries' && row.kind != 'mcq_found'" data-idteam="{{ row.team_id }}" data-kind="{{ row.kind }}" data-time="{{ row.time }}" data-secondary="{{ row.secondary }}" data-coeff="{{ row.coefficient }}" class="float-right btn btn-sm btn-info"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>
<button type="button" ng-click="delHistory(row)" class="float-right btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
</td>

View file

@ -168,7 +168,7 @@
<span ng-if="!row.secondary_title && row.secondary && row.kind == 'solved'">(coeff x{{ row.secondary }})</span>
<span ng-if="!row.secondary_title && row.secondary && row.kind != 'solved'">: {{ row.secondary }}</span>
</td>
<td style="vertical-align: middle; padding: 0">
<td style="vertical-align: middle; padding: 0" ng-show="logged">
<button type="button" data-toggle="modal" data-target="#updHistory" ng-if="row.kind != 'flag_found' && row.kind != 'tries' && row.kind != 'mcq_found'" data-kind="{{ row.kind }}" data-time="{{ row.time }}" data-primary="{{ row.primary }}" data-secondary="{{ row.secondary }}" data-coeff="{{ row.coefficient }}" class="float-right btn btn-sm btn-info"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>
<button type="button" ng-click="delHistory(row)" class="float-right btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
</td>