main
emile 2 years ago
parent ef633c79f6
commit 99dabaf579

Binary file not shown.

@ -627,7 +627,7 @@ def save_business(request):
commercial_registration = request.POST.get('commercial_registration')
website = request.POST.get('website')
business_type = request.POST.get('business_type')
logo = request.POST.get('logo')
logo = request.FILES.get('logo')
business = Business(
name = name,
@ -642,7 +642,7 @@ def save_business(request):
)
business.save()
return render(request, 'add-business.html')
return redirect(businesses)
@login_required
@ -656,7 +656,7 @@ def save_business_modal(request):
commercial_registration = request.POST.get('commercial_registration')
website = request.POST.get('website')
business_type = request.POST.get('business_type')
logo = request.POST.get('logo')
logo = request.FILES.get('logo')
business = Business(
name=name,

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

@ -7,7 +7,7 @@
<h1 class="text-3xl text-slate-800 text-center font-semibold">
Add Business
</h1>
<form method="POST" action="{% url 'save_business' %}">
<form method="POST" action="{% url 'save_business' %}" enctype="multipart/form-data">
{% csrf_token %}
<input name="name" type="text" placeholder="Name"
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-4"
@ -15,8 +15,7 @@
<div class="inbox-box border border-gray-300 py-1 px-3 w-full rounded-md mt-4">
<div class="flex items-center justify-between">
<input name="logo" required name="cv" type="file" id="actual-btn" accept="image/*" hidden
multiple />
<input name="logo" required type="file" id="actual-btn" accept="image/*" hidden/>
<span id="file-name"
class="text-gray-500 text-base focus:outline-none outline-none">Upload Business
Logo</span>

@ -107,15 +107,14 @@
<!-- THE "ADD BUSINESS" FORM THAT APPEARS WHEN CLICKING ON THE ADD BUSINESS BUTTON -->
<div class="w-full p-3 rounded-md border border-gray-300 mt-5 hidden" id="addBusinessFormContainer">
<h1 class="text-3xl text-slate-800 text-center font-semibold">Add Business</h1>
<form method="POST" action="{% url 'save_business_modal' %}" id="addBusinessFormModal">
<form method="POST" action="{% url 'save_business_modal' %}" id="addBusinessFormModal" enctype="multipart/form-data">
{% csrf_token %}
<input name="name" type="text" placeholder="Name"
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-4" required>
<div class="inbox-box border border-gray-300 py-1 px-3 w-full rounded-md mt-4">
<div class="flex items-center justify-between">
<input name="logo" required name="cv" type="file" id="actual-btn" accept="image/*" hidden
multiple />
<input name="logo" required type="file" id="actual-btn" accept="image/*" hidden />
<span id="file-name" class="text-gray-500 text-base focus:outline-none outline-none">Upload
Business
Logo</span>

Loading…
Cancel
Save