Skip to main content

max / makenotwork

2.2 KB · 45 lines History Blame Raw
1 {% include "wizards/partials/step_nav.html" %}
2
3 <div class="wizard-step">
4 <h2 class="subtitle-h2">Sections</h2>
5 <p class="step-description">Add tabbed content sections (e.g. Features, Installation, Specs). Sections are optional.</p>
6
7 <div id="sections-list">
8 {% for section in sections %}
9 <div class="section-row" data-id="{{ section.id }}">
10 <span class="section-row-title">{{ section.title }}</span>
11 <span class="section-row-length">{{ section.body.chars().count() }} chars</span>
12 <button type="button" class="btn-secondary section-delete-btn" data-id="{{ section.id }}">Delete</button>
13 </div>
14 {% endfor %}
15 </div>
16
17 <details class="section-add-details">
18 <summary>Add Section</summary>
19 <div class="section-add-body">
20 <div class="form-group">
21 <label for="new-section-title">Title</label>
22 <input type="text" id="new-section-title" placeholder="e.g. Features, Installation..." autocomplete="off">
23 </div>
24 {{ crate::quasi::rich_field::html("new-section", "Body (Markdown)", "Section content...", "", crate::quasi::rich_field::Height::Compact)|safe }}
25 <button type="button" class="btn-secondary" id="add-section-btn">Add Section</button>
26 <span id="section-add-status" class="field-status ml-2"></span>
27 </div>
28 </details>
29
30 <form hx-post="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/sections"
31 hx-target="#wizard-step" hx-swap="innerHTML"
32 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/pricing">
33 <div class="wizard-actions">
34 <button type="button" class="btn-secondary"
35 hx-get="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/content"
36 hx-target="#wizard-step" hx-swap="innerHTML"
37 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/content">Back</button>
38 <button type="submit" class="btn-primary">Continue</button>
39 </div>
40 </form>
41 </div>
42
43 <div id="wizard-item-sections-cfg" hidden data-item-id="{{ item_id }}"></div>
44 <script src="/static/wizard-item-sections.js?v=0623"></script>
45