working UGC content upload with multi-upload support

This commit is contained in:
JakeBreath
2026-08-03 21:05:12 -05:00
parent 473b3c811b
commit 87b0d46232
18 changed files with 563 additions and 490 deletions
+54 -8
View File
@@ -7,17 +7,59 @@
<h1><i class="fas fa-pen"></i> Edit {{ project.title }}</h1>
<p><a href="{% url 'library:project_detail' project.slug %}">&larr; Back to project</a></p>
<form method="post" enctype="multipart/form-data" class="card project-form" id="project-form">
<form method="post" class="card project-form create-form" id="project-form">
{% csrf_token %}
<div class="project-form-grid">
<div class="project-form-main">
{% include 'library/_project_form_fields.html' with form=project_form %}
</div>
<div class="create-grid">
<section class="create-panel create-panel-main">
<h2 class="form-section-title"><i class="fas fa-folder-open"></i> Project</h2>
<aside class="project-form-side">
{% include 'library/_project_form_side.html' with form=project_form %}
</aside>
<div class="form-group">
{{ project_form.title.errors }}
<label for="{{ project_form.title.id_for_label }}">Title</label>
{{ project_form.title }}
</div>
<div class="form-group">
{{ project_form.summary.errors }}
<label for="{{ project_form.summary.id_for_label }}">Summary</label>
{{ project_form.summary }}
</div>
<div class="form-group">
{{ project_form.category.errors }}
<label for="{{ project_form.category.id_for_label }}">Category</label>
{{ project_form.category }}
</div>
<div class="form-group">
{{ project_form.description.errors }}
<label for="{{ project_form.description.id_for_label }}">Description</label>
{{ project_form.description }}
<p class="bio-help"><i class="fas fa-info-circle"></i> Supports Markdown — headings, lists, links, code, tables and more.</p>
</div>
</section>
<section class="create-panel">
<h2 class="form-section-title"><i class="fas fa-image"></i> Thumbnail</h2>
<div class="upload-zone" data-upload="thumbnail">
<div class="drop-zone" role="button" tabindex="0">
<div class="drop-zone-inner">
<i class="fas fa-cloud-upload-alt drop-zone-icon"></i>
<p class="drop-zone-text">Drag &amp; drop an image</p>
<p class="drop-zone-sub">or click to browse</p>
</div>
</div>
<input type="file" id="thumb-input" accept="image/*" hidden>
<div class="upload-preview" id="thumb-preview"></div>
</div>
<h2 class="form-section-title" style="margin-top:16px;"><i class="fas fa-tags"></i> Tags</h2>
<div class="tag-editor">
<input type="text" id="tag-input" placeholder="Type a tag and press Enter… (e.g. content:threesome, species:dragon)" autocomplete="off">
<div class="tag-suggestions" id="tag-suggestions" hidden></div>
<div class="tag-chips" id="tag-chips"></div>
{{ project_form.tags }}
</div>
<p class="bio-help"><i class="fas fa-info-circle"></i> Categories: loader, version, general, creator, content, species, non_version. Unprefixed tags go to General.</p>
</section>
</div>
<div class="form-actions">
@@ -27,5 +69,9 @@
{% endblock %}
{% block extra_js %}
{{ pending_uploads|json_script:'packs-pending-uploads' }}
{{ tag_categories|json_script:'packs-tag-categories' }}
<script src="{% static 'js/tags.js' %}"></script>
<script src="{% static 'js/uploads.js' %}"></script>
<script src="{% static 'js/edit.js' %}"></script>
{% endblock %}