-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac44a09
commit ff2e1a0
Showing
1 changed file
with
26 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,27 @@ | ||
@php($checkoutAgreements ??= \Rapidez\Core\Models\CheckoutAgreement::all()) | ||
@if (!$checkoutAgreements->count()) | ||
@return | ||
@endif | ||
|
||
@foreach ($checkoutAgreements as $agreement) | ||
<x-rapidez::slideover position="right" id="{{ $agreement->agreement_id }}_agreement"> | ||
<x-slot name="title"> | ||
{{ $agreement->name }} | ||
</x-slot> | ||
|
||
@if ($agreement->is_html) | ||
<div class="p-3"> | ||
{!! $agreement->content !!} | ||
</div> | ||
@else | ||
<div class="whitespace-pre-line p-3"> | ||
{{ $agreement->content }} | ||
</div> | ||
@endif | ||
</x-rapidez::slideover> | ||
|
||
@if ($agreement->mode == 'AUTO') | ||
<label class="text-gray-700 cursor-pointer underline hover:no-underline" for="{{ $agreement->agreement_id }}_agreement"> | ||
{{ $agreement->checkbox_text }} | ||
</label> | ||
@else | ||
<div> | ||
<x-rapidez::checkbox | ||
name="agreement_ids[]" | ||
:value="$agreement->agreement_id" | ||
dusk="agreements" | ||
required | ||
> | ||
<label class="text-gray-700 cursor-pointer underline hover:no-underline" for="{{ $agreement->agreement_id }}_agreement"> | ||
{{ $agreement->checkbox_text }} | ||
</label> | ||
</x-rapidez::checkbox> | ||
<graphql query="{ checkoutAgreements { agreement_id name checkbox_text content is_html mode } }" cache="checkout.agreements" v-cloak> | ||
<div slot-scope="{ data }" v-if="data"> | ||
<div v-for="agreement in data.checkoutAgreements" :key="agreement.agreement_id"> | ||
<global-slideover v-bind:title="agreement.name" position="right" v-bind:contents="'<div class="' + (agreement.is_html ? '' : 'whitespace-pre-line ') + 'p-3">' + agreement.content + '</div>'"> | ||
<template v-slot="slideover"> | ||
<template v-if="agreement.mode == 'AUTO'"> | ||
<label class="text-gray-700 cursor-pointer underline hover:no-underline" v-on:click="slideover.open" for="slideover-global"> | ||
@{{ agreement.checkbox_text }} | ||
</label> | ||
</template> | ||
<div v-else> | ||
<x-rapidez::checkbox | ||
name="agreement_ids[]" | ||
v-bind:value="agreement.agreement_id" | ||
dusk="agreements" | ||
required | ||
> | ||
<label class="text-gray-700 cursor-pointer underline hover:no-underline" v-on:click="slideover.open" for="slideover-global"> | ||
@{{ agreement.checkbox_text }} | ||
</label> | ||
</x-rapidez::checkbox> | ||
</div> | ||
</template> | ||
</global-slideover> | ||
</div> | ||
@endif | ||
@endforeach | ||
</div> | ||
</graphql> |