-
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.
Updated the ui, formatted the files and removed unnecessary migration…
…s folder
- Loading branch information
1 parent
8060a8a
commit 10ed465
Showing
14 changed files
with
378 additions
and
323 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
from django import forms | ||
from .models import Expense | ||
|
||
|
||
class ExpenseForm(forms.ModelForm): | ||
class Meta: | ||
model = Expense | ||
fields = ['date', 'category', 'amount', 'currency'] | ||
fields = ["date", "category", "amount", "currency"] | ||
widgets = { | ||
'currency': forms.TextInput(attrs={'placeholder': 'e.g., USD, EUR'}), | ||
"currency": forms.TextInput(attrs={"placeholder": "e.g., USD, EUR"}), | ||
} | ||
initial = { | ||
'currency': 'EUR', | ||
"currency": "EUR", | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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,40 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Add Expense</title> | ||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"> | ||
</head> | ||
<body class="bg-gray-100 min-h-screen flex items-center justify-center"> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body class="bg-gray-100 min-h-screen flex items-center justify-center"> | ||
<div class="bg-white p-8 rounded-lg shadow-lg w-full max-w-md"> | ||
<h2 class="text-2xl font-bold mb-6 text-center">Add Expense</h2> | ||
<form method="POST" class="space-y-4"> | ||
{% csrf_token %} | ||
<div> | ||
<label for="date" class="block text-gray-700">Date:</label> | ||
<input type="date" id="date" name="date" class="w-full p-2 border border-gray-300 rounded mt-1"> | ||
</div> | ||
<div> | ||
<label for="category" class="block text-gray-700">Category:</label> | ||
<input type="text" id="category" name="category" class="w-full p-2 border border-gray-300 rounded mt-1" placeholder="e.g., Food, Transportation"> | ||
</div> | ||
<div> | ||
<label for="amount" class="block text-gray-700">Amount:</label> | ||
<input type="number" id="amount" name="amount" step="0.01" class="w-full p-2 border border-gray-300 rounded mt-1" placeholder="e.g., 10.50"> | ||
</div> | ||
|
||
<div> | ||
<label for="currency" class="block text-gray-700">Currency:</label> | ||
<input type="text" id="currency" name="currency" class="w-full p-2 border border-gray-300 rounded mt-1" placeholder="e.g., USD, EUR (optional)"> | ||
</div> | ||
|
||
<button type="submit" class="w-full bg-blue-500 text-white p-2 rounded mt-4 hover:bg-blue-600">Add</button> | ||
</form> | ||
<a href="{% url 'index' %}" class="block text-center text-blue-500 mt-4">Back to Expense Tracker</a> | ||
</div> | ||
<h2 class="text-2xl font-bold mb-6 text-center">Add Expense</h2> | ||
<form method="POST" class="space-y-4"> | ||
{% csrf_token %} | ||
<div> | ||
<label for="date" class="block text-gray-700">Date:</label> | ||
<input | ||
type="date" | ||
id="date" | ||
name="date" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
/> | ||
</div> | ||
<div> | ||
<label for="category" class="block text-gray-700">Category:</label> | ||
<input | ||
type="text" | ||
id="category" | ||
name="category" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
placeholder="e.g., Food, Transportation" | ||
/> | ||
</div> | ||
<div> | ||
<label for="amount" class="block text-gray-700">Amount:</label> | ||
<input | ||
type="number" | ||
id="amount" | ||
name="amount" | ||
step="0.01" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
placeholder="e.g., 10.50" | ||
/> | ||
</div> | ||
|
||
</body> | ||
<div> | ||
<label for="currency" class="block text-gray-700">Currency:</label> | ||
<input | ||
type="text" | ||
id="currency" | ||
name="currency" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
placeholder="e.g., USD, EUR (optional)" | ||
/> | ||
</div> | ||
|
||
</html> | ||
<button | ||
type="submit" | ||
class="w-full bg-blue-500 text-white p-2 rounded mt-4 hover:bg-blue-600" | ||
> | ||
Add | ||
</button> | ||
</form> | ||
<a href="{% url 'index' %}" class="block text-center text-blue-500 mt-4" | ||
>Back to Expense Tracker</a | ||
> | ||
</div> | ||
</body> | ||
</html> |
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,40 +1,74 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Edit Expense</title> | ||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"> | ||
</head> | ||
<body class="bg-gray-100 min-h-screen flex items-center justify-center"> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body class="bg-gray-100 min-h-screen flex items-center justify-center"> | ||
<div class="bg-white p-8 rounded-lg shadow-lg w-full max-w-md"> | ||
<h2 class="text-2xl font-bold mb-6 text-center">Edit Expense</h2> | ||
<form method="POST" class="space-y-4"> | ||
{% csrf_token %} | ||
<div> | ||
<label for="date" class="block text-gray-700">Date:</label> | ||
<input type="date" id="date" name="date" value="{{ form.date.value|date:'Y-m-d' }}" class="w-full p-2 border border-gray-300 rounded mt-1"> | ||
</div> | ||
<div> | ||
<label for="category" class="block text-gray-700">Category:</label> | ||
<input type="text" id="category" name="category" value="{{ form.category.value }}" class="w-full p-2 border border-gray-300 rounded mt-1" placeholder="e.g., Food, Transportation"> | ||
</div> | ||
<div> | ||
<label for="amount" class="block text-gray-700">Amount:</label> | ||
<input type="number" id="amount" name="amount" step="0.01" value="{{ form.amount.value }}" class="w-full p-2 border border-gray-300 rounded mt-1" placeholder="e.g., 10.50"> | ||
</div> | ||
|
||
<div> | ||
<label for="currency" class="block text-gray-700">Currency:</label> | ||
<input type="text" id="currency" name="currency" class="w-full p-2 border border-gray-300 rounded mt-1" placeholder="e.g., USD, EUR (optional)"> | ||
</div> | ||
|
||
<button type="submit" class="w-full bg-blue-500 text-white p-2 rounded mt-4 hover:bg-blue-600">Save Changes</button> | ||
</form> | ||
<a href="{% url 'index' %}" class="block text-center text-blue-500 mt-4">Back to Expense Tracker</a> | ||
</div> | ||
<h2 class="text-2xl font-bold mb-6 text-center">Edit Expense</h2> | ||
<form method="POST" class="space-y-4"> | ||
{% csrf_token %} | ||
<div> | ||
<label for="date" class="block text-gray-700">Date:</label> | ||
<input | ||
type="date" | ||
id="date" | ||
name="date" | ||
value="{{ form.date.value|date:'Y-m-d' }}" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
/> | ||
</div> | ||
<div> | ||
<label for="category" class="block text-gray-700">Category:</label> | ||
<input | ||
type="text" | ||
id="category" | ||
name="category" | ||
value="{{ form.category.value }}" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
placeholder="e.g., Food, Transportation" | ||
/> | ||
</div> | ||
<div> | ||
<label for="amount" class="block text-gray-700">Amount:</label> | ||
<input | ||
type="number" | ||
id="amount" | ||
name="amount" | ||
step="0.01" | ||
value="{{ form.amount.value }}" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
placeholder="e.g., 10.50" | ||
/> | ||
</div> | ||
|
||
</body> | ||
<div> | ||
<label for="currency" class="block text-gray-700">Currency:</label> | ||
<input | ||
type="text" | ||
id="currency" | ||
name="currency" | ||
class="w-full p-2 border border-gray-300 rounded mt-1" | ||
placeholder="e.g., USD, EUR (optional)" | ||
/> | ||
</div> | ||
|
||
</html> | ||
<button | ||
type="submit" | ||
class="w-full bg-blue-500 text-white p-2 rounded mt-4 hover:bg-blue-600" | ||
> | ||
Save Changes | ||
</button> | ||
</form> | ||
<a href="{% url 'index' %}" class="block text-center text-blue-500 mt-4" | ||
>Back to Expense Tracker</a | ||
> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.