{% extends "main.html" %}
{%load static%}
{% block title %}My Projects{% endblock %}
{% block content %}


<div class="w-full xxlg1:w-[75%] bg-white h-fit rounded-md shadow-md p-5">
    <div class="w-full bg-osiblue rounded-t-md flex flex-col justify-center items-center py-2 gap-3 mt-[50px]">
        <div
            class="w-[70px] s:w-[90px] h-[70px] s:h-[90px] rounded-full mt-[-50px] s:mt-[-63px] border border-gray-300">
            <img src="{{business.logo.url}}" alt="" class="w-full h-full object-cover rounded-full">
        </div>
        <h1 class="text-xl s:text-2xl text-white font-semibold">{{business.name}}</h1>
    </div>
    <div class="w-full h-fit flex justify-end items-center bg-gray-100 shadow-md rounded-md px-3 py-3 mt-4">
        <div class="w-full s:w-fit flex flex-col s:flex-row justify-end items-center gap-3">
            <button
                class="w-full s:w-fit text-base px-3 py-2 bg-red-500 text-white outline-none border border-red-500 rounded-md cursor-pointer hover:bg-white hover:text-red-500 deleteBusinessButton duration-300"
                data-modal-url="{% url 'deletebusinessmodal' business.id %}">Delete
                Business</button>
            <a href="{% url 'editbusiness' business.business_id %}" class="w-full s:w-fit">
                <button
                    class="w-full s:w-fit text-base px-3 py-2 bg-secondosiblue text-white outline-none border border-secondosiblue rounded-md cursor-pointer hover:bg-white hover:text-secondosiblue duration-300">Edit
                    Business</button>
            </a>
        </div>
    </div>

    <div class="w-full flex flex-col gap-4 mt-5">
        <div>
            <p class="text-gray-500 text-xl">Name: <span
                    class="text-slate-800 text-xl font-semibold">{{business.name}}</span>
            </p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Email: <span
                    class="text-slate-800 text-xl font-semibold">{{business.email}}</span></p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Financial Number: <span
                    class="text-slate-800 text-xl font-semibold">{{business.financial_number}}</span></p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">VAT: <span
                    class="text-slate-800 text-xl font-semibold">{{business.vat}}</span>
            </p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Commercial Registration: <span
                    class="text-slate-800 text-xl font-semibold">{{business.commercial_registration}}</span></p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Phone Number: <span
                    class="text-slate-800 text-xl font-semibold">{{business.phone_number}}</span></p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Website: <span
                    class="text-slate-800 text-xl font-semibold">{{business.website}}</span></p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Business Type: <span
                    class="text-slate-800 text-xl font-semibold">{{business.type.name}}</span></p>
        </div>

        <div>
            <p class="text-gray-500 text-xl">Related Customer:
                {% for customer_profile in business.customerprofile_set.all %}
                <a class="cursor-pointer" href="{% url 'customerdetails' customer_profile.customer_id %}"> <span
                        class="text-blue-500 text-xl font-semibold hover:text-slate-700 underline">{{
                        customer_profile.user.first_name }} {{customer_profile.user.last_name}} <i
                            class="fa fa-angle-double-right"></i>
                        {% if not forloop.last %}, {% endif %}
                    </span> </a>
                {%endfor%}

            </p>
        </div>

    </div>
</div>


<!-- POPUP MODAL -->
<div class="w-full h-full bg-black bg-opacity-40 z-20 fixed justify-center items-center hidden" id="popUpModal">
    <div class="w-[95%] md:w-fit h-fit bg-white rounded-md p-9 relative">
        <button class="absolute top-3 right-5 text-slate-800 text-xl cursor-pointer outline-none border-none"
            id="closeModalButton">
            <i class="fa fa-close"></i>
        </button>
        <iframe id="popupModalFrame" frameborder="0"></iframe>
    </div>
</div>
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>



<!---------------------- JS SCRIPTS -------------------->

<!-- THE SCRIPT FOR THE EPICS BAR -->
<script type="text/javascript" src='{% static "js/epics.js" %}'></script>

{% endblock content %}