• Mahmoud Aglan's avatar
    feat(website): make the builder able to reproduce a real bilingual site · 21792905
    Mahmoud Aglan authored
    Building an existing client site inside the builder surfaced the gaps between
    "the blocks exist" and "the blocks can express a finished design". Each of these
    was found by rendering the target and comparing it, not by reading the code.
    
    Blueprint export/import (v2) now carries the whole design, not a third of it.
    It exported pages only — so importing a design gave you the content with a
    default theme and no navigation, which looks nothing like its source. It now
    carries theme settings and menus too. Menu items record their page by SLUG,
    because a page id means nothing in another tenant's database and would import a
    navigation pointing at whatever happened to hold that id. Tracking identifiers
    are deliberately excluded from the whitelist: importing a design must never
    start reporting one client's traffic into another's account. v1 files still
    import.
    
    Isolation that did not isolate. BlockRenderer catches a failing block so the
    rest of the site survives, but Laravel's View::render() calls flushState() when
    any view throws, which clears the section stack of the page *around* it.
    Rendered inside the layout's @section, one bad block therefore killed the whole
    page at @endsection with an unrelated "Cannot end a section" error — the exact
    opposite of the intent. Blocks are now rendered before the layout runs, where
    there is no open section to corrupt.
    
    Bilingual content reached templates raw. Translatable repeater sub-fields
    (a button label, a card title, a partner name) are stored as ['ar'=>…,'en'=>…]
    and read straight out of the data array, so they arrived at {{ }} as arrays and
    took the block down with "htmlspecialchars(): array given". website_text()
    resolves them, and 49 such reads across 15 block views now use it.
    
    The English site rendered right-to-left. website.css hardcoded
    `direction: rtl` on .website-body, silently overriding the dir attribute the
    layout computes from the locale. Direction now follows the document.
    
    There was no English at all. No lang/ directory existed, so every __() returned
    its Arabic key and English visitors read Arabic form labels, buttons and
    helper text. lang/en.json covers all 125 public-site strings.
    
    Smaller gaps, each of which made a real design impossible to express:
    - 'glass' was a valid navbar template and a forbidden column value; the CHECK
      constraint predated it, so choosing it failed at write time.
    - navbar_cta_text had no English twin, so a bilingual site showed one language's
      button to both audiences.
    - An empty navbar CTA fell back to the default label, so the button could not
      be turned off.
    - An anchor menu item resolved to a bare "#id", which points at nothing from a
      sub-page; it now addresses the homepage in the reader's language.
    - A footer column title was a plain string, so it could not be bilingual; the
      'about' column dropped the social row whenever columns were configured.
    - product_showcase stacked its showcase under a centred headline instead of
      laying out as the split it is.
    - A map field stores coords as ['lat'=>…,'lng'=>…] and the view passed the array
      to urlencode(), killing the block.
    - New: 'stacked' info cards, a footer spacer, heading rules and eyebrows on the
      contact block, and a nowrap on highlighted heading fragments so
      "Welcome to {OC-Sport}" cannot break mid-phrase.
    
    Verified against a local Postgres replica carrying a real 11-page bilingual
    site: 22 page/locale combinations answer 200 with zero logged block failures,
    all 137 block/variant combinations render, reserved and unknown paths still 404,
    the four migrations apply and roll back on both an existing tenant and a
    from-scratch install + seed, and the suite passes (140 tests, 483 assertions).
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    21792905
Name
Last commit
Last update
..
2024_01_01_000001_create_academies_table.php Loading commit data...
2024_01_01_000002_create_users_table.php Loading commit data...
2024_01_01_000003_create_cache_and_jobs_tables.php Loading commit data...
2024_01_01_000004_create_branches_table.php Loading commit data...
2024_01_01_000005_create_roles_and_permissions_tables.php Loading commit data...
2024_01_01_000006_create_people_table.php Loading commit data...
2024_01_01_000007_create_guardians_table.php Loading commit data...
2024_01_01_000008_add_phase1_columns_to_users_table.php Loading commit data...
2024_01_01_000009_create_login_history_table.php Loading commit data...
2024_01_01_000010_create_financial_accounts_table.php Loading commit data...
2024_01_01_000011_create_invoices_table.php Loading commit data...
2024_01_01_000012_create_payments_table.php Loading commit data...
2024_01_01_000013_create_transactions_table.php Loading commit data...
2024_01_01_000014_create_wallets_table.php Loading commit data...
2024_01_01_000015_create_payment_plans_table.php Loading commit data...
2024_01_01_000016_create_activities_table.php Loading commit data...
2024_01_01_000017_create_participants_table.php Loading commit data...
2024_01_01_000018_create_guardian_participant_table.php Loading commit data...
2024_01_01_000019_create_training_programs_table.php Loading commit data...
2024_01_01_000020_create_training_groups_table.php Loading commit data...
2024_01_01_000021_create_training_schedules_table.php Loading commit data...
2024_01_01_000022_create_training_sessions_table.php Loading commit data...
2024_01_01_000023_create_enrollments_table.php Loading commit data...
2024_01_01_000024_create_waitlists_table.php Loading commit data...
2024_01_01_000025_create_holidays_table.php Loading commit data...
2024_01_01_000026_create_cash_sessions_table.php Loading commit data...
2024_01_01_000027_create_facilities_table.php Loading commit data...
2024_01_01_000028_create_space_layouts_and_segments_table.php Loading commit data...
2024_01_01_000029_create_space_reservations_table.php Loading commit data...
2024_01_01_000030_create_assignments_table.php Loading commit data...
2024_01_01_000031_create_attendance_records_table.php Loading commit data...
2024_01_01_000032_create_base_prices_table.php Loading commit data...
2024_01_01_000033_create_pricing_rules_table.php Loading commit data...
2024_01_01_000034_create_promotions_and_coupons_table.php Loading commit data...
2024_01_01_000035_create_pos_transactions_table.php Loading commit data...
2024_01_01_000036_create_products_and_categories_table.php Loading commit data...
2024_01_01_000037_create_warehouses_and_inventory_levels_table.php Loading commit data...
2024_01_01_000038_create_inventory_movements_table.php Loading commit data...
2024_01_01_000039_create_purchase_orders_table.php Loading commit data...
2024_01_01_000040_create_kits_table.php Loading commit data...
2024_01_01_000041_create_stock_counts_table.php Loading commit data...
2024_01_01_000042_create_notifications_system_table.php Loading commit data...
2024_01_01_000043_create_audit_logs_table.php Loading commit data...
2024_01_01_000044_create_evaluations_table.php Loading commit data...
2024_01_01_000045_create_system_settings_table.php Loading commit data...
2024_01_01_000046_add_monthly_rental_cost_to_facilities.php Loading commit data...
2024_01_01_000047_create_receipt_templates_and_branch_settings.php Loading commit data...
2024_01_01_000048_add_service_fee_to_transactions_and_invoices.php Loading commit data...
2024_01_01_000049_add_branch_id_to_participants_and_payments.php Loading commit data...
2024_01_01_000050_simplify_membership_type_and_add_membership_id.php Loading commit data...
2024_01_01_000051_add_cash_session_id_to_payments.php Loading commit data...
2024_01_01_000052_rename_program_id_to_training_program_id_on_training_groups.php Loading commit data...
2024_01_01_000053_create_employees_table.php Loading commit data...
2024_01_01_000054_create_trainers_table.php Loading commit data...
2024_01_01_000055_create_trainer_qualifications_table.php Loading commit data...
2024_01_01_000056_create_trainer_availability_table.php Loading commit data...
2024_01_01_000057_create_documents_table.php Loading commit data...
2024_01_01_000060_alter_trainers_make_employee_nullable.php Loading commit data...
2024_01_01_000061_create_trainer_compensations_table.php Loading commit data...
2024_01_01_000062_create_payroll_periods_table.php Loading commit data...
2024_01_01_000063_create_payslips_table.php Loading commit data...
2024_01_01_000064_create_payslip_items_table.php Loading commit data...
2024_01_01_000065_create_trainer_advances_table.php Loading commit data...
2024_01_01_000066_create_trainer_rate_history_table.php Loading commit data...
2024_01_01_000067_add_label_ar_to_system_settings_table.php Loading commit data...
2024_01_01_000070_create_media_table.php Loading commit data...
2024_01_01_000071_add_default_trainer_to_training_programs.php Loading commit data...
2024_01_01_000071_create_website_settings_table.php Loading commit data...
2024_01_01_000072_create_website_sections_table.php Loading commit data...
2024_01_01_000073_create_website_testimonials_table.php Loading commit data...
2024_01_01_000074_create_website_faqs_table.php Loading commit data...
2024_01_01_000075_create_website_news_table.php Loading commit data...
2024_01_01_000076_create_website_partners_table.php Loading commit data...
2024_01_01_000077_create_contact_submissions_table.php Loading commit data...
2024_01_01_000078_create_whatsapp_messages_table.php Loading commit data...
2024_01_01_000079_add_billing_fields_to_programs_and_enrollments.php Loading commit data...
2024_01_01_000080_add_governorate_to_people_table.php Loading commit data...
2026_07_16_162146_add_is_essential_to_products_table.php Loading commit data...
2026_07_16_180000_add_delivery_tracking_to_invoice_items.php Loading commit data...
2026_07_16_200000_add_annual_billing_to_products_table.php Loading commit data...
2026_07_16_210000_add_installment_amounts_to_product_installment_plans.php Loading commit data...
2026_07_17_000001_widen_training_groups_code_column.php Loading commit data...
2026_07_22_000001_create_facility_rent_payments_table.php Loading commit data...
2026_07_22_000002_create_expenses_table.php Loading commit data...
2026_07_22_000003_add_expense_permissions.php Loading commit data...
2026_07_24_000001_create_events_table.php Loading commit data...
2026_07_24_000002_create_event_registrations_table.php Loading commit data...
2026_07_24_000003_add_event_media_collections.php Loading commit data...
2026_07_24_000004_add_event_permissions.php Loading commit data...
2026_07_24_100001_add_locations_to_events.php Loading commit data...
2026_07_24_100002_default_website_published_true.php Loading commit data...
2026_07_25_000001_add_print_count_to_invoices_and_payments.php Loading commit data...
2026_07_25_000001_website_builder_v2_phase_a.php Loading commit data...
2026_07_25_100001_website_builder_v2_phase_b.php Loading commit data...
2026_07_25_200001_website_builder_v2_phase_c.php Loading commit data...
2026_07_26_000001_add_events_section_key.php Loading commit data...
2026_07_27_000001_create_device_tokens_table.php Loading commit data...
2026_07_27_000002_add_channel_push_to_notification_preferences.php Loading commit data...
2026_07_27_000003_create_contact_messages_table.php Loading commit data...
2026_07_27_000004_seed_mobile_app_system_settings.php Loading commit data...
2026_07_27_000005_create_service_requests_table.php Loading commit data...
2026_07_27_100001_create_push_announcements_table.php Loading commit data...
2026_07_27_100002_create_push_analytics_table.php Loading commit data...
2026_07_28_000001_drop_membership_id_unique_index.php Loading commit data...
2026_08_02_000001_add_partial_payment_to_products_table.php Loading commit data...
2026_08_02_000002_add_partially_paid_to_pos_payment_status.php Loading commit data...
2026_08_09_000001_add_external_revenue_to_expenses_category.php Loading commit data...
2026_08_09_000002_add_collected_by_to_invoices.php Loading commit data...
2026_08_10_000001_add_preferred_branch_to_users.php Loading commit data...
2026_08_10_000002_add_status_to_expenses.php Loading commit data...
2026_08_13_000001_enable_partial_payment_all_products.php Loading commit data...
2026_08_14_000001_add_attachment_to_expenses.php Loading commit data...
2026_08_19_000001_add_is_free_to_participants.php Loading commit data...
2026_08_30_000001_pricing_discount_overhaul.php Loading commit data...
2026_08_30_000002_seed_pricing_discount_settings.php Loading commit data...
2026_08_30_000003_facility_activities_and_default_layouts.php Loading commit data...
2026_08_30_000004_normalize_user_credentials.php Loading commit data...
2026_08_31_000001_add_attachment_metadata_to_expenses.php Loading commit data...
2026_08_31_000001_create_website_pages_and_blocks.php Loading commit data...
2026_08_31_000001_trim_stray_whitespace_from_names.php Loading commit data...
2026_08_31_000002_add_subject_to_contact_submissions.php Loading commit data...
2026_08_31_000003_create_website_menus.php Loading commit data...
2026_09_01_000001_add_branches_view_all_permission.php Loading commit data...
2026_09_01_000002_backfill_pos_invoice_item_types.php Loading commit data...
2026_09_01_000003_create_program_products_table.php Loading commit data...
2026_09_01_000004_bundle_registration_product_to_team_programs.php Loading commit data...
2026_09_01_000005_revoke_mobile_api_tokens.php Loading commit data...
2026_09_02_000001_backfill_freetext_product_invoice_items.php Loading commit data...
2026_09_03_000001_seed_financial_accounts_for_every_academy.php Loading commit data...
2026_09_03_000002_branch_attribution_for_money.php Loading commit data...
2026_09_03_000003_tenancy_invariant_repairs.php Loading commit data...
2026_09_03_000004_reconcile_check_vocabularies.php Loading commit data...
2026_09_03_000005_create_invoice_number_counters.php Loading commit data...
2026_09_03_000006_repair_mobile_invoice_item_totals.php Loading commit data...
2026_09_04_000001_branding_single_source_of_truth.php Loading commit data...
2026_09_05_000001_add_player_role_and_portal_permissions.php Loading commit data...
2026_09_05_000002_create_portal_invitations.php Loading commit data...
2026_09_06_000001_add_channel_to_published_content.php Loading commit data...
2026_09_07_000001_create_checkin_infrastructure.php Loading commit data...
2026_09_08_000001_add_instapay_payment_method.php Loading commit data...
2026_09_08_000002_create_payment_proofs.php Loading commit data...
2026_09_09_000001_allow_web_push_device_tokens.php Loading commit data...
2026_09_10_000001_create_consents_and_deletion_requests.php Loading commit data...
2026_09_10_000002_excuses_are_service_requests.php Loading commit data...
2026_09_11_000001_self_registration_infrastructure.php Loading commit data...
2026_09_12_000001_add_branch_presentation_and_season_window.php Loading commit data...
2026_09_12_000002_add_navbar_and_footer_presentation_settings.php Loading commit data...
2026_09_12_000003_allow_glass_navbar_style.php Loading commit data...
2026_09_12_000004_add_english_navbar_cta_text.php Loading commit data...