Skip to main content

max / makenotwork

3.1 KB · 57 lines History Blame Raw
1 {% include "wizards/partials/step_nav.html" %}
2
3 <div class="wizard-step">
4 <h2 class="subtitle-h2">Item Basics</h2>
5 <p class="step-description">Title, description, and cover image for your item.</p>
6 <p class="form-hint">An <strong>item</strong> is an individual piece of content: a song, episode, chapter, download, or release. Fans purchase or access items directly.</p>
7
8 {#- `data-upload-fills` is where the URL the confirm answers with lands, and
9 `data-upload-shows` marks each place the picture itself goes. Both are
10 host facts about what happens after the bytes land, the same class as
11 `data-upload-goes` on the audio surface, and `static/upload.js` reads
12 them. The upload itself is described: see `crate::quasi::upload_field`. -#}
13 <form hx-post="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/basics"
14 hx-target="#wizard-step" hx-swap="innerHTML"
15 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/content"
16 data-upload-fills="#cover-image-url">
17 <div class="form-group">
18 <label for="wiz-item-title">Title</label>
19 <input type="text" id="wiz-item-title" name="title" required
20 value="{{ title }}"
21 placeholder="Episode 1, Chapter 1, Track 1..." autocomplete="off">
22 </div>
23
24 <div class="form-group">
25 <label for="wiz-item-desc">Description</label>
26 <textarea id="wiz-item-desc" name="description" rows="5"
27 placeholder="Describe this item...">{{ description }}</textarea>
28 </div>
29
30 <div class="form-group">
31 <label>Cover Image <span class="wizard-optional-tag">(optional)</span></label>
32
33 <div class="project-image-upload">
34 <div class="project-image-preview" data-upload-shows>
35 <div class="project-image-placeholder" data-upload-empty{% if cover_image_url.is_some() %} hidden{% endif %}>No image yet</div>
36 <div class="project-image-current" data-upload-filled{% if cover_image_url.is_none() %} hidden{% endif %}>
37 <img alt="Item image" class="wizard-cover-img"{% if let Some(url) = cover_image_url %} src="{{ url }}"{% endif %}>
38 </div>
39 </div>
40
41 {{ crate::quasi::upload_field::image("/api/items/image/presign", "item_id", item_id.as_str())|safe }}
42 </div>
43
44 <input type="hidden" name="cover_image_url" id="cover-image-url"
45 value="{% if let Some(url) = cover_image_url %}{{ url }}{% endif %}">
46 </div>
47
48 <div class="wizard-actions">
49 <button type="button" class="btn-secondary"
50 hx-get="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/type"
51 hx-target="#wizard-step" hx-swap="innerHTML"
52 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/type">Back</button>
53 <button type="submit" class="btn-primary">Continue</button>
54 </div>
55 </form>
56 </div>
57