1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

(feat) admin can confirm the prensence of pre-registration event

This commit is contained in:
Du Peng 2023-07-11 13:53:41 +02:00
parent d271fa59e6
commit 8771eb8ccc
5 changed files with 61 additions and 36 deletions

View File

@ -516,6 +516,9 @@ Application.Controllers.controller('ShowEventReservationsController', ['$scope',
templateUrl: '/admin/events/pay_reservation_modal.html', templateUrl: '/admin/events/pay_reservation_modal.html',
size: 'sm', size: 'sm',
resolve: { resolve: {
event () {
return $scope.event;
},
reservation () { reservation () {
return reservation; return reservation;
}, },
@ -529,8 +532,10 @@ Application.Controllers.controller('ShowEventReservationsController', ['$scope',
return mkCartItems(reservation); return mkCartItems(reservation);
} }
}, },
controller: ['$scope', '$uibModalInstance', 'reservation', 'price', 'wallet', 'cartItems', 'helpers', '$filter', '_t', 'Reservation', controller: ['$scope', '$uibModalInstance', 'reservation', 'price', 'wallet', 'cartItems', 'helpers', '$filter', '_t', 'Reservation', 'event',
function ($scope, $uibModalInstance, reservation, price, wallet, cartItems, helpers, $filter, _t, Reservation) { function ($scope, $uibModalInstance, reservation, price, wallet, cartItems, helpers, $filter, _t, Reservation, event) {
$scope.event = event;
// User's wallet amount // User's wallet amount
$scope.wallet = wallet; $scope.wallet = wallet;
@ -614,7 +619,11 @@ Application.Controllers.controller('ShowEventReservationsController', ['$scope',
if (r.id === reservation.id) { if (r.id === reservation.id) {
return reservation; return reservation;
} }
if ($scope.event.amount === 0) {
growl.success(_t('app.admin.event_reservations.reservation_was_successfully_present'));
} else {
growl.success(_t('app.admin.event_reservations.reservation_was_successfully_paid')); growl.success(_t('app.admin.event_reservations.reservation_was_successfully_paid'));
}
return r; return r;
}); });
}, function () { }, function () {

View File

@ -1,9 +1,10 @@
<div class="modal-header"> <div class="modal-header">
<img ng-src="{{logoBlack.custom_asset_file_attributes.attachment_url}}" alt="{{logo.custom_asset_file_attributes.attachment}}" class="modal-logo"/> <img ng-src="{{logoBlack.custom_asset_file_attributes.attachment_url}}" alt="{{logo.custom_asset_file_attributes.attachment}}" class="modal-logo"/>
<h1 translate ng-show="reservation">{{ 'app.admin.event_reservations.confirm_payment' }}</h1> <h1 translate ng-show="reservation && event.amount !== 0">{{ 'app.admin.event_reservations.confirm_payment' }}</h1>
<h1 translate ng-show="reservation && event.amount === 0">{{ 'app.admin.event_reservations.confirm_present' }}</h1>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</uib-alert> <div ng-show="event.amount !== 0">
<div class="row" ng-show="!offered"> <div class="row" ng-show="!offered">
<wallet-info current-user="currentUser" <wallet-info current-user="currentUser"
cart="cartItems" cart="cartItems"
@ -39,7 +40,13 @@
</div> </div>
</div> </div>
</div> </div>
<div ng-if="event.amount === 0">
<p translate>{{ 'app.admin.event_reservations.confirm_present_info' }}</p>
</div>
</div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-info" ng-click="ok()" ng-disabled="attempting || !payment" ng-bind-html="validButtonName"></button> <button class="btn btn-info" ng-if="event.amount !== 0" ng-click="ok()" ng-disabled="attempting || !payment" ng-bind-html="validButtonName"></button>
<button class="btn btn-info" ng-if="event.amount === 0" ng-click="ok()" ng-disabled="attempting" ng-bind-html="validButtonName"></button>
<button class="btn btn-default" ng-click="cancel()" translate>{{ 'app.shared.buttons.cancel' }}</button> <button class="btn btn-default" ng-click="cancel()" translate>{{ 'app.shared.buttons.cancel' }}</button>
</div> </div>

View File

@ -63,8 +63,9 @@
<input type="radio" name="validate" ng-value="true" ng-click="validateReservation(reservation)" ng-model="reservation.slots_reservations_attributes[0].is_valid" > <input type="radio" name="validate" ng-value="true" ng-click="validateReservation(reservation)" ng-model="reservation.slots_reservations_attributes[0].is_valid" >
</label> </label>
</div> </div>
<button class="btn btn-default" ng-click="payReservation(reservation)" ng-if="isValidated(reservation) && !isCancelled(reservation) && !reservation.is_paid" translate> <button class="btn btn-default" ng-click="payReservation(reservation)" ng-if="isValidated(reservation) && !isCancelled(reservation) && !reservation.is_paid">
{{ 'app.admin.event_reservations.pay' }} <span ng-if="event.amount !== 0" translate>{{ 'app.admin.event_reservations.pay' }}</span>
<span ng-if="event.amount === 0" translate>{{ 'app.admin.event_reservations.present' }}</span>
</button> </button>
</div> </div>
</td> </td>

View File

@ -668,6 +668,10 @@ en:
offer_this_reservation: "I offer this reservation" offer_this_reservation: "I offer this reservation"
i_have_received_the_payment: "I have received the payment" i_have_received_the_payment: "I have received the payment"
reservation_was_successfully_paid: "Reservation was successfully paid." reservation_was_successfully_paid: "Reservation was successfully paid."
present: "Present"
confirm_present: "Confirm presence"
confirm_present_info: "Confirm the presence of the user for this event"
reservation_was_successfully_present: "The presence of the user was successfully confirmed."
events_settings: events_settings:
title: "Settings" title: "Settings"
generic_text_block: "Editorial text block" generic_text_block: "Editorial text block"

View File

@ -668,6 +668,10 @@ fr:
offer_this_reservation: "J'offre cette réservation" offer_this_reservation: "J'offre cette réservation"
i_have_received_the_payment: "J'ai reçu le paiement" i_have_received_the_payment: "J'ai reçu le paiement"
reservation_was_successfully_paid: "La réservation a bien été payée." reservation_was_successfully_paid: "La réservation a bien été payée."
present: "Présenter"
confirm_present: "Confirmer la présence"
confirm_present_info: "Confirmer la présence de l'utilisateur à l'événement"
reservation_was_successfully_present: "La présence a bien été confirmée."
events_settings: events_settings:
title: "Paramètres" title: "Paramètres"
generic_text_block: "Bloc de texte rédactionnel" generic_text_block: "Bloc de texte rédactionnel"