Skip to main content

max / makenotwork

3.3 KB · 62 lines History Blame Raw
1 {% include "wizards/partials/step_nav.html" %}
2
3 <div class="wizard-step">
4 <h2 class="subtitle-h2">Appearance</h2>
5 <p class="step-description">Upload a project image. This appears on your project page and in search results.</p>
6
7 {#- `data-upload-fills` is where the URL the confirm answers with lands, and
8 `data-upload-shows` marks each place the picture itself goes, which here
9 is two: the dropzone's own preview and the card preview below it. Both
10 are 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/new-project/{{ slug }}/step/appearance"
14 hx-target="#wizard-step" hx-swap="innerHTML"
15 hx-push-url="/dashboard/new-project/{{ slug }}/step/monetization"
16 data-upload-fills="#cover-image-url">
17
18 <div class="form-group">
19 <label>Project Image</label>
20
21 <div class="project-image-upload">
22 <div class="project-image-preview" data-upload-shows>
23 <div class="project-image-placeholder" data-upload-empty{% if cover_image_url.is_some() %} hidden{% endif %}>No image yet</div>
24 <div class="project-image-current" data-upload-filled{% if cover_image_url.is_none() %} hidden{% endif %}>
25 <img alt="Project image" class="wizard-cover-img"{% if let Some(url) = cover_image_url %} src="{{ url }}"{% endif %}>
26 </div>
27 </div>
28
29 {{ crate::quasi::upload_field::image("/api/projects/image/presign", "project_id", project_id.as_str())|safe }}
30 </div>
31
32 <input type="hidden" name="cover_image_url" id="cover-image-url"
33 value="{% if let Some(url) = cover_image_url %}{{ url }}{% endif %}">
34 </div>
35
36 <div class="form-group">
37 <label>Preview</label>
38 <div class="project-card-preview">
39 <div class="preview-cover" id="preview-cover" data-upload-shows>
40 <div class="preview-cover-empty" data-upload-empty{% if cover_image_url.is_some() %} hidden{% endif %}>No image</div>
41 <img alt="Preview" class="wizard-cover-img" data-upload-filled{% if cover_image_url.is_none() %} hidden{% endif %}{% if let Some(url) = cover_image_url %} src="{{ url }}"{% endif %}>
42 </div>
43 <div class="preview-info">
44 <strong>{{ project_title }}</strong>
45 </div>
46 </div>
47 </div>
48
49 <div class="wizard-actions">
50 <button type="button" class="btn-secondary"
51 hx-get="/dashboard/new-project/{{ slug }}/step/basics"
52 hx-target="#wizard-step" hx-swap="innerHTML"
53 hx-push-url="/dashboard/new-project/{{ slug }}/step/basics">Back</button>
54 <button type="button" class="btn-secondary"
55 hx-get="/dashboard/new-project/{{ slug }}/step/monetization"
56 hx-target="#wizard-step" hx-swap="innerHTML"
57 hx-push-url="/dashboard/new-project/{{ slug }}/step/monetization">Skip</button>
58 <button type="submit" class="btn-primary">Continue</button>
59 </div>
60 </form>
61 </div>
62