Phase 4 work order profile depth

This commit is contained in:
Codex
2026-07-10 13:24:07 -05:00
parent 084b945e75
commit 24fd8c0c5c
21 changed files with 1031 additions and 110 deletions
+42 -7
View File
@@ -1,23 +1,58 @@
@php
$policiesText = collect($profile?->hiring_policies ?? [])->map(fn ($row) => trim(($row['name'] ?? '').' | '.($row['summary'] ?? ''), ' |'))->implode("\n");
$locationsText = collect($profile?->locations ?? [])->map(fn ($row) => trim(($row['name'] ?? '').' | '.($row['region'] ?? ''), ' |'))->implode("\n");
$visibility = $profile?->profile_visibility ?? [];
$visible = fn (string $field): bool => (bool) ($visibility[$field] ?? true);
@endphp
<x-app-layout>
<x-slot name="header"><h2 class="text-xl font-semibold">Buyer Profile</h2></x-slot>
<div class="mx-auto max-w-5xl p-6">
<form method="POST" action="{{ route('buyers.update') }}" class="space-y-4 rounded border bg-white p-6">
@csrf @method('PUT')
<x-slot name="header">
<x-page-header
title="Buyer Profile"
description="Build a public company profile with hiring regions, onboarding policies, locations, and sample identity files."
/>
</x-slot>
<div class="mx-auto max-w-5xl space-y-6 px-4 py-8 sm:px-6 lg:px-8">
<form method="POST" action="{{ route('buyers.update') }}" class="tse-panel space-y-4 p-6">
@csrf
@method('PUT')
<x-field name="company_name" label="Company name" :value="$profile?->company_name" />
<x-field name="headline" label="Headline" :value="$profile?->headline" />
<x-field name="description" label="Description" :value="$profile?->description" textarea />
<x-field name="service_categories" label="Service categories" :value="$profile?->service_categories" textarea />
<x-field name="hiring_regions" label="Hiring regions" :value="$profile?->hiring_regions" textarea />
<x-field name="hiring_policies_text" label="Structured hiring policies" :value="$policiesText" textarea help="One per line. Use: policy name | summary, for example Net 15 ACH | Direct payment after approval." />
<x-field name="locations_text" label="Locations" :value="$locationsText" textarea help="One per line. Use: location name | region, for example Tulsa dispatch | Oklahoma." />
<x-field name="vendor_onboarding" label="Vendor onboarding" :value="$profile?->vendor_onboarding" textarea />
<x-field name="payment_terms" label="Payment terms" :value="$profile?->payment_terms" textarea />
<x-field name="website_url" label="Website URL" :value="$profile?->website_url" />
<x-field name="contact_email" label="Contact email" :value="$profile?->contact_email" />
<label class="flex gap-2 text-sm"><input type="checkbox" name="public_contact" value="1" @checked($profile?->public_contact)> Show contact details publicly</label>
<div class="rounded-md border border-slate-200 p-4 dark:border-slate-800">
<h3 class="font-semibold text-slate-950 dark:text-white">Public sections</h3>
<p class="mt-1 text-sm text-slate-600 dark:text-slate-400">Unchecked sections remain private to the buyer profile owner.</p>
<div class="mt-3 grid gap-3 md:grid-cols-3">
@foreach (['description' => 'Description', 'categories' => 'Categories', 'locations' => 'Locations', 'policies' => 'Hiring policies', 'payment_terms' => 'Payment terms', 'onboarding' => 'Onboarding'] as $key => $label)
<label class="inline-flex items-center gap-2 text-sm text-slate-700 dark:text-slate-300">
<input type="checkbox" name="profile_visibility[{{ $key }}]" value="1" @checked($visible($key)) class="rounded border-slate-300 text-sky-600 shadow-sm focus:ring-sky-500 dark:border-slate-700 dark:bg-slate-950">
{{ $label }}
</label>
@endforeach
</div>
</div>
<label class="flex gap-2 text-sm text-slate-700 dark:text-slate-300">
<input type="checkbox" name="public_contact" value="1" @checked($profile?->public_contact) class="rounded border-slate-300 text-sky-600 shadow-sm focus:ring-sky-500 dark:border-slate-700 dark:bg-slate-950">
Show contact details publicly
</label>
<x-field name="private_notes" label="Private notes" :value="$profile?->private_notes" textarea help="Internal notes for your company account. These are not shown publicly." />
<x-primary-button>Save buyer profile</x-primary-button>
</form>
@if ($profile)
<section class="mt-6 rounded border bg-white p-6">
<h3 class="font-semibold">Company photos and files</h3>
<section class="tse-panel p-6">
<h3 class="font-semibold text-slate-950 dark:text-white">Company identity, logos, location photos, and sample files</h3>
<p class="mt-1 text-sm text-slate-600 dark:text-slate-400">Use captions to distinguish logo, header, office, site, or example work-order files.</p>
<x-attachments :attachments="$profile->attachments" />
<x-attachment-form type="buyer_profile" :id="$profile->id" kind="profile" />
</section>
+67 -13
View File
@@ -1,16 +1,70 @@
<x-app-layout>
<x-slot name="header"><h2 class="text-xl font-semibold">{{ $profile->company_name }}</h2></x-slot>
<div class="mx-auto max-w-5xl rounded border bg-white p-6">
<p class="text-lg font-semibold">{{ $profile->headline }}</p>
<p class="mt-4 whitespace-pre-line">{{ $profile->description }}</p>
<dl class="mt-6 grid gap-4 md:grid-cols-2">
<div><dt class="text-sm text-gray-500">Service categories</dt><dd class="whitespace-pre-line">{{ $profile->service_categories }}</dd></div>
<div><dt class="text-sm text-gray-500">Hiring regions</dt><dd class="whitespace-pre-line">{{ $profile->hiring_regions }}</dd></div>
<div><dt class="text-sm text-gray-500">Vendor onboarding</dt><dd class="whitespace-pre-line">{{ $profile->vendor_onboarding }}</dd></div>
<div><dt class="text-sm text-gray-500">Payment terms</dt><dd class="whitespace-pre-line">{{ $profile->payment_terms }}</dd></div>
</dl>
<x-attachments :attachments="$profile->attachments" />
<x-rating-summary :ratings="$profile->ratings" />
<x-rating-form type="buyer_profile" :id="$profile->id" category="buyer_overall" />
<x-slot name="header">
<x-page-header
title="{{ $profile->company_name }}"
:description="$profile->headline"
/>
</x-slot>
<div class="mx-auto max-w-5xl space-y-6 px-4 py-8 sm:px-6 lg:px-8">
<section class="tse-panel p-6">
<div class="flex flex-wrap gap-2">
@if ($profile->public_contact)
<x-badge tone="emerald">Public contact</x-badge>
@endif
@if ($profile->hiring_regions)
<x-badge tone="slate">{{ $profile->hiring_regions }}</x-badge>
@endif
</div>
@if ($profile->visible('description'))
<p class="mt-4 whitespace-pre-line text-slate-700 dark:text-slate-300">{{ $profile->description }}</p>
@endif
<dl class="mt-6 grid gap-4 md:grid-cols-2">
@if ($profile->visible('categories'))
<div><dt class="text-sm text-slate-500 dark:text-slate-400">Service categories</dt><dd class="whitespace-pre-line text-slate-700 dark:text-slate-300">{{ $profile->service_categories }}</dd></div>
@endif
@if ($profile->visible('locations'))
<div>
<dt class="text-sm text-slate-500 dark:text-slate-400">Locations</dt>
<dd class="mt-2 space-y-2">
@forelse ($profile->locations ?? [] as $location)
<x-badge tone="slate">{{ $location['name'] }}{{ ! empty($location['region']) ? ' | '.$location['region'] : '' }}</x-badge>
@empty
<span class="whitespace-pre-line text-sm text-slate-600 dark:text-slate-400">{{ $profile->hiring_regions }}</span>
@endforelse
</dd>
</div>
@endif
@if ($profile->visible('policies'))
<div>
<dt class="text-sm text-slate-500 dark:text-slate-400">Hiring policies</dt>
<dd class="mt-2 space-y-2">
@forelse ($profile->hiring_policies ?? [] as $policy)
<div class="rounded-md border border-slate-200 p-3 text-sm dark:border-slate-800">
<p class="font-semibold text-slate-950 dark:text-white">{{ $policy['name'] }}</p>
@if (! empty($policy['summary']))
<p class="mt-1 text-slate-600 dark:text-slate-400">{{ $policy['summary'] }}</p>
@endif
</div>
@empty
<span class="text-sm text-slate-600 dark:text-slate-400">No structured policies listed.</span>
@endforelse
</dd>
</div>
@endif
@if ($profile->visible('onboarding'))
<div><dt class="text-sm text-slate-500 dark:text-slate-400">Vendor onboarding</dt><dd class="whitespace-pre-line text-slate-700 dark:text-slate-300">{{ $profile->vendor_onboarding }}</dd></div>
@endif
@if ($profile->visible('payment_terms'))
<div><dt class="text-sm text-slate-500 dark:text-slate-400">Payment terms</dt><dd class="whitespace-pre-line text-slate-700 dark:text-slate-300">{{ $profile->payment_terms }}</dd></div>
@endif
</dl>
<x-attachments :attachments="$profile->attachments" />
<x-rating-summary :ratings="$profile->ratings" />
<x-rating-form type="buyer_profile" :id="$profile->id" category="buyer_overall" />
</section>
</div>
</x-app-layout>