Skip to main content

max / makenotwork

7.1 KB · 141 lines History Blame Raw
1 {% include "wizards/partials/step_nav.html" %}
2
3 <div class="wizard-step">
4 <h2 class="subtitle-h2">Content</h2>
5 <p class="step-description">
6 {% if item_type == "text" %}Write your text content below.
7 {% else if item_type == "audio" %}Upload your audio file.
8 {% else if item_type == "video" %}Upload your video file.
9 {% else if item_type == "bundle" %}Select items to include in this bundle.
10 {% else %}Upload your file.
11 {% endif %}
12 </p>
13
14 <form hx-post="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/content"
15 hx-target="#wizard-step" hx-swap="innerHTML"
16 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/pricing">
17
18 {% if item_type == "text" %}
19 <div class="form-group">
20 <label for="wiz-body">Content</label>
21 <textarea id="wiz-body" name="body" rows="15" class="monospace-input"
22 placeholder="Write your content here... Markdown is supported.">{{ body }}</textarea>
23 <div class="hint">Supports Markdown formatting.</div>
24 </div>
25
26 {% else if item_type == "audio" %}
27 <div class="form-group">
28 <label>Audio File</label>
29 <div class="upload-area" id="audio-upload-area">
30 <p>Drag and drop an audio file here, or click to browse</p>
31 <p class="hint">MP3, WAV, FLAC, OGG, AAC</p>
32 <input type="file" id="audio-file-input" class="sr-only"
33 accept="audio/mpeg,audio/wav,audio/flac,audio/ogg,audio/aac">
34 </div>
35 <div id="audio-upload-status"></div>
36 <button type="button" class="btn-secondary mt-2"
37 data-action="click" data-target="audio-file-input">Choose File</button>
38 </div>
39
40 {% else if item_type == "video" %}
41 <div class="form-group">
42 <label>Video File</label>
43 <div class="upload-area" id="video-upload-area">
44 <p>Drag and drop a video file here, or click to browse</p>
45 <p class="hint">MP4, WebM, MOV</p>
46 <input type="file" id="video-file-input" class="sr-only"
47 accept="video/mp4,video/webm,video/quicktime">
48 </div>
49 <div id="video-upload-status"></div>
50 <button type="button" class="btn-secondary mt-2"
51 data-action="click" data-target="video-file-input">Choose File</button>
52 </div>
53 <div id="wizard-item-content-video-cfg" hidden data-item-id="{{ item_id }}"></div>
54 <script src="/static/wizard-item-content-video.js?v=0623"></script>
55
56 {% else if item_type == "bundle" %}
57 <div class="form-group">
58 <label>Add New Files</label>
59 <div class="hint mb-2">Drop files to create new items and add them to this bundle automatically.</div>
60 <div class="upload-area" id="batch-upload-area">
61 <p>Drag files here, or click to browse</p>
62 <p class="hint">Supports multiple files</p>
63 <input type="file" id="batch-file-input" class="sr-only" multiple>
64 </div>
65 <button type="button" class="btn-secondary mt-2"
66 data-action="click" data-target="batch-file-input">Choose Files</button>
67
68 <div id="batch-file-queue" class="hidden mt-4">
69 <table class="batch-queue-table">
70 <thead>
71 <tr>
72 <th>File</th>
73 <th>Title</th>
74 <th>Type</th>
75 <th>Status</th>
76 </tr>
77 </thead>
78 <tbody id="batch-file-rows"></tbody>
79 </table>
80 <button type="button" class="btn-primary mt-3" id="batch-upload-btn">Upload All</button>
81 </div>
82 </div>
83
84 <div class="form-group mt-5">
85 <label>Select Items</label>
86 {% if bundleable_items.is_empty() %}
87 <p class="hint">No existing items to select. Upload files above or create items from the project dashboard.</p>
88 {% else %}
89 <div class="hint mb-2">Select items to include. Check "Unlisted" to hide an item from the project page (only accessible through this bundle).</div>
90 {% endif %}
91 <input type="hidden" name="bundle_item_ids" id="bundle-item-ids" value="">
92 <input type="hidden" name="unlisted_item_ids" id="unlisted-item-ids" value="">
93 <div id="bundle-picker">
94 {% for bi in bundleable_items %}
95 <div class="bundle-picker-row">
96 <input type="checkbox" class="bundle-check" data-item-id="{{ bi.id }}"
97 {% if selected_bundle_ids.contains(&bi.id.to_string()) %}checked{% endif %}>
98 <span class="bundle-picker-row-title">{{ bi.title }}</span>
99 <span class="bundle-picker-row-type">{{ bi.item_type }}</span>
100 <label class="bundle-picker-row-unlisted">
101 <input type="checkbox" class="unlisted-check" data-item-id="{{ bi.id }}"
102 {% if unlisted_ids.contains(&bi.id.to_string()) %}checked{% endif %}>
103 Unlisted
104 </label>
105 </div>
106 {% endfor %}
107 </div>
108 </div>
109 <div id="wizard-item-content-bundle-cfg" hidden data-project-id="{{ project_id }}"></div>
110 <script src="/static/wizard-item-content-bundle.js?v=0623"></script>
111
112 {% else %}
113 <div class="form-group">
114 <label>File</label>
115 <div class="upload-area" id="file-upload-area">
116 <p>Drag and drop your file here, or click to browse</p>
117 <p class="hint">Upload your content file. You can also add versions from the item dashboard.</p>
118 <input type="file" id="file-input" class="sr-only">
119 </div>
120 <div id="file-upload-status"></div>
121 <button type="button" class="btn-secondary mt-2"
122 data-action="click" data-target="file-input">Choose File</button>
123 </div>
124 <div id="wizard-item-content-file-cfg" hidden data-item-id="{{ item_id }}"></div>
125 <script src="/static/wizard-item-content-file.js?v=0623"></script>
126 {% endif %}
127
128 <div class="wizard-actions">
129 <button type="button" class="btn-secondary"
130 hx-get="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/details"
131 hx-target="#wizard-step" hx-swap="innerHTML"
132 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/details">Back</button>
133 <button type="button" class="btn-secondary"
134 hx-get="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/pricing"
135 hx-target="#wizard-step" hx-swap="innerHTML"
136 hx-push-url="/dashboard/project/{{ project_slug }}/new-item/{{ item_id }}/step/pricing">Skip</button>
137 <button type="submit" class="btn-primary">Continue</button>
138 </div>
139 </form>
140 </div>
141