Drafts system implemented

This commit is contained in:
2026-08-05 17:16:09 -05:00
parent 203ff88af1
commit 49c4ff681f
13 changed files with 419 additions and 75 deletions
@@ -0,0 +1,47 @@
{% extends 'base.html' %}
{% load static %}
{% block title %}My Projects - Packs Site{% endblock %}
{% block content %}
<div class="myprojects-header">
<h1><i class="fas fa-folder-open"></i> My Projects</h1>
<a href="{% url 'library:project_create_new' %}" class="btn btn-primary"><i class="fas fa-plus"></i> New Project</a>
</div>
<div class="myprojects-layout">
<section class="myprojects-col">
<h2><i class="fas fa-box-open"></i> Projects</h2>
<div class="pack-grid">
{% for project in projects %}
{% include 'library/_project_card.html' %}
{% empty %}
<p class="empty-hint">You haven't created any projects yet.</p>
{% endfor %}
</div>
</section>
<div class="myprojects-divider" role="separator"></div>
<section class="myprojects-col">
<h2><i class="fas fa-pen-nib"></i> Drafts</h2>
<div class="draft-list">
{% for draft in drafts %}
<div class="draft-card">
<a href="{% url 'library:project_create' draft.uuid %}" class="draft-title">{{ draft.title }}</a>
<span class="draft-meta">Edited {{ draft.updated_at|timesince }} ago</span>
<div class="draft-actions">
<a href="{% url 'library:project_create' draft.uuid %}" class="btn btn-secondary btn-sm"><i class="fas fa-pen"></i> Continue</a>
<form method="post" action="{% url 'library:project_draft_delete' draft.uuid %}" class="inline" onsubmit="return confirm('Delete this draft and its uploads?');">
{% csrf_token %}
<button type="submit" class="btn btn-secondary btn-sm" title="Delete draft"><i class="fas fa-trash"></i></button>
</form>
</div>
</div>
{% empty %}
<p class="empty-hint">No drafts yet — start one with the "+ New Project" button.</p>
{% endfor %}
</div>
</section>
</div>
{% endblock %}
@@ -5,6 +5,9 @@
{% block content %}
<h1><i class="fas fa-plus-circle"></i> New Project</h1>
<p class="bio-help">
<a href="{% url 'library:my_projects' %}"><i class="fas fa-arrow-left"></i> Back to My Projects</a>
</p>
<form method="post" class="card project-form create-form" id="project-form">
{% csrf_token %}
@@ -111,6 +114,7 @@
{% endblock %}
{% block extra_js %}
{{ draft_uuid|json_script:'packs-draft-uuid' }}
{{ draft_uploads|json_script:'packs-draft-uploads' }}
{{ tag_categories|json_script:'packs-tag-categories' }}
<script src="{% static 'js/tags.js' %}"></script>