-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
16 changed files
with
492 additions
and
384 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,51 +1,80 @@ | ||
{% extends 'base.html' %} | ||
{% block content %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{% if address %}Edit Address{% else %}Add Address{% endif %}</title> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
</head> | ||
<body class="bg-gray-100 flex items-center justify-center min-h-screen"> | ||
<div class="w-full max-w-3xl mx-auto p-8 bg-white rounded-lg shadow-lg "> | ||
<h1 class="text-3xl font-bold text-center text-gray-800 mb-10">{% if address %}Edit Address{% else %}Add Address{% endif %}</h1> | ||
<form method="post" class="space-y-6"> | ||
{% csrf_token %} | ||
{% if address %} | ||
<input type="hidden" name="address_id" value="{{ address.id }}"> | ||
{% endif %} | ||
<div class="grid grid-cols-1 gap-6"> | ||
<input type="hidden" name="address_type" id="address_type" value="Address" required> | ||
<div> | ||
<label for="address_line_1" class="block text-lg font-medium text-gray-700">Address Line 1:</label> | ||
<input type="text" name="address_line_1" id="address_line_1" value="{% if address %}{{ address.address_line_1 }}{% endif %}" required class="form-input block w-full px-4 py-3 rounded-lg border-2 border-gray-300 focus:border-blue-600 focus:ring focus:ring-blue-500 focus:ring-opacity-50"> | ||
<div class="flex justify-center items-center min-h-screen bg-gray-50"> | ||
<div class="w-full max-w-3xl px-4 py-6"> | ||
<div class="bg-white rounded-2xl shadow-lg p-8 border border-gray-100"> | ||
<h1 class="text-3xl font-extrabold text-gray-900 mb-8 text-center bg-gradient-to-r from-purple-600 to-indigo-600 bg-clip-text text-transparent"> | ||
{% if address %}Edit Address{% else %}Add New Address{% endif %} | ||
</h1> | ||
|
||
<form method="post" class="grid grid-cols-1 gap-8"> | ||
{% csrf_token %} | ||
{% if address %} | ||
<input type="hidden" name="address_id" value="{{ address.id }}"> | ||
{% endif %} | ||
<input type="hidden" name="address_type" id="address_type" value="Address"> | ||
|
||
<!-- Address Line 1 --> | ||
<div class="space-y-2"> | ||
<label for="address_line_1" class="text-base font-semibold text-gray-800 block">Address Line 1</label> | ||
<input type="text" name="address_line_1" id="address_line_1" | ||
value="{% if address %}{{ address.address_line_1 }}{% endif %}" required | ||
class="mt-1 block w-full px-4 py-3 rounded-lg border border-gray-200 shadow-sm focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all duration-300 text-gray-700" | ||
placeholder="Enter your street address"> | ||
</div> | ||
<div> | ||
<label for="address_line_2" class="block text-lg font-medium text-gray-700">Address Line 2:</label> | ||
<input type="text" name="address_line_2" id="address_line_2" value="{% if address %}{{ address.address_line_2 }}{% endif %}" class="form-input block w-full px-4 py-3 rounded-lg border-2 border-gray-300 focus:border-blue-600 focus:ring focus:ring-blue-500 focus:ring-opacity-50"> | ||
|
||
<!-- Address Line 2 --> | ||
<div class="space-y-2"> | ||
<label for="address_line_2" class="text-base font-semibold text-gray-800 block">Address Line 2</label> | ||
<input type="text" name="address_line_2" id="address_line_2" | ||
value="{% if address %}{{ address.address_line_2 }}{% endif %}" | ||
class="mt-1 block w-full px-4 py-3 rounded-lg border border-gray-200 shadow-sm focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all duration-300 text-gray-700" | ||
placeholder="Apartment, suite, unit, etc. (optional)"> | ||
</div> | ||
<div> | ||
<label for="city" class="block text-lg font-medium text-gray-700">City:</label> | ||
<input type="text" name="city" id="city" value="{% if address %}{{ address.city }}{% endif %}" required class="form-input block w-full px-4 py-3 rounded-lg border-2 border-gray-300 focus:border-blue-600 focus:ring focus:ring-blue-500 focus:ring-opacity-50"> | ||
|
||
<!-- City, State, Country Grid --> | ||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6"> | ||
<div class="space-y-2"> | ||
<label for="city" class="text-base font-semibold text-gray-800 block">City</label> | ||
<input type="text" name="city" id="city" | ||
value="{% if address %}{{ address.city }}{% endif %}" required | ||
class="mt-1 block w-full px-4 py-3 rounded-lg border border-gray-200 shadow-sm focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all duration-300 text-gray-700" | ||
placeholder="Enter city"> | ||
</div> | ||
|
||
<div class="space-y-2"> | ||
<label for="state" class="text-base font-semibold text-gray-800 block">State</label> | ||
<input type="text" name="state" id="state" | ||
value="{% if address %}{{ address.state }}{% endif %}" required | ||
class="mt-1 block w-full px-4 py-3 rounded-lg border border-gray-200 shadow-sm focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all duration-300 text-gray-700" | ||
placeholder="Enter state"> | ||
</div> | ||
|
||
<div class="space-y-2"> | ||
<label for="country" class="text-base font-semibold text-gray-800 block">Country</label> | ||
<input type="text" name="country" id="country" | ||
value="{% if address %}{{ address.country }}{% endif %}" required | ||
class="mt-1 block w-full px-4 py-3 rounded-lg border border-gray-200 shadow-sm focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all duration-300 text-gray-700" | ||
placeholder="Enter country"> | ||
</div> | ||
</div> | ||
<div> | ||
<label for="state" class="block text-lg font-medium text-gray-700">State:</label> | ||
<input type="text" name="state" id="state" value="{% if address %}{{ address.state }}{% endif %}" required class="form-input block w-full px-4 py-3 rounded-lg border-2 border-gray-300 focus:border-blue-600 focus:ring focus:ring-blue-500 focus:ring-opacity-50"> | ||
|
||
<!-- Zip Code --> | ||
<div class="space-y-2"> | ||
<label for="zip_code" class="text-base font-semibold text-gray-800 block">Zip Code</label> | ||
<input type="text" name="zip_code" id="zip_code" | ||
value="{% if address %}{{ address.zip_code }}{% endif %}" required | ||
class="mt-1 block w-full px-4 py-3 rounded-lg border border-gray-200 shadow-sm focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-all duration-300 text-gray-700" | ||
placeholder="Enter zip code"> | ||
</div> | ||
<div> | ||
<label for="country" class="block text-lg font-medium text-gray-700">Country:</label> | ||
<input type="text" name="country" id="country" value="{% if address %}{{ address.country }}{% endif %}" required class="form-input block w-full px-4 py-3 rounded-lg border-2 border-gray-300 focus:border-blue-600 focus:ring focus:ring-blue-500 focus:ring-opacity-50"> | ||
</div> | ||
<div> | ||
<label for="zip_code" class="block text-lg font-medium text-gray-700">Zip Code:</label> | ||
<input type="text" name="zip_code" id="zip_code" value="{% if address %}{{ address.zip_code }}{% endif %}" required class="form-input block w-full px-4 py-3 rounded-lg border-2 border-gray-300 focus:border-blue-600 focus:ring focus:ring-blue-500 focus:ring-opacity-50"> | ||
</div> | ||
<button type="submit" class="w-full bg-violet-600 hover:bg-violet-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300 ease-in-out">{% if address %}Update{% else %}Add{% endif %} Address</button> | ||
</div> | ||
</form> | ||
|
||
<!-- Submit Button --> | ||
<button type="submit" | ||
class="w-full bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white font-bold text-lg py-4 px-6 rounded-xl shadow-lg transform transition-all duration-300 hover:scale-[1.02] hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-indigo-500 focus:ring-opacity-50"> | ||
{% if address %}Update{% else %}Save{% endif %} Address | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
</div> | ||
{% endblock content %} |
Oops, something went wrong.