-
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.
Checkout agreements in the global slideover (#612)
- Loading branch information
1 parent
0868229
commit 36d2ebf
Showing
2 changed files
with
25 additions
and
37 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
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,38 +1,25 @@ | ||
@php($checkoutAgreements ??= \Rapidez\Core\Models\CheckoutAgreement::all()) | ||
@return(!$checkoutAgreements->count()) | ||
|
||
@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 text-sm cursor-pointer underline hover:no-underline" for="{{ $agreement->agreement_id }}_agreement"> | ||
{{ $agreement->checkbox_text }} | ||
</label> | ||
@else | ||
<div> | ||
<x-rapidez::input.checkbox.base | ||
name="agreement_ids[]" | ||
:value="$agreement->agreement_id" | ||
dusk="agreements" | ||
required | ||
/> | ||
<label class="text text-sm cursor-pointer underline hover:no-underline" for="{{ $agreement->agreement_id }}_agreement"> | ||
{{ $agreement->checkbox_text }} | ||
</label> | ||
<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 :title="agreement.name" :content="'<div class="p-3' + (!agreement.is_html ? ' whitespace-pre-line' : '') + '">' + agreement.content + '</div>'" 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"> | ||
@{{ agreement.checkbox_text }} | ||
</label> | ||
</template> | ||
<div v-else> | ||
<x-rapidez::input.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"> | ||
@{{ agreement.checkbox_text }} | ||
</label> | ||
</x-rapidez::input.checkbox> | ||
</div> | ||
</global-slideover> | ||
</div> | ||
@endif | ||
@endforeach | ||
</div> | ||
</graphql> |