Files
ComfyUI-Lora-Manager/templates/components/recipe_modal.html
T
Will Miao 0daf4924f0 feat(recipes): redesign recipe detail modal with three-column workspace layout
- Three-column layout (preview | generation parameters | resources) with
  independent per-pane scrolling and a content-sized modal shell that
  shrinks to fit short recipes and caps at viewport height for long ones
- Blurred, darker backdrop to focus attention on the modal
- Preview frame hugs the image instead of a fixed-size box
- Move recipe-level 'Send to ComfyUI' into the header actions row to match
  the model detail modal convention; remove the modal 'Copy Recipe Syntax'
  button (context menu action is unaffected)
- Add recipes.actions.sendRecipe i18n keys with translations
- Sync modal test fixtures to the new structure
2026-08-18 09:09:05 +08:00

133 lines
7.3 KiB
HTML

<div id="recipeModal" class="modal">
<div class="modal-content">
<button class="close" onclick="modalManager.closeModal('recipeModal')">&times;</button>
<header class="recipe-modal-header">
<h2 id="recipeModalTitle">Recipe Details</h2>
<!-- Header Actions: Send button is static; source URL button is appended dynamically in RecipeModal.js -->
<div class="recipe-header-actions" id="recipeHeaderActions">
<button class="modal-send-btn" id="sendRecipeBtn" title="Send Recipe to ComfyUI">
<i class="fas fa-paper-plane"></i> <span>{{ t('recipes.actions.sendRecipe') }}</span>
</button>
</div>
<!-- Recipe Tags Container (rendered by renderCompactTags) -->
<div id="recipeTagsContainer"></div>
</header>
<div class="modal-body">
<!-- Left Column: Preview -->
<div class="recipe-media-column">
<div class="recipe-preview-container" id="recipePreviewContainer">
<img id="recipeModalImage" src="" alt="Recipe Preview" class="recipe-preview-media">
<!-- Source URL elements are now added dynamically in RecipeModal.js -->
</div>
</div>
<!-- Center Column: Generation Parameters -->
<div class="info-section recipe-gen-params">
<div class="gen-params-header-row">
<h3>Generation Parameters</h3>
<label class="inline-toggle-container lora-strip-toggle" title="When enabled, &lt;lora:...&gt; tags are removed from prompt text when copying">
<span class="inline-toggle-label">Strip &lt;lora:&gt;</span>
<div class="toggle-switch">
<input type="checkbox" id="stripLoraOnCopyToggle">
<span class="toggle-slider"></span>
</div>
</label>
</div>
<div class="gen-params-container">
<!-- Prompt -->
<div class="param-group info-item">
<div class="param-header">
<label>Prompt</label>
<div class="param-actions">
<button class="copy-btn" id="sendPromptBtn" title="Send Prompt to Workflow">
<i class="fas fa-paper-plane"></i>
</button>
<button class="copy-btn" id="copyPromptBtn" title="Copy Prompt">
<i class="fas fa-copy"></i>
</button>
<button class="edit-btn" id="editPromptBtn" title="Edit Prompt">
<i class="fas fa-pencil-alt"></i>
</button>
</div>
</div>
<div class="param-content" id="recipePrompt"></div>
<div class="param-editor" id="recipePromptEditor">
<textarea
class="param-textarea"
id="recipePromptInput"
placeholder="Enter prompt"
></textarea>
<div class="param-editor-hint">
{{ t('toast.recipes.promptEditorHint') }}
</div>
</div>
</div>
<!-- Negative Prompt -->
<div class="param-group info-item">
<div class="param-header">
<label>Negative Prompt</label>
<div class="param-actions">
<button class="copy-btn" id="sendNegativePromptBtn" title="Send Negative Prompt to Workflow">
<i class="fas fa-paper-plane"></i>
</button>
<button class="copy-btn" id="copyNegativePromptBtn" title="Copy Negative Prompt">
<i class="fas fa-copy"></i>
</button>
<button class="edit-btn" id="editNegativePromptBtn" title="Edit Negative Prompt">
<i class="fas fa-pencil-alt"></i>
</button>
</div>
</div>
<div class="param-content" id="recipeNegativePrompt"></div>
<div class="param-editor" id="recipeNegativePromptEditor">
<textarea
class="param-textarea"
id="recipeNegativePromptInput"
placeholder="Enter negative prompt"
></textarea>
<div class="param-editor-hint">
{{ t('toast.recipes.promptEditorHint') }}
</div>
</div>
</div>
<!-- Other Parameters -->
<div class="param-group info-item">
<div class="param-header">
<label>Params</label>
<div class="param-actions">
<button class="copy-btn" id="sendParamsBtn" title="Send Params to Workflow">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
<div class="other-params" id="recipeOtherParams"></div>
</div>
</div>
</div>
<!-- Right Column: Resources -->
<div class="info-section recipe-bottom-section">
<div class="recipe-section-header">
<h3>Resources</h3>
<div class="recipe-section-actions">
<span id="recipeLorasCount"><i class="fas fa-layer-group"></i> 0 LoRAs</span>
<button class="action-btn view-loras-btn" id="viewRecipeLorasBtn" title="View all LoRAs in this recipe">
<i class="fas fa-external-link-alt"></i>
</button>
</div>
</div>
<div class="recipe-resources-list">
<div class="recipe-checkpoint-container" id="recipeCheckpoint"></div>
<div class="version-divider" id="recipeResourceDivider" style="display: none;"></div>
<div class="recipe-loras-list" id="recipeLorasList"></div>
</div>
</div>
</div>
</div>
</div>