diff --git a/nummi/main/templates/main/account_form.html b/nummi/main/templates/main/form/account.html similarity index 100% rename from nummi/main/templates/main/account_form.html rename to nummi/main/templates/main/form/account.html diff --git a/nummi/main/templates/main/category_form.html b/nummi/main/templates/main/form/category.html similarity index 100% rename from nummi/main/templates/main/category_form.html rename to nummi/main/templates/main/form/category.html diff --git a/nummi/main/templates/main/invoice_form.html b/nummi/main/templates/main/form/invoice.html similarity index 100% rename from nummi/main/templates/main/invoice_form.html rename to nummi/main/templates/main/form/invoice.html diff --git a/nummi/main/templates/main/snapshot_form.html b/nummi/main/templates/main/form/snapshot.html similarity index 100% rename from nummi/main/templates/main/snapshot_form.html rename to nummi/main/templates/main/form/snapshot.html diff --git a/nummi/main/templates/main/transaction_form.html b/nummi/main/templates/main/form/transaction.html similarity index 100% rename from nummi/main/templates/main/transaction_form.html rename to nummi/main/templates/main/form/transaction.html diff --git a/nummi/main/views.py b/nummi/main/views.py index eacb44d..71a1abb 100644 --- a/nummi/main/views.py +++ b/nummi/main/views.py @@ -114,11 +114,13 @@ class LogoutView(auth_views.LogoutView): class AccountCreateView(NummiCreateView): model = Account form_class = AccountForm + template_name = "main/form/account.html" class TransactionCreateView(NummiCreateView): model = Transaction form_class = TransactionForm + template_name = "main/form/transaction.html" def get_form_kwargs(self): return super().get_form_kwargs() | { @@ -134,6 +136,7 @@ class TransactionCreateView(NummiCreateView): class InvoiceCreateView(NummiCreateView): model = Invoice form_class = InvoiceForm + template_name = "main/form/invoice.html" def form_valid(self, form): form.instance.transaction = get_object_or_404( @@ -149,11 +152,13 @@ class InvoiceCreateView(NummiCreateView): class CategoryCreateView(NummiCreateView): model = Category form_class = CategoryForm + template_name = "main/form/category.html" class SnapshotCreateView(NummiCreateView): model = Snapshot form_class = SnapshotForm + template_name = "main/form/snapshot.html" def get_form_kwargs(self): return super().get_form_kwargs() | { @@ -171,6 +176,7 @@ class SnapshotCreateView(NummiCreateView): class AccountUpdateView(NummiUpdateView): model = Account form_class = AccountForm + template_name = "main/form/account.html" def get_context_data(self, **kwargs): _max = 8 @@ -220,11 +226,13 @@ class AccountUpdateView(NummiUpdateView): class TransactionUpdateView(NummiUpdateView): model = Transaction form_class = TransactionForm + template_name = "main/form/transaction.html" class InvoiceUpdateView(NummiUpdateView): model = Invoice form_class = InvoiceForm + template_name = "main/form/invoice.html" def get_success_url(self): return reverse_lazy("transaction", kwargs={"pk": self.object.transaction.pk}) @@ -244,6 +252,7 @@ class InvoiceUpdateView(NummiUpdateView): class CategoryUpdateView(NummiUpdateView): model = Category form_class = CategoryForm + template_name = "main/form/category.html" def get_context_data(self, **kwargs): data = super().get_context_data(**kwargs) @@ -278,6 +287,7 @@ class CategoryUpdateView(NummiUpdateView): class SnapshotUpdateView(NummiUpdateView): model = Snapshot form_class = SnapshotForm + template_name = "main/form/snapshot.html" def get_context_data(self, **kwargs): data = super().get_context_data(**kwargs)