@php // The input values saved with this tag, keyed by the template's input // placeholder, so an edit re-opens the form exactly as it was submitted. $savedInputs = []; if (!empty($tag->data)) { foreach ((json_decode($tag->data, true) ?: []) as $key => $value) { if (is_array($value)) { continue; } $savedInputs[str_replace(' ', '_', $key)] = $value; } } @endphp

{{ trans("common.description") }}

    @foreach(preg_split("/\r\n|\n|\r/", (string) $prompt->description) as $line)
  • {{ $line }}
  • @endforeach

{{ $prompt->name }}

    @foreach(preg_split("/\r\n|\n|\r/", (string) $prompt->example) as $line)
  • {{ $line }}
  • @endforeach
/
@if(!empty($prompt->tones)) @foreach($tones as $tone) @if(!empty($tone["input_field"]) and !empty($tone["input_placeholder"]) and !empty($tone["input_type"])) @if($tone["input_type"] == "textarea")
{{$tone["input_desc"]}}
@endif @if($tone["input_type"] == "input")
{{$tone["input_desc"]}}
@endif @if($tone["input_type"] == "dropdown")
{{$tone["input_desc"]}}
@endif @endif @endforeach @endif @if($prompt->instructions)
{{trans('content_tags.add_new.form.additional_detail')}}
@endif @if($prompt->tone)
@php // The value is the instruction handed to the model, so it stays // English; only the label the user reads is translated. $toneOptions = [ 'Professional/Formal' => 'professional_formal', 'Friendly/Casual' => 'friendly_casual', 'Persuasive/Sales-oriented' => 'persuasive_sales_oriented', 'Informative/Educational' => 'informative_educational', 'Enthusiastic/Energetic' => 'enthusiastic_energetic', 'Serious/Sober' => 'serious_sober', 'Humorous/Witty' => 'humorous_witty', 'Inspirational/Motivational'=> 'inspirational_motivational', 'Empathetic/Understanding' => 'empathetic_understanding', 'Technical/Expert' => 'technical_expert', 'Creative/Innovative' => 'creative_innovative', ]; $selectedTone = isset($savedInputs['tone_type']) ? $savedInputs['tone_type'] : ''; @endphp
@endif