feat: registration form field display_width and option descriptions
Add configurable column widths (full/half) and optional descriptions for radio/select/checkbox options on registration form fields. - Migration adds display_width column to both tables - FieldDisplayWidth enum with smart defaults per field type - normalized_options accessor for backwards-compatible option format - Portal form renderer uses display_width for VRow/VCol grid layout - Radio/select/checkbox options render with descriptions - Admin field editor supports display_width toggle and description input - System templates updated with appropriate widths and descriptions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Enums\FieldDisplayWidth;
|
||||
use App\Enums\RegistrationFieldType;
|
||||
use App\Models\Event;
|
||||
use App\Models\Person;
|
||||
@@ -30,6 +31,11 @@ final class RegistrationFormFieldService
|
||||
{
|
||||
$data['slug'] = $this->generateUniqueSlug($event, $data['label']);
|
||||
|
||||
if (!isset($data['display_width'])) {
|
||||
$fieldType = RegistrationFieldType::from($data['field_type']);
|
||||
$data['display_width'] = FieldDisplayWidth::defaultForFieldType($fieldType)->value;
|
||||
}
|
||||
|
||||
$field = RegistrationFormField::create([
|
||||
'event_id' => $event->id,
|
||||
...$data,
|
||||
@@ -173,6 +179,7 @@ final class RegistrationFormFieldService
|
||||
'section' => $sourceField->section,
|
||||
'help_text' => $sourceField->help_text,
|
||||
'sort_order' => ++$maxOrder,
|
||||
'display_width' => $sourceField->display_width,
|
||||
]);
|
||||
|
||||
$created->push($field);
|
||||
|
||||
Reference in New Issue
Block a user