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

247 lines
12 KiB
Plaintext
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">
<a ng-click="backPrevLocation($event)"><i class="fa fa-long-arrow-left"></i></a>
</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>
2015-05-05 03:10:25 +02:00
</section>
</div>
<div class="col-md-3">
<section class="heading-actions wrapper">
2016-03-23 18:39:41 +01:00
<div class="btn btn-lg btn-block btn-default m-t-xs" ng-click="cancel()" translate>
{{ 'app.shared.buttons.cancel' }}
2015-05-05 03:10:25 +02:00
</div>
</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>
2016-03-23 18:39:41 +01:00
<form role="form" name="userForm" class="form-horizontal col-md-8" novalidate action="{{ actionUrl }}" ng-upload="submited(content)" upload-options-enable-rails-csrf="true">
2015-05-05 03:10:25 +02:00
2016-03-23 18:39:41 +01:00
<section class="panel panel-default bg-light m-lg">
<div class="panel-body m-r">
<ng-include src="'<%= asset_path "shared/_member_form.html" %>'"></ng-include>
2015-05-05 03:10:25 +02:00
<ng-include src="'<%= asset_path "admin/members/_form.html" %>'"></ng-include>
2015-05-05 03:10:25 +02:00
2016-03-23 18:39:41 +01:00
</div> <!-- ./panel-body -->
2015-05-05 03:10:25 +02:00
2016-03-23 18:39:41 +01:00
<div class="panel-footer no-padder">
<input type="submit" value="{{ 'app.shared.buttons.confirm_changes' | translate }}" class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c" ng-disabled="userForm.$invalid"/>
2016-03-23 18:39:41 +01:00
</div>
</section>
</form>
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.subscription' | translate }}" ng-if="!fablabWithoutPlans">
2016-03-23 18:39:41 +01:00
<section class="panel panel-default bg-light m-lg">
<div class="panel-body m-r">
<div class="" ng-show="subscription">
<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>
<button class="btn btn-default" ng-click="updateSubscriptionModal(subscription, true)" translate>{{ 'app.admin.members_edit.offer_free_days' }}</button>
<button class="btn btn-default" ng-click="updateSubscriptionModal(subscription, false)" translate>{{ 'app.admin.members_edit.extend_subscription' }}</button>
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="createSubscriptionModal(user, plans.filter(filterDisabledPlans))" translate>{{ 'app.admin.members_edit.subscribe_to_a_plan' }}</button>
2016-03-23 18:39:41 +01:00
</div>
</div>
</section>
</uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.trainings' | translate }}">
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">
<li class="m-b" ng-repeat="r in user.training_reservations | trainingReservationsFilter:'future'">
<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">
<ul class="list-unstyled" ng-if="user.events_reservations.length > 0">
<li ng-repeat="r in user.events_reservations | eventsReservationsFilter:'future'" class="m-b">
<a class="font-sbold" ui-sref="app.public.events_show({id: r.reservable.id})">{{r.reservable.title}}</a> - <span class="label label-warning wrapper-sm">{{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }}</span>
<span ng-if="r.nb_reserve_places > 0">
<br/>
<span translate translate-values="{ NUMBER: r.nb_reserve_places }">{{ 'app.admin.members_edit.NUMBER_full_price_tickets_reserved' }}</span>
2016-03-23 18:39:41 +01:00
</span>
<span ng-repeat="ticket in r.tickets">
2016-03-23 18:39:41 +01:00
<br/>
<span translate translate-values="{ NUMBER: ticket.booked, NAME: ticket.price_category.name }">{{ 'app.admin.members_edit.NUMBER_NAME_tickets_reserved' }}</span>
2016-03-23 18:39:41 +01:00
</span>
</li>
</ul>
<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">
<ul class="list-unstyled" ng-if="user.events_reservations.length > 0">
<li ng-repeat="r in user.events_reservations | eventsReservationsFilter:'passed'" class="m-b">
<span class="font-sbold">{{r.reservable.title}}</span> - <span class="label label-info text-white wrapper-sm">{{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }}</span>
</li>
</ul>
<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-hide="fablabWithoutInvoices">
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
2020-02-12 18:15:44 +01:00
<uib-tab heading="{{ 'app.admin.members_edit.wallet' | translate }}" ng-hide="fablabWithoutWallet">
2016-07-18 18:16:54 +02:00
<div class="col-md-12 m m-t-lg">
<ng-include src="'<%= asset_path "wallet/show.html" %>'"></ng-include>
<div class="clearfix"></div>
<div class="col-sm-4 text-center">
<button type="button" class="btn btn-warning m-t m-b" ng-click="createWalletCreditModal(user, wallet)" translate>{{ 'app.admin.members_edit.to_credit' }}</button>
</div>
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="'<%= asset_path "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>