-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
9 changed files
with
114 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
title: 'Form' | ||
fields: | ||
- | ||
handle: form | ||
field: | ||
max_items: 1 | ||
display: Form | ||
type: form | ||
icon: form | ||
localizable: false | ||
listable: hidden | ||
instructions_position: above | ||
visibility: visible |
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 |
---|---|---|
|
@@ -27,4 +27,9 @@ fields: | |
fields: | ||
- | ||
import: image | ||
form: | ||
display: Form | ||
fields: | ||
- | ||
import: form | ||
localizable: true |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<x-mail::message> | ||
# {{ $form->value()->title() }} | ||
|
||
<x-mail::table> | ||
| | | | ||
| --- | --- | | ||
@foreach($fields as $field) | ||
| **{{ $field['display'] }}** | {{ $field['value'] }} | | ||
@endforeach | ||
</x-mail::table> | ||
</x-mail::message> |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<x-rapidez::input | ||
:name="$field['handle']" | ||
:type="$field['input_type']" | ||
:label="$field['display']" | ||
:value="$field['old'] ?: $field['value']" | ||
:placeholder="$field['placeholder'] ?? false" | ||
:class="$field['error'] ? 'border-red-500' : ''" | ||
:maxlength="$field['character_limit'] ?? false" | ||
:required="in_array('required', $field['validate'])" | ||
/> | ||
@if($field['error']) | ||
<div class="text-red-500">{{ $field['error'] }}</div> | ||
@endif |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<x-rapidez::textarea | ||
:name="$field['handle']" | ||
:label="$field['display']" | ||
:value="$field['value']" | ||
:placeholder="$field['placeholder'] ?? false" | ||
:class="$field['error'] ? 'border-red-500' : ''" | ||
:maxlength="$field['character_limit'] ?? false" | ||
:required="in_array('required', $field['validate'])" | ||
/> | ||
@if($field['error']) | ||
<div class="text-red-500">{{ $field['error'] }}</div> | ||
@endif |
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,9 +1,3 @@ | ||
@foreach ($content as $set) | ||
@if(!View::exists('page_builder.' . $set['type']) && !View::exists('rapidez-statamic::page_builder.' . $set['type'])) | ||
@if(!app()->environment('production')) | ||
<hr>View for set {{ $set['type'] }} not found.<hr> | ||
@endif | ||
@else | ||
@includeFirst(['page_builder.' . $set['type'], 'rapidez-statamic::page_builder.' . $set['type']], $set) | ||
@endif | ||
@includeFirstSafe(['page_builder.' . $set['type'], 'rapidez-statamic::page_builder.' . $set['type']], $set) | ||
@endforeach |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@php($form = Statamic::tag('form:create')->param('in', $form->value()->handle())->fetch()) | ||
|
||
@if($form['success']) | ||
<div>@lang('The form was submitted successfully')</div> | ||
@return | ||
@endif | ||
|
||
<form @attributes($form['attrs'])> | ||
@foreach($form['params'] as $name => $value) | ||
<input type="hidden" name="{{ $name }}" value="{{ $value }}"> | ||
@endforeach | ||
|
||
<div class="grid grid-cols-12 gap-3"> | ||
@foreach($form['fields'] as $field) | ||
<div @class([ | ||
'col-span-3' => $field['width'] == '25', | ||
'col-span-4' => $field['width'] == '33', | ||
'col-span-6' => $field['width'] == '50', | ||
'col-span-8' => $field['width'] == '66', | ||
'col-span-9' => $field['width'] == '75', | ||
'col-span-12' => $field['width'] == '100', | ||
])> | ||
@includeFirstSafe(['form_fields.' . $field['type'], 'rapidez-statamic::form_fields.' . $field['type']], $set) | ||
</div> | ||
@endforeach | ||
</div> | ||
|
||
<x-rapidez::button type="submit"> | ||
@lang('Submit') | ||
</x-rapidez::button> | ||
</form> |
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