Create a simple Tailwind HTML page called add_transaction.html for a Django project.
Browse filesIt should include:
- A form with fields: title (text), amount (number), and type (dropdown: Income or Expense).
- A submit button labeled “Save Transaction”.
- A back button or link to go back to `{% url 'dashboard' %}`.
- Center everything in a small white card with shadow.
Files changed (2)
- add_transaction.htmlAdded+45
- index.html+1
123456789101112131415161718192021222324252627282930313233343536373839404142434445<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Add Transaction</title> <script src="https://cdn.tailwindcss.com"></script></head><body class="bg-gray-50"> <div class="min-h-screen flex items-center justify-center"> <div class="bg-white p-8 rounded-lg shadow-md w-full max-w-md"> <div class="mb-4"> <a href="{% url 'dashboard' %}" class="text-blue-600 hover:text-blue-800">← Back</a> </div> <h1 class="text-2xl font-bold text-gray-800 mb-6 text-center">Add Transaction</h1> <form method="post" class="space-y-4"> {% csrf_token %} <div> <label for="title" class="block text-sm font-medium text-gray-700">Title</label> <input type="text" id="title" name="title" required class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"> </div> <div> <label for="amount" class="block text-sm font-medium text-gray-700">Amount</label> <input type="number" id="amount" name="amount" step="0.01" required class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"> </div> <div> <label for="type" class="block text-sm font-medium text-gray-700">Type</label> <select id="type" name="type" required class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"> <option value="">Select Type</option> <option value="Income">Income</option> <option value="Expense">Expense</option> </select> </div> <button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> Save Transaction </button> </form> </div> </div></body></html>14 unmodified lines15161718192014 unmodified lines<a href="about.html" class="text-gray-600 hover:text-blue-600">About</a><a href="login.html" class="text-gray-600 hover:text-blue-600">Login</a><a href="dashboard.html" class="text-gray-600 hover:text-blue-600">Dashboard</a></div></div></nav>14 unmodified lines1516171819202114 unmodified lines<a href="about.html" class="text-gray-600 hover:text-blue-600">About</a><a href="login.html" class="text-gray-600 hover:text-blue-600">Login</a><a href="dashboard.html" class="text-gray-600 hover:text-blue-600">Dashboard</a><a href="add_transaction.html" class="text-gray-600 hover:text-blue-600">Add Transaction</a></div></div></nav>
add_transaction.htmlAdded+45
index.html+1