This commit is contained in:
Michele Artini 2022-09-21 10:52:13 +02:00
parent 05b408f4af
commit a4a4586127
2 changed files with 20 additions and 19 deletions

View File

@ -80,15 +80,15 @@
<td class="col-9" ng-if="currentUser.organization">{{currentUser.organization}}</td>
<td class="col-9 text-muted" ng-if="!currentUser.organization"><i>not specified</i></td>
</tr>
<tr class="d-flex">
<th class="col-3">Reference person</th>
<td class="col-9" ng-if="currentUser.referencePerson">>{{currentUser.referencePerson}}</td>
<td class="col-9 text-muted" ng-if="!currentUser.referencePerson"><i>not specified</i></td>
</tr>
<tr class="d-flex">
<th class="col-3">Registration Request</th>
<td class="col-9" ng-if="currentUser.referencePerson || currentUser.requestMessage">
<span ng-show="currentUser.referencePerson"><b>Reference person: </b>{{currentUser.referencePerson}}<br /></span>
<pre ng-show="currentUser.requestMessage">{{currentUser.requestMessage}}</pre>
</td>
<td class="col-9 text-muted" ng-if="!currentUser.referencePerson && !currentUser.requestMessage">
<i>not specified</i>
</td>
<td class="col-9" ng-if="currentUser.requestMessage"><pre>{{currentUser.requestMessage}}</pre></td>
<td class="col-9 text-muted" ng-if="!currentUser.requestMessage"><i>not specified</i></td>
</tr>
<tr class="d-flex">
<th class="col-3">Enabled</th>

View File

@ -48,7 +48,7 @@
Hello '<span th:text="${email}" id="current_user"></span>', you don't have a role yet <br />
To apply as data curator compile the form below, an administrator will authorize you as soon as possible.
</p>
<form class="small">
<div class="form-group row">
<label class="col-sm-2 col-form-label">Fullname</label>
@ -65,14 +65,14 @@
<div class="form-group row">
<label class="col-sm-2 col-form-label">Reference person</label>
<div class="col-sm-10">
<input type="text" class="form-control" ng-model="referencePerson">
<input type="text" class="form-control" ng-model="user.referencePerson" />
<small class="form-text text-muted">Please indicate your reference person (if available)</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Request message</label>
<div class="col-sm-10">
<textarea class="form-control" ng-model="requestMessage" cols="4"></textarea>
<textarea class="form-control" ng-model="user.requestMessage" cols="4"></textarea>
<small class="form-text text-muted">Specify the reason of your request</small>
</div>
</div>
@ -84,7 +84,7 @@
<div class="form-group row">
<div class="col-xs-12 col-md-6 col-lg-4" ng-repeat="c in vocCountries">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" checklist-model="countries" checklist-value="c.value"/>
<input class="form-check-input" type="checkbox" checklist-model="user.countries" checklist-value="c.value"/>
<label class="form-check-label">{{c.name}}</label>
</div>
</div>
@ -111,9 +111,13 @@
<script>
angular.module('authReqApp', ['checklist-model']).controller('authReqCtrl', function($scope, $http) {
$scope.vocCountries = [];
$scope.referencePerson = '';
$scope.requestMessage = '';
$scope.countries = [];
$scope.user = {
'referencePerson' : '',
'requestMessage' : '',
'countries' : []
};
$scope.registrationStatus = 0;
$scope.registrationMessage = '';
@ -126,11 +130,8 @@
$scope.register = function () {
$('#btnRegister').attr("disabled", "disabled");
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
$http.post('registration_api/newUser', {
'referencePerson' : $scope.referencePerson,
'requestMessage': $scope.requestMessage,
'countries': $scope.countries
}).then(function successCallback(res) {
$http.post('registration_api/newUser', $scope.user).then(function successCallback(res) {
$scope.registrationStatus = res.data.status;
if (res.data.status == 1) {
$scope.registrationMessage = 'Registration saved !';