mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
(feat) admin can confirm the prensence of pre-registration event
This commit is contained in:
parent
d271fa59e6
commit
8771eb8ccc
@ -516,6 +516,9 @@ Application.Controllers.controller('ShowEventReservationsController', ['$scope',
|
||||
templateUrl: '/admin/events/pay_reservation_modal.html',
|
||||
size: 'sm',
|
||||
resolve: {
|
||||
event () {
|
||||
return $scope.event;
|
||||
},
|
||||
reservation () {
|
||||
return reservation;
|
||||
},
|
||||
@ -529,8 +532,10 @@ Application.Controllers.controller('ShowEventReservationsController', ['$scope',
|
||||
return mkCartItems(reservation);
|
||||
}
|
||||
},
|
||||
controller: ['$scope', '$uibModalInstance', 'reservation', 'price', 'wallet', 'cartItems', 'helpers', '$filter', '_t', 'Reservation',
|
||||
function ($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, event) {
|
||||
$scope.event = event;
|
||||
|
||||
// User's wallet amount
|
||||
$scope.wallet = wallet;
|
||||
|
||||
@ -614,7 +619,11 @@ Application.Controllers.controller('ShowEventReservationsController', ['$scope',
|
||||
if (r.id === reservation.id) {
|
||||
return reservation;
|
||||
}
|
||||
growl.success(_t('app.admin.event_reservations.reservation_was_successfully_paid'));
|
||||
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'));
|
||||
}
|
||||
return r;
|
||||
});
|
||||
}, function () {
|
||||
|
@ -1,45 +1,52 @@
|
||||
<div class="modal-header">
|
||||
<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 class="modal-body">
|
||||
<uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</uib-alert>
|
||||
<div class="row" ng-show="!offered">
|
||||
<wallet-info current-user="currentUser"
|
||||
cart="cartItems"
|
||||
price="price.price"
|
||||
wallet="wallet"/>
|
||||
</div>
|
||||
<div class="row m-b">
|
||||
<div class="col-md-12">
|
||||
<label for="offerSlot" class="control-label m-r" translate>{{ 'app.admin.event_reservations.offer_this_reservation' }}</label>
|
||||
<input bs-switch
|
||||
ng-model="offered"
|
||||
id="offerSlot"
|
||||
type="checkbox"
|
||||
class="form-control"
|
||||
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
|
||||
switch-off-text="{{ 'app.shared.buttons.no' | translate }}"
|
||||
switch-animate="true"
|
||||
ng-change="computeEventAmount()"/>
|
||||
<div ng-show="event.amount !== 0">
|
||||
<div class="row" ng-show="!offered">
|
||||
<wallet-info current-user="currentUser"
|
||||
cart="cartItems"
|
||||
price="price.price"
|
||||
wallet="wallet"/>
|
||||
</div>
|
||||
<div class="row m-b">
|
||||
<div class="col-md-12">
|
||||
<label for="offerSlot" class="control-label m-r" translate>{{ 'app.admin.event_reservations.offer_this_reservation' }}</label>
|
||||
<input bs-switch
|
||||
ng-model="offered"
|
||||
id="offerSlot"
|
||||
type="checkbox"
|
||||
class="form-control"
|
||||
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
|
||||
switch-off-text="{{ 'app.shared.buttons.no' | translate }}"
|
||||
switch-animate="true"
|
||||
ng-change="computeEventAmount()"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<coupon show="true" coupon="coupon.applied" total="price.price_without_coupon" user-id="{{reservation.user_id}}"></coupon>
|
||||
<coupon show="true" coupon="coupon.applied" total="price.price_without_coupon" user-id="{{reservation.user_id}}"></coupon>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="checkbox-group">
|
||||
<input type="checkbox"
|
||||
name="paymentReceived"
|
||||
id="paymentReceived"
|
||||
ng-model="payment" />
|
||||
<label for="paymentReceived" translate>{{ 'app.admin.event_reservations.i_have_received_the_payment' }}</label>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="checkbox-group">
|
||||
<input type="checkbox"
|
||||
name="paymentReceived"
|
||||
id="paymentReceived"
|
||||
ng-model="payment" />
|
||||
<label for="paymentReceived" translate>{{ 'app.admin.event_reservations.i_have_received_the_payment' }}</label>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
|
@ -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" >
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-default" ng-click="payReservation(reservation)" ng-if="isValidated(reservation) && !isCancelled(reservation) && !reservation.is_paid" translate>
|
||||
{{ 'app.admin.event_reservations.pay' }}
|
||||
<button class="btn btn-default" ng-click="payReservation(reservation)" ng-if="isValidated(reservation) && !isCancelled(reservation) && !reservation.is_paid">
|
||||
<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>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -668,6 +668,10 @@ en:
|
||||
offer_this_reservation: "I offer this reservation"
|
||||
i_have_received_the_payment: "I have received the payment"
|
||||
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:
|
||||
title: "Settings"
|
||||
generic_text_block: "Editorial text block"
|
||||
|
@ -668,6 +668,10 @@ fr:
|
||||
offer_this_reservation: "J'offre cette réservation"
|
||||
i_have_received_the_payment: "J'ai reçu le paiement"
|
||||
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:
|
||||
title: "Paramètres"
|
||||
generic_text_block: "Bloc de texte rédactionnel"
|
||||
|
Loading…
Reference in New Issue
Block a user