Final changes and update
This commit is contained in:
@@ -5,7 +5,12 @@
|
||||
<div>
|
||||
<div class="d-flex align-items-center">
|
||||
<h1 class="mb-0 me-3">{{ project.name }}</h1>
|
||||
{% if not locked %}
|
||||
<button class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#editProjectModal"><i class="fas fa-edit"></i></button>
|
||||
{% endif %}
|
||||
<button class="btn btn-sm btn-outline-info ms-2" data-bs-toggle="modal" data-bs-target="#cloneProjectModal" title="Clone/Fork Project" data-bs-toggle="tooltip">
|
||||
<i class="fas fa-code-branch"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<span class="badge bg-secondary">{{ bible.project_metadata.genre }}</span>
|
||||
@@ -14,7 +19,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<form action="/project/{{ project.id }}/run" method="POST" class="d-inline">
|
||||
<button class="btn btn-success shadow px-4 py-2" {% if active_run and active_run.status in ['running', 'queued'] %}disabled{% endif %}>
|
||||
<button class="btn btn-success shadow px-4 py-2" {% if active_run and active_run.status in ['running', 'queued'] %}disabled{% endif %} data-bs-toggle="tooltip" title="Start the AI writer. It will write the next book in the plan.">
|
||||
<i class="fas fa-play me-2"></i>{{ 'Generating...' if runs and runs[0].status in ['running', 'queued'] else 'Generate New Book' }}
|
||||
</button>
|
||||
</form>
|
||||
@@ -28,9 +33,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Workflow Help -->
|
||||
<div class="alert alert-light border shadow-sm mb-4">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="fas fa-info-circle text-primary fa-2x me-3"></i>
|
||||
<div>
|
||||
<strong>Workflow:</strong>
|
||||
1. Review the <a href="#bible-section">World Bible</a> below.
|
||||
2. Click <span class="badge bg-success">Generate New Book</span>.
|
||||
3. When finished, <a href="#latest-run">Download</a> the files or click <span class="badge bg-primary">Read & Edit</span> to refine the text.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- LATEST RUN CARD -->
|
||||
<div class="card mb-4 border-0 shadow-sm">
|
||||
<div class="card mb-4 border-0 shadow-sm" id="latest-run">
|
||||
<div class="card-header bg-white border-bottom-0 pt-4 px-4">
|
||||
<h4 class="card-title"><i class="fas fa-bolt text-warning me-2"></i>Active Run (ID: {{ active_run.id if active_run else '-' }})</h4>
|
||||
</div>
|
||||
@@ -66,7 +83,7 @@
|
||||
<i class="fas fa-download me-1"></i> Download {{ file.type }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
<button class="btn btn-outline-dark" data-bs-toggle="modal" data-bs-target="#regenerateModal">
|
||||
<button class="btn btn-outline-dark" data-bs-toggle="modal" data-bs-target="#regenerateModal" data-bs-toggle="tooltip" title="Re-create the cover art or re-compile the EPUB without rewriting the text.">
|
||||
<i class="fas fa-paint-brush me-1"></i> Regenerate Cover / Files
|
||||
</button>
|
||||
</div>
|
||||
@@ -93,7 +110,7 @@
|
||||
</div>
|
||||
<h5 class="card-title mb-3" id="statusMessage">Preparing environment...</h5>
|
||||
<div class="progress" style="height: 10px;">
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar" style="width: 100%"></div>
|
||||
<div id="progressBar" class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
<small class="text-muted mt-2 d-block" id="statusTime"></small>
|
||||
</div>
|
||||
@@ -160,7 +177,7 @@
|
||||
{% endif %}
|
||||
{% if r.status not in ['running', 'queued'] %}
|
||||
<form action="/run/{{ r.id }}/restart" method="POST" class="d-inline ms-1" onsubmit="return confirm('This will delete all files for this run and start over. Are you sure?');">
|
||||
<input type="hidden" name="mode" value="restart">
|
||||
<input type="hidden" name="mode" value="restart_clean">
|
||||
<button class="btn btn-sm btn-outline-danger" title="Re-run (Wipe & Restart)">
|
||||
<i class="fas fa-redo"></i>
|
||||
</button>
|
||||
@@ -220,11 +237,13 @@
|
||||
<button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal" data-bs-target="#editBookModal{{ book.book_number }}" title="Edit Details">
|
||||
<i class="fas fa-edit"></i> Edit
|
||||
</button>
|
||||
{% if not locked %}
|
||||
{% if not generated_books.get(book.book_number) %}
|
||||
<form action="/project/{{ project.id }}/delete_book/{{ book.book_number }}" method="POST" onsubmit="return confirm('Remove this book from the plan?');">
|
||||
<button class="btn btn-sm btn-outline-danger"><i class="fas fa-trash"></i></button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,16 +259,18 @@
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Title</label>
|
||||
<input type="text" name="title" class="form-control" value="{{ book.title }}">
|
||||
<input type="text" name="title" class="form-control" value="{{ book.title }}" {% if locked %}disabled{% endif %}>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Plot Summary / Instruction</label>
|
||||
<textarea name="instruction" class="form-control" rows="6">{{ book.manual_instruction }}</textarea>
|
||||
<textarea name="instruction" class="form-control" rows="6" {% if locked %}disabled{% endif %}>{{ book.manual_instruction }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
{% if not locked %}
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -258,6 +279,7 @@
|
||||
{% endfor %}
|
||||
|
||||
<!-- Add Book Card -->
|
||||
{% if not locked %}
|
||||
<div class="col-md-4 col-lg-3" style="min-width: 200px;">
|
||||
<div class="card h-100 border-dashed d-flex align-items-center justify-content-center bg-light" style="border: 2px dashed #ccc; cursor: pointer;" data-bs-toggle="modal" data-bs-target="#addBookModal">
|
||||
<div class="text-center text-muted py-5">
|
||||
@@ -266,11 +288,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- WORLD BIBLE & LINKED SERIES -->
|
||||
<div class="row mb-4">
|
||||
<div class="row mb-4" id="bible-section">
|
||||
<div class="col-md-12">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light d-flex justify-content-between align-items-center">
|
||||
@@ -279,12 +302,14 @@
|
||||
<a href="/project/{{ project.id }}/review" class="btn btn-sm btn-outline-info me-1">
|
||||
<i class="fas fa-list-alt me-1"></i> Full Review
|
||||
</a>
|
||||
<button class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#importCharModal">
|
||||
{% if not locked %}
|
||||
<button class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#importCharModal" data-bs-toggle="tooltip" title="Import characters from another project to create a shared universe.">
|
||||
<i class="fas fa-link me-1"></i> Link / Import Series
|
||||
</button>
|
||||
<button class="btn btn-sm btn-outline-primary ms-1" data-bs-toggle="modal" data-bs-target="#refineBibleModal">
|
||||
<button class="btn btn-sm btn-outline-primary ms-1" data-bs-toggle="modal" data-bs-target="#refineBibleModal" data-bs-toggle="tooltip" title="Use AI to bulk-edit characters or plot points based on your instructions.">
|
||||
<i class="fas fa-magic me-1"></i> Refine
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -337,6 +362,27 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Clone Project Modal -->
|
||||
<div class="modal fade" id="cloneProjectModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" action="/project/{{ project.id }}/clone" method="POST" onsubmit="showLoading(this)">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Clone & Modify Project</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-muted small">Create a new project based on this one, with AI modifications.</p>
|
||||
<div class="mb-3"><label class="form-label">New Project Name</label><input type="text" name="new_name" class="form-control" value="{{ project.name }} (Copy)" required></div>
|
||||
<div class="mb-3"><label class="form-label">AI Instructions (Optional)</label><textarea name="instruction" class="form-control" rows="3" placeholder="e.g. 'Change the genre to Sci-Fi', 'Make the protagonist a villain', 'Rewrite as a comedy'."></textarea></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-info">Clone Project</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add Book Modal -->
|
||||
<div class="modal fade" id="addBookModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
@@ -482,6 +528,12 @@
|
||||
const costSpan = document.querySelector(`.cost-${currentRunId}`);
|
||||
if (costSpan) costSpan.innerText = parseFloat(data.cost).toFixed(4);
|
||||
|
||||
// Update Progress Bar Width
|
||||
const progBar = document.getElementById('progressBar');
|
||||
if (progBar && data.percent !== undefined) {
|
||||
progBar.style.width = data.percent + "%";
|
||||
}
|
||||
|
||||
// Update Status Bar
|
||||
if (data.progress && data.progress.message) {
|
||||
const phaseEl = document.getElementById('statusPhase');
|
||||
|
||||
Reference in New Issue
Block a user