-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cb6a12
commit 6499f5b
Showing
10 changed files
with
118 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,90 @@ | ||
{% load i18n %} | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<h1 class="mb-4">Saved documents</h1> | ||
<h1 class="mb-4">{% trans 'Saved documents' %}</h1> | ||
<button class="btn btn-primary" | ||
hx-target="#folders-list" | ||
hx-prompt="Give your folder a name:" | ||
hx-post="{% url 'saved_document_list' %}"> | ||
New Folder | ||
{% trans 'New Folder' %} | ||
</button> | ||
</div> | ||
{% for folder in folders %} | ||
<div class="card mb-5"> | ||
<h3 class="card-header">{{ folder }}</h3> | ||
<div class="card-body"> | ||
<div> | ||
{% if folder.saved_documents.all %} | ||
<table class="doc-table"> | ||
{% for saved_doc in folder.saved_documents.all %} | ||
<tr> | ||
<td class="cell-title"> | ||
<a href="{{ saved_doc.document.get_absolute_url }}">{{ saved_doc.document.title }}</a> | ||
{% include 'peachjam/_labels.html' with labels=saved_doc.document.labels.all %} | ||
</td> | ||
<td class="cell-date" style="white-space: nowrap;"> | ||
{{ saved_doc.document.date }} | ||
<a class="ms-3" | ||
type="button" | ||
hx-delete="{% url 'saved_document_list' %}?saved_doc_id={{ saved_doc.id }}" | ||
hx-target="#folders-list" | ||
hx-confirm="Are you sure you want to remove this document?"> | ||
<i class="bi bi-trash"></i> | ||
</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% else %} | ||
<p>{% trans 'No saved documents.' %}</p> | ||
{% endif %} | ||
{% if folders or ungrouped_saved_documents %} | ||
{% for folder in folders %} | ||
<div class="card mb-5"> | ||
<h3 class="card-header">{{ folder }}</h3> | ||
<div class="card-body"> | ||
<div> | ||
{% if folder.saved_documents.all %} | ||
<table class="doc-table"> | ||
{% for saved_doc in folder.saved_documents.all %} | ||
<tr> | ||
<td class="cell-title"> | ||
<a href="{{ saved_doc.document.get_absolute_url }}">{{ saved_doc.document.title }}</a> | ||
{% include 'peachjam/_labels.html' with labels=saved_doc.document.labels.all %} | ||
</td> | ||
<td class="cell-date" style="white-space: nowrap;"> | ||
{{ saved_doc.document.date }} | ||
<a class="ms-3" | ||
type="button" | ||
hx-delete="{% url 'saved_document_list' %}?saved_doc_id={{ saved_doc.id }}" | ||
hx-target="#folders-list" | ||
hx-confirm="Are you sure you want to remove this document?"> | ||
<i class="bi bi-trash"></i> | ||
</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% else %} | ||
<p>{% trans 'No saved documents.' %}</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="card-footer text-end"> | ||
<button class="btn btn-outline-danger me-2" | ||
type="button" | ||
hx-delete="{% url 'saved_document_list' %}?folder_id={{ folder.id }}" | ||
hx-target="#folders-list" | ||
hx-confirm="Are you sure you want to delete this folder? All saved documents in this folder will also be deleted."> | ||
{% trans 'Delete' %} | ||
</button> | ||
<button class="btn btn-secondary" | ||
type="button" | ||
hx-put="{% url 'saved_document_list' %}?folder_id={{ folder.id }}" | ||
hx-target="#folders-list" | ||
hx-prompt="Edit folder name"> | ||
{% trans 'Rename' %} | ||
</button> | ||
</div> | ||
</div> | ||
<div class="card-footer text-end"> | ||
<button class="btn btn-outline-danger me-2" | ||
type="button" | ||
hx-delete="{% url 'saved_document_list' %}?folder_id={{ folder.id }}" | ||
hx-target="#folders-list" | ||
hx-confirm="Are you sure you want to delete this folder? All saved documents in this folder will also be deleted."> | ||
Delete | ||
</button> | ||
<button class="btn btn-secondary" | ||
type="button" | ||
hx-put="{% url 'saved_document_list' %}?folder_id={{ folder.id }}" | ||
hx-target="#folders-list" | ||
hx-prompt="Edit folder name"> | ||
Rename | ||
</button> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% if ungrouped_saved_documents %} | ||
<div class="card"> | ||
<h3 class="card-header">Ungrouped documents</h3> | ||
<div class="card-body"> | ||
<table class="doc-table"> | ||
{% for saved_doc in ungrouped_saved_documents %} | ||
<tr> | ||
<td class="cell-title"> | ||
<a href="{{ saved_doc.document.get_absolute_url }}">{{ saved_doc.document.title }}</a> | ||
{% include 'peachjam/_labels.html' with labels=saved_doc.document.labels.all %} | ||
</td> | ||
<td class="cell-date" style="white-space: nowrap;"> | ||
{{ saved_doc.document.date }} | ||
<a class="ms-3" | ||
type="button" | ||
hx-delete="{% url 'saved_document_list' %}?saved_doc_id={{ saved_doc.id }}" | ||
hx-target="#folders-list" | ||
hx-confirm="Are you sure you want to remove this document?"> | ||
<i class="bi bi-trash"></i> | ||
</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% endfor %} | ||
{% if ungrouped_saved_documents %} | ||
<div class="card"> | ||
<h3 class="card-header">{% trans 'Ungrouped documents' %}</h3> | ||
<div class="card-body"> | ||
<table class="doc-table"> | ||
{% for saved_doc in ungrouped_saved_documents %} | ||
<tr> | ||
<td class="cell-title"> | ||
<a href="{{ saved_doc.document.get_absolute_url }}">{{ saved_doc.document.title }}</a> | ||
{% include 'peachjam/_labels.html' with labels=saved_doc.document.labels.all %} | ||
</td> | ||
<td class="cell-date" style="white-space: nowrap;"> | ||
{{ saved_doc.document.date }} | ||
<a class="ms-3" | ||
type="button" | ||
hx-delete="{% url 'saved_document_list' %}?saved_doc_id={{ saved_doc.id }}" | ||
hx-target="#folders-list" | ||
hx-confirm="Are you sure you want to remove this document?"> | ||
<i class="bi bi-trash"></i> | ||
</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% else %} | ||
<p>You have no saved documents.</p> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.