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') commercial_registration = request.POST.get('commercial_registration')
website = request.POST.get('website') website = request.POST.get('website')
business_type = request.POST.get('business_type') business_type = request.POST.get('business_type')
logo = request.POST.get('logo') logo = request.FILES.get('logo')
business = Business( business = Business(
name = name, name = name,
@ -642,7 +642,7 @@ def save_business(request):
) )
business.save() business.save()
return render(request, 'add-business.html') return redirect(businesses)
@login_required @login_required
@ -656,7 +656,7 @@ def save_business_modal(request):
commercial_registration = request.POST.get('commercial_registration') commercial_registration = request.POST.get('commercial_registration')
website = request.POST.get('website') website = request.POST.get('website')
business_type = request.POST.get('business_type') business_type = request.POST.get('business_type')
logo = request.POST.get('logo') logo = request.FILES.get('logo')
business = Business( business = Business(
name=name, 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"> <h1 class="text-3xl text-slate-800 text-center font-semibold">
Add Business Add Business
</h1> </h1>
<form method="POST" action="{% url 'save_business' %}"> <form method="POST" action="{% url 'save_business' %}" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
<input name="name" type="text" placeholder="Name" <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" 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="inbox-box border border-gray-300 py-1 px-3 w-full rounded-md mt-4">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<input name="logo" required name="cv" type="file" id="actual-btn" accept="image/*" hidden <input name="logo" required type="file" id="actual-btn" accept="image/*" hidden/>
multiple />
<span id="file-name" <span id="file-name"
class="text-gray-500 text-base focus:outline-none outline-none">Upload Business class="text-gray-500 text-base focus:outline-none outline-none">Upload Business
Logo</span> Logo</span>

@ -107,15 +107,14 @@
<!-- THE "ADD BUSINESS" FORM THAT APPEARS WHEN CLICKING ON THE ADD BUSINESS BUTTON --> <!-- 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"> <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> <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 %} {% csrf_token %}
<input name="name" type="text" placeholder="Name" <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> 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="inbox-box border border-gray-300 py-1 px-3 w-full rounded-md mt-4">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<input name="logo" required name="cv" type="file" id="actual-btn" accept="image/*" hidden <input name="logo" required type="file" id="actual-btn" accept="image/*" hidden />
multiple />
<span id="file-name" class="text-gray-500 text-base focus:outline-none outline-none">Upload <span id="file-name" class="text-gray-500 text-base focus:outline-none outline-none">Upload
Business Business
Logo</span> Logo</span>

Loading…
Cancel
Save