1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-15 00:24:09 +01:00
fab-manager/app/frontend/templates/admin/members/edit.html

300 lines
15 KiB
HTML
Raw Normal View History

2015-05-05 03:10:25 +02:00
<div>
<section class="heading b-b">
<div class="row no-gutter">
<div class="col-md-1 hidden-xs">
<section class="heading-btn">
2020-09-29 14:35:42 +02:00
<a ng-click="backPrevLocation($event)"><i class="fas fa-long-arrow-alt-left"></i></a>
2015-05-05 03:10:25 +02:00
</section>
</div>
<div class="col-md-8 b-l b-r">
<section class="heading-title">
<h1 class="inline">{{ 'app.shared.user_admin.user' | translate }} {{ user.name }}</h1>
<span class="label label-danger text-white" ng-show="user.need_completion" translate>{{ 'app.shared.user_admin.incomplete_profile' }}</span>
2022-07-11 11:33:31 +02:00
<div ng-if="enableUserValidationRequired">
<user-validation member="user"
on-error="onError"
on-success="onValidateMemberSuccess" />
</div>
2015-05-05 03:10:25 +02:00
</section>
</div>
<div class="col-md-3">
<section class="heading-actions wrapper">
<div class="btn btn-lg btn-block btn-default promote-member m-t-xs" ng-click="toggleChangeRoleModal()" ng-show="isAuthorized('admin')">
<img src="/rank-icon.svg" alt="role icon" /><span class="m-l" translate>{{ 'app.admin.members_edit.change_role' }}</span>
2015-05-05 03:10:25 +02:00
</div>
<change-role-modal is-open="isOpenChangeRoleModal" toggle-modal="toggleChangeRoleModal" user="user" on-success="onSuccess" onError="onError" />
2015-05-05 03:10:25 +02:00
</section>
</div>
</div>
</section>
<div class="row no-gutter ">
<div class="col-sm-12 col-md-12 b-r">
2016-03-23 18:39:41 +01:00
<uib-tabset justified="true" class="m-t">
2015-05-05 03:10:25 +02:00
<uib-tab heading="{{ 'app.shared.user_admin.user_profile' | translate }}">
<section class="panel panel-danger m-lg" ng-show="user.need_completion && activeProvider.providable_type !== 'DatabaseProvider'">
<div class="panel-body m-r" translate>
{{ 'app.shared.user_admin.warning_incomplete_user_profile_probably_imported_from_sso' }}
</div>
</section>
<section class="panel panel-default bg-light m-lg">
<div class="panel-body m-r">
<user-profile-form user="user"
2022-12-06 16:08:38 +01:00
operator="currentUser"
action="'update'"
on-error="onError"
on-success="onUserSuccess"
show-group-input="true"
show-tags-input="true"
show-trainings-input="true" />
</div>
</section>
2016-03-23 18:39:41 +01:00
</uib-tab>
2023-09-14 09:13:12 +02:00
<uib-tab heading="{{ 'app.admin.members_edit.reservations' | translate }}">
<reservations-dashboard user="user" current-user="currentUser" on-error="onError" />
</uib-tab>
2023-05-25 20:17:37 +02:00
<uib-tab heading="{{ 'app.shared.user_admin.children' | translate }}" ng-if="$root.settings.familyAccount">
2023-05-31 11:29:10 +02:00
<children-dashboard user="user" operator="currentUser" admin-panel="true" on-success="onSuccess" on-error="onError" />
2023-05-25 20:17:37 +02:00
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.supporting_documents' | translate }}" ng-show="hasProofOfIdentityTypes">
<supporting-documents-validation
operator="currentUser"
member="user"
document-type="User"
on-error="onError"
on-success="onSuccess" />
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.subscription' | translate }}" ng-if="$root.modules.plans">
2016-03-23 18:39:41 +01:00
<section class="panel panel-default bg-light m-lg">
<div class="panel-body m-r">
2023-01-03 17:17:39 +01:00
<div class="" ng-if="subscription">
2016-03-23 18:39:41 +01:00
<h3>{{ subscription.plan | humanReadablePlanName }}</h3>
<p>
{{ 'app.admin.members_edit.duration' | translate }} {{ subscription.plan.interval | planIntervalFilter: subscription.plan.interval_count }}
2016-03-23 18:39:41 +01:00
</p>
<p>
{{ 'app.admin.members_edit.expires_at' | translate }} {{ subscription.expired_at | amDateFormat: 'L' }}
2016-03-23 18:39:41 +01:00
</p>
<p>
{{ 'app.admin.members_edit.price_' | translate }} {{ subscription.plan.amount | currency}}
2016-03-23 18:39:41 +01:00
</p>
2020-04-29 11:11:57 +02:00
<div ng-hide="user.id === currentUser.id">
2021-10-11 18:50:53 +02:00
<button class="btn btn-default" ng-click="toggleFreeExtendModal()" translate>{{ 'app.admin.members_edit.offer_free_days' }}</button>
<button class="btn btn-default" ng-click="toggleRenewModal()" translate>{{ 'app.admin.members_edit.renew_subscription' }}</button>
2023-01-03 17:17:39 +01:00
<button class="btn btn-default" ng-click="toggleCancelModal()" translate>{{ 'app.admin.members_edit.cancel_subscription' }}</button>
2021-10-11 18:50:53 +02:00
<free-extend-modal is-open="isOpenFreeExtendModal"
ng-if="isOpenFreeExtendModal"
2021-10-11 18:50:53 +02:00
toggle-modal="toggleFreeExtendModal"
subscription="subscription"
2021-10-12 14:07:35 +02:00
customer-id="user.id"
2021-10-11 18:50:53 +02:00
on-error="onError"
on-success="onExtendSuccess">
</free-extend-modal>
<renew-modal is-open="isOpenRenewModal"
ng-if="isOpenRenewModal"
toggle-modal="toggleRenewModal"
subscription="subscription"
customer="user"
operator="currentUser"
on-error="onError"
on-success="onExtendSuccess">
</renew-modal>
2023-01-03 17:17:39 +01:00
<cancel-subscription-modal is-open="isOpenCancelModal"
ng-if="isOpenCancelModal"
2023-01-03 17:17:39 +01:00
toggle-modal="toggleCancelModal"
subscription="subscription"
customer="user"
operator="currentUser"
on-error="onError"
on-success="onCancelSuccess">
</cancel-subscription-modal>
2020-04-29 11:11:57 +02:00
</div>
<p class="alert alert-info" ng-show="user.id === currentUser.id" translate>
{{ 'app.admin.members_edit.cannot_extend_own_subscription' }}
</p>
2016-03-23 18:39:41 +01:00
</div>
<div class="" ng-hide="subscription">
<p translate>
{{ 'app.admin.members_edit.user_has_no_current_subscription' }}
2016-03-23 18:39:41 +01:00
</p>
<button class="btn btn-default" ng-click="toggleSubscribeModal()" translate>{{ 'app.admin.members_edit.subscribe_to_a_plan' }}</button>
<subscribe-modal is-open="isOpenSubscribeModal"
toggle-modal="toggleSubscribeModal"
customer="user"
operator="currentUser"
on-error="onError"
on-success="onSubscribeSuccess">
</subscribe-modal>
2016-03-23 18:39:41 +01:00
</div>
</div>
</section>
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.trainings' | translate }}" ng-show="$root.modules.trainings">
2016-03-23 18:39:41 +01:00
<div class="col-md-4">
<div class="widget panel b-a m-t-lg">
<div class="panel-heading b-b ">
<h4 class="text-u-c"><i class="fa fa-tag m-r-xs"></i> {{ 'app.admin.members_edit.next_trainings' | translate }}</h4>
2016-03-23 18:39:41 +01:00
</div>
<div class="widget-content bg-light wrapper r-b">
<ul class="list-unstyled" ng-if="user.training_reservations.length > 0">
2022-06-15 13:48:42 +02:00
<li class="m-b" ng-repeat="r in user.training_reservations | trainingReservationsFilter:'future'" data-label="{{ 'app.admin.event_reservations.canceled' | translate}}" ng-class="{'reservation-canceled':r.canceled_at}">
2016-03-23 18:39:41 +01:00
<span class="font-sbold">{{r.reservable.name}}</span> - <span class="label label-warning wrapper-sm">{{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }}</span>
</li>
</ul>
<div ng-if="user.training_reservations.length == 0" translate>{{ 'app.admin.members_edit.no_trainings' }}</div>
2016-03-23 18:39:41 +01:00
</div>
</div>
2015-05-05 03:10:25 +02:00
</div>
2016-03-23 18:39:41 +01:00
<div class="col-md-4">
<div class="widget panel b-a m-t-lg">
<div class="panel-heading b-b">
<h4 class="text-u-c"><i class="fa fa-tag m-r-xs"></i> {{ 'app.admin.members_edit.passed_trainings' | translate }}</h4>
2016-03-23 18:39:41 +01:00
</div>
<div class="widget-content bg-light wrapper r-b">
<ul class="list-unstyled" ng-if="user.training_reservations.length > 0">
<li class="m-b" ng-repeat="r in user.training_reservations | trainingReservationsFilter:'passed'">
<span class="font-sbold">{{r.reservable.name}}</span> - <span class="label label-info text-white wrapper-sm">{{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }}</span>
<!-- TODO actions validate or refuse the passed training -->
<!-- <div class="btn-group">
<button type="button" class="btn btn-success btn-sm">Validate</button>
<button type="button" class="btn btn-warning btn-sm">Refuse</button>
</div> -->
</li>
</ul>
<div ng-if="user.training_reservations.length == 0" translate>{{ 'app.admin.members_edit.no_trainings' }}</div>
2016-03-23 18:39:41 +01:00
</div>
</div>
</div>
<div class="col-md-4">
<div class="widget panel b-a m-t-lg">
<div class="panel-heading b-b">
<h4 class="text-u-c"><i class="fa fa-tag m-r-xs"></i> {{ 'app.admin.members_edit.validated_trainings' | translate }}</h4>
2016-03-23 18:39:41 +01:00
</div>
<div class="widget-content bg-light wrapper r-b">
<ul class="list-unstyled" ng-if="user.trainings.length > 0">
<li class="m-b" ng-repeat="t in user.trainings">
<span class="font-sbold">{{t.name}}</span>
</li>
</ul>
<div ng-if="user.trainings.length == 0" translate>{{ 'app.admin.members_edit.no_trainings' }}</div>
2016-03-23 18:39:41 +01:00
</div>
</div>
</div>
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.events' | translate }}">
2016-03-23 18:39:41 +01:00
<div class="col-md-6">
<div class="widget panel b-a m m-t-lg">
<div class="panel-heading b-b">
<h4 class="text-u-c"><i class="fa fa-tag m-r-xs"></i> {{ 'app.admin.members_edit.next_events' | translate }}</h4>
2016-03-23 18:39:41 +01:00
</div>
<div class="widget-content bg-light wrapper r-b">
<div class="list-unstyled" ng-if="user.events_reservations.length > 0">
<div ng-repeat="r in user.events_reservations | eventsReservationsFilter:'future'" class="m-b">
<event-reservation-item reservation="r"></event-reservation-item>
</div>
</div>
<div ng-if="(user.events_reservations | eventsReservationsFilter:'future').length == 0" translate>{{ 'app.admin.members_edit.no_upcoming_events' }}</div>
2016-03-23 18:39:41 +01:00
</div>
</div>
</div>
<div class="col-md-6">
<div class="widget panel b-a m m-t-lg">
<div class="panel-heading b-b">
<h4 class="text-u-c"><i class="fa fa-tag m-r-xs"></i> {{ 'app.admin.members_edit.passed_events' | translate }}</h4>
2016-03-23 18:39:41 +01:00
</div>
<div class="widget-content bg-light auto wrapper r-b">
<div class="list-unstyled" ng-if="user.events_reservations.length > 0">
<div ng-repeat="r in user.events_reservations | eventsReservationsFilter:'passed'" class="m-b">
<event-reservation-item reservation="r"></event-reservation-item>
</div>
</div>
<div ng-if="(user.events_reservations | eventsReservationsFilter:'passed').length == 0" translate>{{ 'app.admin.members_edit.no_passed_events' }}</div>
2016-03-23 18:39:41 +01:00
</div>
</div>
</div>
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.invoices' | translate }}" ng-show="$root.modules.invoicing">
2016-03-23 18:39:41 +01:00
<div class="col-md-12 m m-t-lg">
<table class="table" ng-if="user.invoices.length > 0">
<thead>
<tr>
<th style="width:25%" translate>{{ 'app.admin.members_edit.invoice_num' }}</th>
<th style="width:25%" translate>{{ 'app.admin.members_edit.date' }}</th>
<th style="width:25%" translate>{{ 'app.admin.members_edit.price' }}</th>
2016-03-23 18:39:41 +01:00
<th style="width:25%"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="invoice in user.invoices">
<td>{{ invoice.reference }}</td>
<td ng-if="!invoice.is_avoir">{{ invoice.date | amDateFormat:'L LTS' }}</td>
<td ng-if="invoice.is_avoir">{{ invoice.date | amDateFormat:'L' }}</td>
<td>{{ invoice.total | currency }}</td>
<td>
<div class="buttons">
<a class="btn btn-default" ng-href="api/invoices/{{invoice.id}}/download" target="_blank" ng-if="!invoice.is_avoir">
<i class="fa fa-file-pdf-o"></i> {{ 'app.admin.members_edit.download_the_invoice' | translate }}
2016-03-23 18:39:41 +01:00
</a>
<a class="btn btn-default" ng-href="api/invoices/{{invoice.id}}/download" target="_blank" ng-if="invoice.is_avoir">
<i class="fa fa-file-pdf-o"></i> {{ 'app.admin.members_edit.download_the_refund_invoice' | translate }}
2016-03-23 18:39:41 +01:00
</a>
</div>
</td>
</tr>
</tbody>
</table>
<p ng-if="user.invoices.length == 0" translate>{{ 'app.admin.members_edit.no_invoices_for_now' }}</p>
2016-03-23 18:39:41 +01:00
</div>
</uib-tab>
2016-07-18 18:16:54 +02:00
<uib-tab heading="{{ 'app.admin.members_edit.wallet' | translate }}" ng-show="$root.modules.wallet">
2016-07-18 18:16:54 +02:00
<div class="col-md-12 m m-t-lg">
<ng-include src="'/wallet/show.html'"></ng-include>
<div class="clearfix"></div>
<div class="col-sm-4 text-center" ng-hide="user.id === currentUser.id">
2023-11-27 16:21:07 +01:00
<button type="button" class="fab-button is-secondary m-t m-b" ng-click="createWalletCreditModal(user, wallet)" translate>{{ 'app.admin.members_edit.to_credit' }}</button>
</div>
<p class="col-sm-4 alert alert-info" ng-show="user.id === currentUser.id" translate>
{{ 'app.admin.members_edit.cannot_credit_own_wallet' }}
</p>
2016-07-18 18:16:54 +02:00
</div>
2016-07-05 13:20:25 +02:00
<div class="col-md-12 m m-t-lg">
<ng-include src="'/wallet/transactions.html'"></ng-include>
2016-07-05 13:20:25 +02:00
</div>
2016-07-18 18:16:54 +02:00
</uib-tab>
2016-03-23 18:39:41 +01:00
</uib-tabset>
2015-05-05 03:10:25 +02:00
</div>
</div>
</div>