Align programme flow with Events: system-generated QR, no customizer.
Deploy Ladill Events / deploy (push) Successful in 31s
Deploy Ladill Events / deploy (push) Successful in 31s
Replace the QR-first create and edit experience with simple programme forms that auto-generate Ladill Link codes like events do. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,12 +4,20 @@ namespace App\Http\Controllers\Events;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\QrCode;
|
||||
use App\Models\QrWallet;
|
||||
use App\Support\Qr\QrTypeCatalog;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ProgrammeController extends Controller
|
||||
{
|
||||
public function create(): View
|
||||
{
|
||||
return view('events.programme-create', [
|
||||
'pricePerQr' => QrWallet::pricePerQr(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$account = ladill_account();
|
||||
|
||||
@@ -89,6 +89,12 @@ class QrCodeController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
if ($requestedType === QrCode::TYPE_ITINERARY) {
|
||||
return view('events.programme-create', [
|
||||
'pricePerQr' => QrWallet::pricePerQr(),
|
||||
]);
|
||||
}
|
||||
|
||||
return view('qr-codes.create', [
|
||||
'wallet' => $wallet,
|
||||
'requestedType' => $requestedType,
|
||||
@@ -230,6 +236,14 @@ class QrCodeController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
if ($qrCode->type === QrCode::TYPE_ITINERARY) {
|
||||
return view('events.programme-show', [
|
||||
'qrCode' => $qrCode,
|
||||
'previewDataUri' => $previewDataUri,
|
||||
'linkedEventSpeakers' => app(\App\Services\Events\EventProgrammeService::class)->speakerOptionsForProgramme($qrCode),
|
||||
]);
|
||||
}
|
||||
|
||||
return view('qr-codes.show', [
|
||||
'qrCode' => $qrCode,
|
||||
'previewDataUri' => $previewDataUri,
|
||||
|
||||
@@ -45,7 +45,7 @@ class QrCodeManagerService
|
||||
$type = (string) ($data['type'] ?? '');
|
||||
$validated = $this->payloadValidator->validateForCreate($type, $data);
|
||||
$styleInput = $data['style'] ?? null;
|
||||
if ($type === QrCode::TYPE_EVENT && empty(array_filter((array) $styleInput))) {
|
||||
if (in_array($type, [QrCode::TYPE_EVENT, QrCode::TYPE_ITINERARY], true) && empty(array_filter((array) $styleInput))) {
|
||||
$styleInput = $user->getOrCreateQrSetting()->resolvedDefaultStyle();
|
||||
}
|
||||
$style = QrStyleDefaults::merge($styleInput);
|
||||
|
||||
Reference in New Issue
Block a user