@extends('layouts/contentLayoutMaster') @section('title', 'Edit Templates') @section('main-page', 'Templates') @section('sub-page', 'Edit Templates') @section('main-page-url', route("product-templates.index")) @section('sub-page-url', route('product-templates.edit',$model->id)) @section('vendor-style') @endsection @section('content')
@php $preselectedIndustryIds = $model->industries->whereNull('parent_id')->pluck('id')->values(); $preselectedSubIndustryIds = $model->industries->whereNotNull('parent_id')->pluck('id')->values(); $selectedTableauSceneIds = $model->tableauScenes?->pluck('id')->map(fn ($id) => (string) $id)->values()->toArray() ?? []; $existingScenePositions = $model->tableauScenes ?->mapWithKeys(function ($scene) { $positions = $scene->pivot->positions ?? []; if (is_string($positions)) { $positions = json_decode($positions, true) ?: []; } return [(string) $scene->id => $positions]; }) ->toArray() ?? []; $category = \App\Models\Category::find(request('product_without_category_id')); @endphp
@csrf @method("PUT")
@php $colors = collect($model->colors) ?? collect(); $hasColors = $colors->isNotEmpty(); @endphp {{-- @if($model->approach == 'without_editor')--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{-- @forelse($colors as $color)--}} {{--
--}} {{-- --}} {{-- --}}{{-- Color value --}} {{--
--}} {{-- --}} {{--
--}} {{-- --}}{{-- Color picker --}} {{-- --}} {{-- --}}{{-- Text hex input (submitted) --}} {{-- --}} {{--
--}} {{-- --}} {{-- Pick a color or type hex (e.g. #FFAA00).--}} {{-- --}} {{--
--}} {{-- --}}{{-- Color image --}} {{--
--}} {{-- --}} {{-- @php--}} {{-- $mediaWithColor = $model--}} {{-- ->getMedia('color_templates')--}} {{-- ->first(fn ($media) =>--}} {{-- $media->getCustomProperty('color_hex') ==$color);--}} {{-- @endphp--}} {{--
--}} {{--
--}} {{-- Drop image or click--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{-- --}}{{-- Delete row --}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{-- @empty--}} {{--
--}} {{-- --}} {{--
--}} {{-- --}} {{--
--}} {{-- --}} {{-- --}} {{--
--}} {{-- Pick a color or type--}} {{-- hex (e.g. #FFAA00).--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{-- Drop image or click--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{-- @endforelse--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- @endif--}}

Template Details
@foreach(config("app.locales") as $locale)
@endforeach
@foreach(\App\Models\Type::when( ($category?->is_tableau), fn($q) => $q->whereValue(\App\Enums\Template\TypeEnum::FRONT) )->get(['id','value']) as $type)
@endforeach
@if($model->approach == 'without_editor')
Drop front image here or click
Allowed formats: PNG, JPG, JPEG, WEBP. Maximum file size: 30 MB. Minimum dimensions: 1000 × 1000 px.
Drop back image here or click
Allowed formats: PNG, JPG, JPEG, WEBP. Maximum file size: 30 MB. Minimum dimensions: 1000 × 1000 px.
{{--
--}} {{-- --}} {{--
--}} {{--
--}} {{-- Drop general image here or click--}} {{--
--}} {{-- --}} {{--
--}} {{-- --}} {{-- Allowed formats: PNG, JPG, JPEG, WEBP.--}} {{-- Maximum file size: 30 MB.--}} {{-- Minimum dimensions: 1000 × 1000 px.--}} {{-- --}} {{--
--}} @endif @if(($category && !$category->has_mockup) || !$category )
Drop image here or click to upload
Upload an image with an 8:9 aspect ratio (for example, 618 × 700 px).
@endif

Products & Categories
{{-- TABLEAU SCENE --}}
{{-- Choose existing scenes --}}
or create new scene
{{-- New scene name --}}
{{-- New scene image --}}
Drop tableau scene image here or click
Upload the scene image, then click Create Scene. The created scene will be selected automatically.
{{-- SCENE POSITION EDITOR --}}

Scene Position Editor

Drag the template overlay on each scene, then click Save Positions before saving the template.

Mockups
Select a mockup to show this template on it.
Optional

Industry
@can("tags_create") @endcan
@if($model->approach == 'with_editor')

Design Specifications
{{-- Persisted resources (used on submit / ajax) --}}

Guides Settings
has_corner == 0) >
has_corner == 1) >
has_safety_area ? 'checked' : '' }} >
Padding inside the design area.
{{-- Cut Margin (col-6) --}}
{{-- send 0 when unchecked --}} cut_margin > 0) >
{{-- Padding inside the design--}} {{-- area.--}}
If no size is selected, the default 650×650 will be applied.
@endif
{{-- default: don't go to editor --}} @if($model->approach == 'with_editor') @endif
@include('modals.tags.add-tag') @endsection @section('vendor-script') @endsection @section('page-script') {{-- Replace the first @endsection