2023-12-09 15:47:03 +01:00
|
|
|
<template>
|
|
|
|
|
<div class="flex flex-col min-h-full">
|
2024-04-15 19:39:03 +02:00
|
|
|
<breadcrumb
|
|
|
|
|
v-if="template"
|
|
|
|
|
:path="breadcrumbs"
|
|
|
|
|
>
|
|
|
|
|
<template #left>
|
|
|
|
|
<div
|
|
|
|
|
v-if="canEditTemplate"
|
|
|
|
|
class="ml-5"
|
|
|
|
|
>
|
|
|
|
|
<v-button
|
|
|
|
|
color="gray"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.prevent="showFormTemplateModal = true"
|
2024-01-11 09:48:57 +01:00
|
|
|
>
|
2024-04-15 19:39:03 +02:00
|
|
|
Edit Template
|
2024-01-11 09:48:57 +01:00
|
|
|
</v-button>
|
2024-04-15 19:39:03 +02:00
|
|
|
<form-template-modal
|
|
|
|
|
v-if="form"
|
|
|
|
|
:form="form"
|
|
|
|
|
:template="template"
|
|
|
|
|
:show="showFormTemplateModal"
|
|
|
|
|
@close="showFormTemplateModal = false"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #right>
|
|
|
|
|
<v-button
|
|
|
|
|
v-if="canEditTemplate"
|
|
|
|
|
v-track.copy_template_button_clicked
|
|
|
|
|
size="small"
|
|
|
|
|
color="white"
|
|
|
|
|
class="mr-5"
|
|
|
|
|
@click.prevent="copyTemplateUrl"
|
|
|
|
|
>
|
|
|
|
|
Copy Template URL
|
|
|
|
|
</v-button>
|
|
|
|
|
<v-button
|
|
|
|
|
v-track.use_template_button_clicked
|
|
|
|
|
size="small"
|
|
|
|
|
class="mr-5"
|
|
|
|
|
:to="createFormWithTemplateUrl"
|
|
|
|
|
>
|
|
|
|
|
Use this template
|
|
|
|
|
</v-button>
|
|
|
|
|
</template>
|
2023-12-09 15:47:03 +01:00
|
|
|
</breadcrumb>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<p
|
|
|
|
|
v-if="template === null || !template"
|
|
|
|
|
class="text-center my-4"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
We could not find this template.
|
|
|
|
|
</p>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<section class="pt-12 bg-gray-50 sm:pt-16 border-b pb-[250px] relative">
|
|
|
|
|
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl">
|
2024-04-15 19:39:03 +02:00
|
|
|
<div
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
class="flex flex-col items-center justify-center max-w-5xl gap-8 mx-auto md:gap-12 md:flex-row"
|
2024-04-15 19:39:03 +02:00
|
|
|
>
|
|
|
|
|
<div
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
class="aspect-[4/3] shrink-0 rounded-lg shadow-sm overflow-hidden group w-full max-w-sm relative"
|
2024-04-15 19:39:03 +02:00
|
|
|
>
|
|
|
|
|
<img
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
class="object-cover w-full h-full transition-all duration-200 group-hover:scale-110 absolute inset-0"
|
2024-04-15 19:39:03 +02:00
|
|
|
:src="template.image_url"
|
|
|
|
|
alt="Template cover image"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex-1 text-center md:text-left relative">
|
2024-04-15 19:39:03 +02:00
|
|
|
<h1
|
|
|
|
|
class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
{{ template.name }}
|
|
|
|
|
</h1>
|
|
|
|
|
<p class="mt-2 text-lg font-normal text-gray-600">
|
|
|
|
|
{{ cleanQuotes(template.short_description) }}
|
|
|
|
|
</p>
|
2024-04-15 19:39:03 +02:00
|
|
|
<template-tags
|
|
|
|
|
:template="template"
|
|
|
|
|
:display-all="true"
|
|
|
|
|
class="flex flex-wrap items-center justify-center gap-3 mt-4 md:justify-start"
|
2023-12-19 15:24:54 +01:00
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
<section class="w-full max-w-4xl relative px-4 mx-auto sm:px-6 lg:px-8 -mt-[210px]">
|
|
|
|
|
<div
|
|
|
|
|
class="p-4 mx-auto bg-white shadow-lg sm:p-6 lg:p-8 rounded-xl ring-1 ring-inset ring-gray-200 isolate"
|
|
|
|
|
>
|
|
|
|
|
<p class="text-sm font-medium text-center text-gray-500 -mt-2 mb-2">
|
|
|
|
|
Template Preview
|
|
|
|
|
</p>
|
|
|
|
|
<open-complete-form
|
|
|
|
|
ref="open-complete-form"
|
|
|
|
|
:form="form"
|
|
|
|
|
:mode="FormMode.TEST"
|
|
|
|
|
class="mb-4 p-4 bg-gray-50 border border-gray-200 border-dashed rounded-lg"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="absolute bottom-0 translate-y-full inset-x-0">
|
|
|
|
|
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl -mt-[20px]">
|
|
|
|
|
<div class="flex items-center justify-center">
|
2024-04-15 19:39:03 +02:00
|
|
|
<v-button
|
|
|
|
|
v-track.use_template_button_clicked
|
|
|
|
|
class="mx-auto w-full max-w-[300px]"
|
|
|
|
|
:to="createFormWithTemplateUrl"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
Use this template
|
|
|
|
|
</v-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center justify-center">
|
|
|
|
|
<div class="text-left mx-auto text-gray-500 text-xs mt-4">
|
|
|
|
|
✓ Core features 100% free<br>
|
|
|
|
|
✓ No credit card required<br>
|
|
|
|
|
✓ No submissions limit on Free plan
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="pt-20 pb-12 bg-white sm:pb-16">
|
|
|
|
|
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl">
|
2024-04-15 19:39:03 +02:00
|
|
|
<div
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
class="max-w-4xl mx-auto mt-16 space-y-12 sm:mt-16 sm:space-y-16"
|
2024-04-15 19:39:03 +02:00
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="nf-text"
|
|
|
|
|
v-html="template.description"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
|
|
|
|
|
<template v-if="template.questions.length > 0">
|
|
|
|
|
<hr class="mt-12 border-gray-200">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="text-center">
|
2024-04-15 19:39:03 +02:00
|
|
|
<h3
|
|
|
|
|
class="text-xl font-bold tracking-tight text-gray-900 sm:text-2xl"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
Frequently asked questions
|
|
|
|
|
</h3>
|
|
|
|
|
<p class="mt-2 text-base font-normal text-gray-600">
|
|
|
|
|
Everything you need to know about this template.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<dl class="mt-12 space-y-10">
|
2024-04-15 19:39:03 +02:00
|
|
|
<div
|
|
|
|
|
v-for="(ques, ques_key) in template.questions"
|
|
|
|
|
:key="ques_key"
|
|
|
|
|
class="space-y-4"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
<dt class="font-semibold text-gray-900 dark:text-gray-100">
|
|
|
|
|
{{ ques.question }}
|
|
|
|
|
</dt>
|
2024-04-15 19:39:03 +02:00
|
|
|
<dd
|
|
|
|
|
class="mt-2 leading-6 text-gray-600 dark:text-gray-400"
|
|
|
|
|
v-html="ques.answer"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
</dl>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<section
|
|
|
|
|
v-if="relatedTemplates && relatedTemplates.length > 0"
|
|
|
|
|
class="py-12 bg-white border-t border-gray-200 sm:py-16"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl">
|
|
|
|
|
<div class="flex items-center justify-between">
|
2024-04-15 19:39:03 +02:00
|
|
|
<h4
|
|
|
|
|
class="text-xl font-bold tracking-tight text-gray-900 sm:text-2xl"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
Related templates
|
|
|
|
|
</h4>
|
2024-04-15 19:39:03 +02:00
|
|
|
<v-button
|
|
|
|
|
:to="{ name: 'templates' }"
|
|
|
|
|
color="white"
|
|
|
|
|
size="small"
|
|
|
|
|
:arrow="true"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
View All
|
|
|
|
|
</v-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<div
|
|
|
|
|
class="grid grid-cols-1 gap-8 mt-8 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 sm:gap-y-12"
|
|
|
|
|
>
|
|
|
|
|
<single-template
|
|
|
|
|
v-for="related in relatedTemplates"
|
|
|
|
|
:key="related.id"
|
|
|
|
|
:template="related"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="py-12 bg-white border-t border-gray-200 sm:py-16">
|
|
|
|
|
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl">
|
|
|
|
|
<div class="text-center">
|
2024-04-15 19:39:03 +02:00
|
|
|
<h4
|
|
|
|
|
class="text-xl font-bold tracking-tight text-gray-900 sm:text-2xl"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
How OpnForm works
|
|
|
|
|
</h4>
|
|
|
|
|
</div>
|
|
|
|
|
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
<div class="grid grid-cols-1 mt-12 md:grid-cols-2 gap-x-8 gap-y-12 max-w-5xl mx-auto">
|
2023-12-09 15:47:03 +01:00
|
|
|
<div
|
|
|
|
|
class="flex flex-col items-center gap-4 text-center lg:items-start sm:text-left sm:items-start xl:flex-row"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="inline-flex items-center justify-center w-10 h-10 text-base font-bold bg-white rounded-full shadow-sm ring-1 ring-inset ring-gray-200 text-blue-500 shrink-0"
|
|
|
|
|
>
|
|
|
|
|
1
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<h5 class="text-base font-bold leading-tight text-gray-900">
|
|
|
|
|
Copy the template and change it the way you like
|
|
|
|
|
</h5>
|
|
|
|
|
<p class="mt-2 text-sm font-normal text-gray-600">
|
2024-01-03 11:30:48 +01:00
|
|
|
<NuxtLink :to="createFormWithTemplateUrl">
|
2023-12-09 15:47:03 +01:00
|
|
|
Click here to copy this template
|
2023-12-22 10:24:51 +01:00
|
|
|
</NuxtLink>
|
2024-04-15 19:39:03 +02:00
|
|
|
and start customizing it. Change the questions, add new ones,
|
|
|
|
|
choose colors and more.
|
2023-12-09 15:47:03 +01:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="flex flex-col items-center gap-4 text-center lg:items-start sm:text-left sm:items-start xl:flex-row"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="inline-flex items-center justify-center w-10 h-10 text-base font-bold bg-white rounded-full shadow-sm ring-1 ring-inset ring-gray-200 text-blue-500 shrink-0"
|
|
|
|
|
>
|
|
|
|
|
2
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<h5 class="text-base font-bold leading-tight text-gray-900">
|
|
|
|
|
Embed the form or share it via a link
|
|
|
|
|
</h5>
|
|
|
|
|
<p class="mt-2 text-sm font-normal text-gray-600">
|
2024-04-15 19:39:03 +02:00
|
|
|
You can directly share your form link, or embed the form on
|
|
|
|
|
your website. It's magic! 🪄
|
2023-12-09 15:47:03 +01:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- add video here -->
|
|
|
|
|
<!-- <div class="max-w-5xl mx-auto mt-12 shadow-sm rounded-xl bg-blue-50 aspect-video" />-->
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<open-form-footer class="mt-8 border-t" />
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
<script setup>
|
2024-04-15 19:39:03 +02:00
|
|
|
import { computed } from "vue"
|
|
|
|
|
import OpenCompleteForm from "../../components/open/forms/OpenCompleteForm.vue"
|
|
|
|
|
import Breadcrumb from "~/components/global/Breadcrumb.vue"
|
|
|
|
|
import SingleTemplate from "../../components/pages/templates/SingleTemplate.vue"
|
|
|
|
|
import { fetchTemplate } from "~/stores/templates.js"
|
|
|
|
|
import FormTemplateModal from "~/components/open/forms/components/templates/FormTemplateModal.vue"
|
Decouple title from title block (#696)
* Decouple title from title block
* fix lint
* remove dry run for FormTitleMigration
* Skip form title migration for forms with hidden titles
* Refactor AI Form Generation with Dedicated Prompt Services
- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'
* Consolidate Template Metadata Generation with Unified Prompt Service
- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing
* Implement Form Mode Strategy for Flexible Form Rendering
- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability
* Refine Form Mode Strategy Display Behavior
- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies
* Enhance Form Template Generation with Advanced Field Options
- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations
* Remove Deprecated Template Metadata Generation Services
- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach
* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation
- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata
* Refactor Template Preview Section Layout
- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability
* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes
- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.
These changes aim to enhance code readability and maintainability across the affected files.
---------
Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
|
|
|
import { FormMode } from "~/lib/forms/FormModeStrategy.js"
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2024-01-02 16:35:16 +01:00
|
|
|
defineRouteRules({
|
2024-04-15 19:39:03 +02:00
|
|
|
swr: 3600,
|
2024-01-02 16:35:16 +01:00
|
|
|
})
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
const { copy } = useClipboard()
|
2023-12-19 13:46:55 +01:00
|
|
|
const authStore = useAuthStore()
|
|
|
|
|
const templatesStore = useTemplatesStore()
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
const route = useRoute()
|
|
|
|
|
const slug = computed(() => route.params.slug)
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
const template = computed(() => templatesStore.getByKey(slug.value))
|
|
|
|
|
const form = computed(() => template.value.structure)
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
// Fetch the template
|
|
|
|
|
if (!template.value) {
|
2024-04-15 19:39:03 +02:00
|
|
|
const { data } = await fetchTemplate(slug.value)
|
2023-12-19 13:46:55 +01:00
|
|
|
templatesStore.save(data.value)
|
|
|
|
|
}
|
2023-12-18 10:35:00 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
// Fetch related templates
|
2024-04-15 19:39:03 +02:00
|
|
|
const { data: relatedTemplatesData } = await useAsyncData(
|
|
|
|
|
"related-templates",
|
|
|
|
|
() => {
|
|
|
|
|
return Promise.all(
|
|
|
|
|
template.value.related_templates.map((slug) => {
|
|
|
|
|
if (templatesStore.getByKey(slug)) {
|
|
|
|
|
return Promise.resolve(templatesStore.getByKey(slug))
|
|
|
|
|
}
|
|
|
|
|
return fetchTemplate(slug).then((res) => res.data.value)
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
)
|
2023-12-19 13:46:55 +01:00
|
|
|
templatesStore.save(relatedTemplatesData.value)
|
2023-12-19 15:24:54 +01:00
|
|
|
templatesStore.initTypesAndIndustries()
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
// State
|
|
|
|
|
const showFormTemplateModal = ref(false)
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
// Computed
|
|
|
|
|
const breadcrumbs = computed(() => {
|
|
|
|
|
if (!template.value) {
|
2024-04-15 19:39:03 +02:00
|
|
|
return [{ route: { name: "templates" }, label: "Templates" }]
|
2023-12-19 13:46:55 +01:00
|
|
|
}
|
2024-04-15 19:39:03 +02:00
|
|
|
return [
|
|
|
|
|
{ route: { name: "templates" }, label: "Templates" },
|
|
|
|
|
{ label: template.value.name },
|
|
|
|
|
]
|
2023-12-19 13:46:55 +01:00
|
|
|
})
|
2024-04-15 19:39:03 +02:00
|
|
|
const relatedTemplates = computed(() =>
|
|
|
|
|
templatesStore.getByKey(template?.value?.related_templates),
|
|
|
|
|
)
|
|
|
|
|
const canEditTemplate = computed(
|
|
|
|
|
() =>
|
|
|
|
|
authStore.check &&
|
|
|
|
|
template.value &&
|
2024-08-29 11:08:09 +02:00
|
|
|
template.value?.from_prod !== true &&
|
2024-04-15 19:39:03 +02:00
|
|
|
(authStore.user.admin ||
|
|
|
|
|
authStore.user.template_editor ||
|
|
|
|
|
template.value.creator_id === authStore.user.id),
|
|
|
|
|
)
|
2023-12-19 13:46:55 +01:00
|
|
|
const createFormWithTemplateUrl = computed(() => {
|
2024-04-15 19:39:03 +02:00
|
|
|
return {
|
|
|
|
|
name: authStore.check ? "forms-create" : "forms-create-guest",
|
|
|
|
|
query: { template: template?.value?.slug },
|
|
|
|
|
}
|
2023-12-19 13:46:55 +01:00
|
|
|
})
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
// methods
|
|
|
|
|
const cleanQuotes = (str) => {
|
|
|
|
|
// Remove starting and ending quotes if any
|
2024-04-15 19:39:03 +02:00
|
|
|
return str ? str.replace(/^"/, "").replace(/"$/, "") : ""
|
2023-12-19 13:46:55 +01:00
|
|
|
}
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2023-12-19 13:46:55 +01:00
|
|
|
const copyTemplateUrl = () => {
|
2024-01-05 09:59:53 +01:00
|
|
|
copy(template.value.share_url)
|
2024-04-15 19:39:03 +02:00
|
|
|
useAlert().success("Copied!")
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
2023-12-19 13:46:55 +01:00
|
|
|
|
2024-01-04 18:38:50 +01:00
|
|
|
useOpnSeoMeta({
|
|
|
|
|
title: () => {
|
2024-04-15 19:39:03 +02:00
|
|
|
if (!template.value || !template.value) return "Form Template"
|
2024-01-05 11:00:34 +01:00
|
|
|
return template.value.name
|
2024-01-04 18:38:50 +01:00
|
|
|
},
|
2024-01-11 09:48:57 +01:00
|
|
|
description() {
|
2024-04-15 19:39:03 +02:00
|
|
|
if (!template.value || !template.value) return null
|
2024-01-04 18:38:50 +01:00
|
|
|
// take the first 140 characters of the description
|
2024-04-15 19:39:03 +02:00
|
|
|
return (
|
|
|
|
|
template.value.short_description?.substring(0, 140) +
|
|
|
|
|
"... | Customize any template and create your own form in minutes."
|
|
|
|
|
)
|
2024-01-04 18:38:50 +01:00
|
|
|
},
|
2024-01-11 09:48:57 +01:00
|
|
|
ogImage() {
|
2024-04-15 19:39:03 +02:00
|
|
|
if (!template.value || !template.value) return null
|
2024-01-04 18:38:50 +01:00
|
|
|
return template.value.image_url
|
|
|
|
|
},
|
2024-01-12 15:59:01 +01:00
|
|
|
robots: () => {
|
2024-04-15 19:39:03 +02:00
|
|
|
if (!template.value || !template.value) return null
|
|
|
|
|
return template.value.publicly_listed ? null : "noindex"
|
|
|
|
|
},
|
2024-01-04 18:38:50 +01:00
|
|
|
})
|
2023-12-09 15:47:03 +01:00
|
|
|
</script>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<style lang="scss">
|
2023-12-09 15:47:03 +01:00
|
|
|
.nf-text {
|
|
|
|
|
@apply space-y-4;
|
|
|
|
|
h2 {
|
|
|
|
|
@apply text-sm font-normal tracking-widest text-gray-500 uppercase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
@apply font-normal leading-7 text-gray-900 dark:text-gray-100;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ol {
|
|
|
|
|
@apply list-decimal list-inside;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ul {
|
|
|
|
|
@apply list-disc list-inside;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.aspect-video {
|
|
|
|
|
aspect-ratio: 16/9;
|
|
|
|
|
}
|
|
|
|
|
</style>
|