Skip to content

Commit a65995f

Browse files
committed
- **Reorganized and refactored HTML templates for data import transactions:**
- Removed outdated templates: `data_import_job_txs_imported.html`, `data_import_job_txs_table.html`, and `data_import_job_txs.html`. - Introduced new reusable templates: - `includes/staged_txs_form_card.html` for compact card-based transaction forms. - `import_job_txs.html` for centralized transaction display and actions handling. - Streamlined template structure by implementing improved layout with clearer separation of concerns. - Enhanced visual styles and dynamic behavior: - Added match indicators, account mapping helpers, and conditional logic tags for visual cues. - Incorporated responsive styles and conditional element visibility. - **Updated template logic for staged transaction and import workflows:** - Consolidated logic into reusable components to reduce redundancy. - Improved handling of `matches_found`, `is_matched`, and import validation for staged transactions with intuitive actions. ### **Summary** Replaced legacy transaction templates with modular and reusable components for improved clarity, maintainability, and user experience. Enhanced workflows for staged and imported transaction handling. ### **Backwards Compatibility** These changes are not backwards compatible. Old templates were removed and replaced with redesigned structures and updated logic.
1 parent 8035aea commit a65995f

12 files changed

+857
-243
lines changed

django_ledger/templates/django_ledger/components/menu.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
</div>
7171
</div>
7272
{% endif %}
73-
7473
{% endfor %}
7574
</div>
7675
{% endif %}

django_ledger/templates/django_ledger/data_import/data_import_job_txs.html

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{% extends 'django_ledger/layouts/content_layout_1.html' %}
2+
{% load i18n %}
3+
{% load static %}
4+
{% load django_ledger %}
5+
6+
{% block view_content %}
7+
<div class="box">
8+
<div class="columns is-multiline">
9+
<div class="column is-12">
10+
<div class="level">
11+
<div class="level-left">
12+
<div>
13+
<p class="is-size-5 has-text-weight-semibold">{{ import_job_model.description }}</p>
14+
<p class="is-size-6 has-text-grey">
15+
{{ import_job_model.bank_account_model }}
16+
&middot; {{ import_job_model.created }}
17+
</p>
18+
</div>
19+
</div>
20+
<div class="level-right">
21+
<a class="button is-info is-light mr-2"
22+
href="{{ import_job_model.get_update_url }}">
23+
{% trans 'Update' %}
24+
</a>
25+
<form class="mr-2" action="{{ import_job_model.get_data_import_reset_url }}" method="post">
26+
{% csrf_token %}
27+
<button class="button is-warning" type="submit">{% trans 'Reset Job' %}</button>
28+
</form>
29+
<a class="button is-dark"
30+
href="{{ import_job_model.get_list_url }}">{% trans 'Back' %}</a>
31+
</div>
32+
</div>
33+
</div>
34+
35+
<!-- Progress visual -->
36+
<div class="column is-12">
37+
<div class="box" style="border-radius: 10px;">
38+
<div class="level is-mobile">
39+
<div class="level-left">
40+
<p class="is-size-6 has-text-weight-semibold">{% trans 'Import Progress' %}</p>
41+
</div>
42+
<div class="level-right">
43+
<span class="tag is-info is-light mr-1">{% trans 'Total' %}: {{ progress.total }}</span>
44+
<span class="tag is-success is-light mr-1">{% trans 'Imported' %}: {{ progress.imported }}</span>
45+
<span class="tag is-warning is-light mr-1">{% trans 'Ready' %}: {{ progress.ready }}</span>
46+
<span class="tag is-danger is-light">{% trans 'Pending' %}: {{ progress.pending }}</span>
47+
</div>
48+
</div>
49+
<progress class="progress is-primary" value="{{ progress.pct }}" max="100">{{ progress.pct }}%
50+
</progress>
51+
<p class="has-text-right is-size-7 has-text-grey">{{ progress.pct }}% {% trans 'complete' %}</p>
52+
</div>
53+
</div>
54+
55+
<!-- Pending Transactions Table (interactive overview) -->
56+
<div class="column is-12">
57+
<h2 class="is-size-4 mb-2">{% trans 'Pending Transactions' %}</h2>
58+
{% import_job_txs_pending import_job_model %}
59+
</div>
60+
61+
<!-- Imported Transactions Table (reuse tag) -->
62+
<div class="column is-12 mb-4">
63+
<h2 class="is-size-4 mb-2">{% trans 'Imported / Matched Transactions' %}</h2>
64+
{% import_job_txs_imported import_job_model %}
65+
</div>
66+
</div>
67+
</div>
68+
{% endblock %}

django_ledger/templates/django_ledger/data_import/data_import_job_list.html renamed to django_ledger/templates/django_ledger/data_import/import_job_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<a class="button is-dark"
1212
href="{% url 'django_ledger:entity-dashboard' entity_slug=view.kwargs.entity_slug %}">
1313
{% trans 'Back' %}</a>
14-
{% data_import_job_list_table %}
14+
{% import_job_list_table import_job_list %}
1515
</div>
1616
{% endblock %}

0 commit comments

Comments
 (0)