1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-02 13:24:20 +01:00
fab-manager/app/assets/templates/shared/_cart.html.erb

161 lines
8.8 KiB
Plaintext
Raw Normal View History

2017-02-16 17:57:14 +01:00
<div class="widget panel b-a m m-t-lg" ng-if="user && !slotToModify && !modifiedSlots">
<div class="panel-heading b-b small">
<h3 translate>{{ 'summary' }}</h3>
</div>
<div class="widget-content no-bg auto wrapper" ng-show="eventsReserved.length == 0 && (!paidMachineSlots || paidMachineSlots.length == 0)">
<p class="font-felt fleche-left text-lg"><%= image_tag("fleche-left.png", class: 'fleche-left visible-lg') %>
{{ 'select_one_or_more_slots_in_the_calendar' | translate }}</p>
</div>
<div class="widget-content no-bg auto wrapper" ng-if="eventsReserved.length > 0">
<div class="font-sbold m-b-sm " translate>{{ 'you_ve_just_selected_the_slot' }}</div>
<div class="panel panel-default bg-light" ng-repeat="machineSlot in eventsReserved">
<div class="panel-body">
<div class="font-sbold text-u-c">{{ 'datetime_to_time' | translate:{START_DATETIME:(machineSlot.start | amDateFormat:'LLLL'), END_TIME:(machineSlot.end | amDateFormat:'LT') } }}</div>
<div class="text-base">{{ 'cost_of_a_machine_hour' | translate }} <span ng-class="{'text-blue': !machineSlot.promo, 'red': machineSlot.promo}">{{machineSlot.price | currency}}</span></div>
<div ng-show="currentUser.role == 'admin'" class="m-t">
<label for="offerSlot" class="control-label m-r" translate>{{ 'offer_this_slot' }}</label>
<input bs-switch
ng-model="machineSlot.offered"
id="offerSlot"
type="checkbox"
class="form-control"
switch-on-text="{{ 'yes' | translate}}"
switch-off-text="{{ 'no' | translate}}"
switch-animate="true"
switch-readonly="{{machineSlot.isValid}}"/>
</div>
</div>
<div>
<button class="btn btn-valid btn-warning btn-block text-u-c r-b" ng-click="validMachineSlot(machineSlot)" ng-if="!machineSlot.isValid" translate>{{ 'confirm_this_slot' }}</button>
</div>
<div class="clear"><a class="pull-right m-b-sm text-u-l ng-scope m-r-sm" href="#" ng-click="removeMachineSlot(machineSlot, $event)" ng-if="machineSlot.isValid" translate>{{ 'remove_this_slot' }}</a></div>
</div>
<coupon show="machineSlotsValid() && (!modePlans || selectedPlan)" coupon="coupon.applied" total="totalNoCoupon" user-id="{{user.id}}"></coupon>
2017-02-16 17:57:14 +01:00
<span ng-hide="fablabWithoutPlans">
<div ng-if="machineSlotsValid() && !user.subscribed_plan" ng-show="!modePlans">
<p class="font-sbold text-base l-h-2x" translate>{{ 'to_benefit_from_attractive_prices' }}</p>
<div><button class="btn btn-warning-full rounded btn-block text-xs" ng-click="showPlans()" translate>{{ 'view_our_subscriptions' }}</button></div>
<p class="font-bold text-base text-u-c text-center m-b-xs" translate>{{ 'or' }}</p>
</div>
2017-02-16 17:57:14 +01:00
<div ng-if="selectedPlan">
<div class="m-t-md m-b-sm text-base">{{ 'you_ve_just_selected_a_' | translate }} <br> <span class="font-sbold" translate>{{ '_subscription' }}</span> :</div>
<div class="panel panel-default bg-light m-n">
<div class="panel-body m-b-md">
<div class="font-sbold text-u-c">{{selectedPlan | humanReadablePlanName }}</div>
<div class="text-base">{{ 'cost_of_the_subscription' | translate }} <span class="text-blue">{{selectedPlan.amount | currency}}</span></div>
2017-02-16 17:57:14 +01:00
</div>
</div>
</div>
</span>
2017-02-16 17:57:14 +01:00
</div>
<div class="panel-footer no-padder" ng-if="eventsReserved.length > 0">
<button class="btn btn-valid btn-info btn-block p-l btn-lg text-u-c r-b text-base" ng-click="payMachine()" ng-if="machineSlotsValid() && (!modePlans || selectedPlan)">{{ 'confirm_and_pay' | translate }} {{amountTotal | currency}}</button>
2017-02-16 17:57:14 +01:00
</div>
<div class="widget-content no-bg auto wrapper" ng-if="paidMachineSlots">
{{ 'you_have_settled_the_following_machine_hours' | translate }} <strong>{{machine.name}}</strong>:
<div class="well well-warning m-t-sm" ng-repeat="paidSlot in paidMachineSlots">
<i class="font-sbold text-u-c">{{ 'datetime_to_time' | translate:{START_DATETIME:(paidSlot.start | amDateFormat:'LLLL'), END_TIME:(paidSlot.end | amDateFormat:'LT') } }}</i>
<div class="font-sbold">{{ 'cost_of_a_machine_hour' | translate }} {{paidSlot.machine.amount() | currency}}</div>
</div>
<div ng-if="selectedPlan">
<div class="m-t-md m-b-sm text-base">{{ 'you_have_settled_a_' | translate }} <br> <span class="font-sbold" translate>{{ '_subscription' }}</span> :</div>
<div class="well well-warning m-t-sm">
<i class="font-sbold text-u-c">{{selectedPlan | humanReadablePlanName }}</i>
<div class="font-sbold">{{ 'cost_of_the_subscription' | translate }} {{selectedPlan.amount | currency}}</div>
</div>
</div>
<div class="m-t-md font-sbold">{{ 'total_' | translate }} {{amountTotal | currency}}</div>
<div class="alert alert-success" ng-if="user.subscribed_plan">{{ 'thank_you_your_payment_has_been_successfully_registered' | translate }}<br>
{{ 'your_invoice_will_be_available_soon_from_your_' | translate }} <a ui-sref="app.logged.dashboard.invoices" translate>{{ 'dashboard' }}</a>
</div>
</div>
</div>
<div class="widget panel b-a m m-t-lg" ng-if="slotToModify || modifiedSlots">
<div class="panel-heading b-b small">
<h3 translate>{{ 'summary' }}</h3>
</div>
<div class="widget-content no-bg auto wrapper" ng-if="slotToModify">
<div class="font-sbold m-b-sm " translate>{{ 'i_want_to_change_the_following_reservation' }}</div>
<div class="panel panel-warning bg-yellow">
<div class="panel-body">
<div class="font-sbold text-u-c">{{ 'datetime_to_time' | translate:{START_DATETIME:(slotToModify.start | amDateFormat:'LLLL'), END_TIME:(slotToModify.end | amDateFormat:'LT') } }}</div>
</div>
<div class="clear"><a class="pull-right m-b-sm text-u-l ng-scope m-r-sm" href="#" ng-click="removeSlotToModify($event)" translate>{{ 'cancel_my_modification' }}</a></div>
</div>
<div class="widget-content no-bg">
<p class="font-felt fleche-left text-lg"><%= image_tag("fleche-left.png", class: 'fleche-left visible-lg') %>
{{ 'select_a_new_slot_in_the_calendar' | translate }}</p>
</div>
<div class="panel panel-info bg-info text-white" ng-if="slotToPlace">
<div class="panel-body">
<div class="font-sbold text-u-c">{{ 'datetime_to_time' | translate:{START_DATETIME:(slotToPlace.start | amDateFormat:'LLLL'), END_TIME:(slotToPlace.end | amDateFormat:'LT') } }}</div>
</div>
<div class="clear"><a class="pull-right m-b-sm text-u-l ng-scope m-r-sm" href="#" ng-click="removeSlotToPlace($event)" translate>{{ 'cancel_my_selection' }}</a></div>
</div>
<div ng-if="slotToPlace && slotToModify.tags.length > 0 && slotToPlace.tags.length > 0" ng-class="{'panel panel-danger bg-red': tagMissmatch()}">
<div class="panel-body">
<div id="fromTags">
{{ 'tags_of_the_original_slot' | translate }}<br/>
<span ng-repeat="tag in slotToModify.tags">
<span class='label label-success text-white' title="{{tag.name}}">{{tag.name}}</span>
</span>
</div><br/>
<div id="toTags">
{{ 'tags_of_the_destination_slot' | translate }}<br/>
<span ng-repeat="tag in slotToPlace.tags">
<span class='label label-success text-white' title="{{tag.name}}">{{tag.name}}</span>
</span>
</div>
</div>
</div>
</div>
<div class="panel-footer no-padder" ng-if="slotToModify && slotToPlace">
<button class="btn btn-invalid btn-default btn-block p-l btn-lg text-u-c r-n text-base" ng-click="cancelModifyMachineSlot()" translate>{{ 'cancel' }}</button>
<div>
<button class="btn btn-valid btn-info btn-block p-l btn-lg text-u-c r-b text-base" ng-click="modifyMachineSlot()" translate>{{ 'confirm_my_modification' }}</button>
</div>
</div>
<div class="widget-content no-bg auto wrapper" ng-if="modifiedSlots">
<div class="font-sbold m-b-sm " translate>{{ 'your_booking_slot_was_successfully_moved_from_' }}</div>
<div class="panel panel-default bg-light">
<div class="panel-body">
<div class="font-sbold text-u-c">{{ 'datetime_to_time' | translate:{START_DATETIME:(modifiedSlots.oldReservedSlot.start | amDateFormat:'LLLL'), END_TIME:(modifiedSlots.oldReservedSlot.end | amDateFormat:'LT') } }}</div>
</div>
</div>
<p class="text-center font-bold m-b-sm text-u-c" translate>{{ 'to_date' }}</p>
<div class="panel panel-success bg-success bg-light">
<div class="panel-body">
<div class="font-sbold text-u-c">{{ 'datetime_to_time' | translate:{START_DATETIME:(modifiedSlots.newReservedSlot.start | amDateFormat:'LLLL'), END_TIME:(modifiedSlots.newReservedSlot.end | amDateFormat:'LT') } }}</div>
</div>
</div>
</div>
</div>