phase 1 backup - support for multi-file versioned upload
This commit is contained in:
@@ -26,12 +26,6 @@
|
||||
<div class="file-preview-grid" id="media-preview"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="caption">Caption</label>
|
||||
<input type="text" id="caption" name="caption" maxlength="128"
|
||||
placeholder="Optional caption applied to all files" value="{{ caption }}">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-check"></i> Add to gallery</button>
|
||||
</div>
|
||||
|
||||
@@ -70,12 +70,12 @@
|
||||
<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 & drop the pack file</p>
|
||||
<p class="drop-zone-sub">or click to browse</p>
|
||||
<p class="drop-zone-text">Drag & drop the version files</p>
|
||||
<p class="drop-zone-sub">or click to browse — several at once</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="file" id="version-input" hidden>
|
||||
<div class="upload-preview" id="version-preview"></div>
|
||||
<input type="file" id="version-input" multiple hidden>
|
||||
<div class="file-preview-grid" id="version-preview"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ version_form.changelog.errors }}
|
||||
@@ -100,11 +100,6 @@
|
||||
</div>
|
||||
<div class="file-preview-grid" id="media-preview"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ project_form.caption.errors }}
|
||||
<label for="{{ project_form.caption.id_for_label }}">{{ project_form.caption.label }}</label>
|
||||
{{ project_form.caption }}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<div class="project-title-row">
|
||||
<h1>{{ project.title }}</h1>
|
||||
<span class="category-badge">{{ project.get_category_display }}</span>
|
||||
<span class="project-id-badge" title="Project ID">#{{ project.pk }}</span>
|
||||
</div>
|
||||
{% if project.summary %}<p class="project-summary">{{ project.summary }}</p>{% endif %}
|
||||
<div class="project-meta">
|
||||
@@ -85,13 +86,26 @@
|
||||
{% if forloop.first %}<span class="latest-badge">latest</span>{% endif %}
|
||||
</div>
|
||||
<span class="version-date"><i class="fas fa-clock"></i> {{ version.created_at|date:"M j, Y" }}</span>
|
||||
<span class="version-downloads"><i class="fas fa-download"></i> {{ version.downloads }}</span>
|
||||
</div>
|
||||
{% if version.changelog %}
|
||||
<div class="markdown-body version-changelog">{{ version.changelog|markdown }}</div>
|
||||
{% endif %}
|
||||
<a class="btn btn-primary btn-sm" href="{% url 'library:version_download' project.slug version.pk %}">
|
||||
<i class="fas fa-download"></i> {{ version.downloads }}
|
||||
</a>
|
||||
<div class="version-files">
|
||||
{% for vf in version.files.all %}
|
||||
<div class="version-file">
|
||||
{% if vf.is_png %}
|
||||
<img class="version-file-thumb" src="{% url 'library:file_request' vf.file.uuid %}" alt="{{ vf.filename }}">
|
||||
{% else %}
|
||||
<i class="fas fa-file-archive version-file-icon"></i>
|
||||
{% endif %}
|
||||
<span class="version-file-name">{{ vf.filename }}</span>
|
||||
<a class="btn btn-primary btn-sm" href="{% url 'library:version_file_download' project.slug version.pk vf.file.uuid %}" title="Download {{ vf.filename }}">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p class="empty-hint">No versions yet.</p>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{% block title %}Edit {{ project.title }} - Packs Site{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1><i class="fas fa-pen"></i> Edit {{ project.title }}</h1>
|
||||
<h1><i class="fas fa-pen"></i> Edit {{ project.title }} <span class="project-id-badge" title="Project ID">#{{ project.pk }}</span></h1>
|
||||
<p><a href="{% url 'library:project_detail' project.slug %}">← Back to project</a></p>
|
||||
|
||||
<form method="post" class="card project-form create-form" id="project-form">
|
||||
|
||||
@@ -24,17 +24,17 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Version file</label>
|
||||
<label>Version files</label>
|
||||
<div class="upload-zone" data-upload="version">
|
||||
<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 & drop the pack file</p>
|
||||
<p class="drop-zone-sub">or click to browse</p>
|
||||
<p class="drop-zone-text">Drag & drop the version files</p>
|
||||
<p class="drop-zone-sub">or click to browse — several at once</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="file" id="version-input" hidden>
|
||||
<div class="upload-preview" id="version-preview"></div>
|
||||
<input type="file" id="version-input" multiple hidden>
|
||||
<div class="file-preview-grid" id="version-preview"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user