buffmomo

detail_sea_container.html

Feb 19th, 2024
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 29.32 KB | Source Code | 0 0
  1. {% extends "base.html" %}
  2. {% load crispy_forms_tags %}
  3. {% load auth_extras %}
  4. {% load tailwind_filters %}
  5. {% load empty_fields %}
  6. {% load static %}
  7. {% load humanize %}
  8. {% load static %}
  9. {% load partials %}
  10. {% block content %}
  11.     {% render_empty_fields sea_container %}
  12.     <div class="bg-white shadow-lg rounded-lg p-4 w-full">
  13.         <span class="bg-indigo-100 text-indigo-800 text-xs font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-indigo-900 dark:text-indigo-300">{{ sea_container.get_payment_method_display }} </span>
  14.         <span class="bg-indigo-100 text-indigo-800 text-xs font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-indigo-900 dark:text-indigo-300">{{ sea_container.get_type }} </span>
  15.         {% if sea_container.customs_cleared %}
  16.             <span hx-get="{% url 'sea_container_custom_cleared' sea_container.id %}"
  17.                  class="cursor-pointer bg-green-100 text-green-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">Customs Cleared on {{ sea_container.customs_cleared_date }}</span>
  18.         {% else %}
  19.             <span hx-get="{% url 'sea_container_custom_cleared' sea_container.id %}"
  20.                  class="cursor-pointer bg-red-100 text-red-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300">Customs Not Cleared </span>
  21.         {% endif %}
  22.         {% if sea_container.documents_cleared %}
  23.             <span hx-get="{% url 'sea_container_docs_cleared' sea_container.id %}"
  24.                  class="cursor-pointer bg-green-100 text-green-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">Document Cleared</span>
  25.         {% else %}
  26.             <span hx-get="{% url 'sea_container_docs_cleared' sea_container.id %}"
  27.                  class="cursor-pointer bg-red-100 text-red-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300">Document Not Cleared </span>
  28.         {% endif %}
  29.         <h1 class="text-3xl font-semibold text-gray-800 mb-4">
  30.             {{ sea_container.get_container_name }} {{ sea_container.company }}
  31.         </h1>
  32.         <h2 class="text-2xl font-semibold text-gray-600 mb-4">{{ sea_container.shipper }}</h2>
  33.         <h3 class="text-1xl  text-gray-500 mb-4">
  34.             Refrence Number :  <span class=" text-blue-300 font-bold">{{ sea_container.refrence_number }}</span>  Refrence Date :<span class="font-bold">{{ sea_container.refrence_date }}</span>
  35.         </h3>
  36.         <div class="grid grid-cols-2 gap-4">
  37.             <div>
  38.                 <p class="text-lg font-semibold text-gray-800 mb-2">Bill of Lading</p>
  39.                 <p class="text {% if not sea_container.bill_of_lading %}text-red-500{% endif %}">
  40.                     Bill of Lading: {{ sea_container.bill_of_lading }}
  41.                 </p>
  42.                 <p class="text-sm {% if not sea_container.bill_of_lading_date %}text-red-500{% endif %}">
  43.                     Bill of Lading Date: {{ sea_container.bill_of_lading_date }}
  44.                 </p>
  45.             </div>
  46.         </div>
  47.         <div class="grid grid-cols-2 gap-4 mt-4">
  48.             <div>
  49.                 <div class="group">
  50.                     <p class="text-lg font-semibold text-gray-800 mb-2">Proforma Invoice</p>
  51.                     <p class="text-sm {% if not sea_container.proforma_invoice_number %}text-red-500{% endif %}">
  52.                         Invoice Number: {{ sea_container.proforma_invoice_number }}
  53.                     </p>
  54.                     <p class="text-sm {% if not sea_container.proforma_invoice_date %}text-red-500{% endif %}">
  55.                         Invoice Date: {{ sea_container.proforma_invoice_date }}
  56.                     </p>
  57.                     <p class="text-sm {% if not sea_container.proforma_invoice_value %}text-red-500{% endif %}">
  58.                         Proforma Invoice Amount: {{ sea_container.proforma_invoice_value|intcomma }}
  59.                     </p>
  60.                 </div>
  61.                 <div class="group">
  62.                     <p class="text-lg font-semibold text-gray-800 mb-2">Commercial Invoice</p>
  63.                     <p class="text-sm {% if not sea_container.commercial_invoice_number %}text-red-500{% endif %}">
  64.                         Commercial Invoice Number: {{ sea_container.commercial_invoice_number }}
  65.                     </p>
  66.                     <p class="text-sm {% if not sea_container.commercial_invoice_date %}text-red-500{% endif %}">
  67.                         Commercial Invoice Date: {{ sea_container.commercial_invoice_date }}
  68.                     </p>
  69.                     <p class="text-sm {% if not sea_container.commercial_invoice_value %}text-red-500{% endif %}">
  70.                         Commercial Invoice Amount: $ {{ sea_container.commercial_invoice_value }}
  71.                     </p>
  72.                 </div>
  73.             </div>
  74.         </div>
  75.         <div class="mt-4">
  76.             <p class="text-lg font-semibold text-gray-800 mb-2">Margin</p>
  77.             <p class="text-sm {% if not sea_container.margin_percentage %}text-red-500{% endif %}">
  78.                 Margin Percentage: {{ sea_container.margin_percentage }}%
  79.             </p>
  80.             <p class="text-sm {% if not sea_container.margin_amount %}text-red-500{% endif %}">
  81.                 Margin Amount: Rs. {{ sea_container.margin_amount|intcomma }}
  82.             </p>
  83.         </div>
  84.     </div>
  85.     <br>
  86.     <div class="flex space-x-4"  hx-boost="false">
  87.         <h2 class="text-4xl font-extrabold dark:text-white">Marka</h2>
  88.         <span>
  89.             <a href="{% url 'pdf-sea-loading-container' sea_container.id %}"
  90.               class="flex items-center">
  91.                 <svg class="w-6 h-6 text-gray-800 dark:text-white"
  92.                     aria-hidden="true"
  93.                     xmlns="http://www.w3.org/2000/svg"
  94.                     fill="none"
  95.                     viewBox="0 0 16 20">
  96.                     <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 18a.969.969 0 0 0 .933 1h12.134A.97.97 0 0 0 15 18M1 7V5.828a2 2 0 0 1 .586-1.414l2.828-2.828A2 2 0 0 1 5.828 1h8.239A.97.97 0 0 1 15 2v5M6 1v4a1 1 0 0 1-1 1H1m0 9v-5h1.5a1.5 1.5 0 1 1 0 3H1m12 2v-5h2m-2 3h2m-8-3v5h1.375A1.626 1.626 0 0 0 10 13.375v-1.75A1.626 1.626 0 0 0 8.375 10H7Z" />
  97.                 </svg>
  98.             </a>
  99.         </span>
  100.         <span>
  101.             <a href="{% url 'excel-sea-loading-container' sea_container.id %}"
  102.               class="flex items-center">
  103.                 <svg class="w-6 h-6 text-gray-800 dark:text-white"
  104.                     aria-hidden="true"
  105.                     xmlns="http://www.w3.org/2000/svg"
  106.                     fill="none"
  107.                     viewBox="0 0 16 20">
  108.                     <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 18a.969.969 0 0 0 .933 1h12.134A.97.97 0 0 0 15 18M1 7V5.828a2 2 0 0 1 .586-1.414l2.828-2.828A2 2 0 0 1 5.828 1h8.239A.97.97 0 0 1 15 2v4.639M6 1v4a1 1 0 0 1-1 1H1m2.665 9H2.647A1.647 1.647 0 0 1 1 13.353v-1.706A1.647 1.647 0 0 1 2.647 10h1.018M12 10l1.443 4.773L15 10m-6.057-.152L8 9.828a1.34 1.34 0 0 0-1.359 1.22 1.32 1.32 0 0 0 1.172 1.421l.536.059a1.273 1.273 0 0 1 1.226 1.718c-.2.571-.636.754-1.337.754h-1.13" />
  109.                 </svg>
  110.             </a>
  111.         </span>
  112.     </div>
  113.     <br>
  114.     <div class="relative overflow-x-auto">
  115.         <table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
  116.             <thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
  117.                 <tr>
  118.                     <th scope="col" class="px-6 py-3">Party Name</th>
  119.                     <th scope="col" class="px-6 py-3">Marka Name</th>
  120.                     <th scope="col" class="px-6 py-3">Marka cartoon number</th>
  121.                     <th scope="col" class="px-6 py-3">CBM</th>
  122.                     <th scope="col" class="px-6 py-3"></th>
  123.                     <th scope="col" class="px-6 py-3"></th>
  124.                 </tr>
  125.             </thead>
  126.             <tbody id="marka-list">
  127.                 {% for marka in markas %}
  128.                     {% partialdef sea-list-markas inline=True %}
  129.                     <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
  130.                         <td class="px-6 py-4">
  131.                             <a href="{% url 'detail-party-hisab' marka.party_name %}">{{ marka.party_name }}</a>
  132.                         </td>
  133.                         <td class="px-6 py-4">{{ marka.marka_name }}</td>
  134.                         <td class="px-6 py-4">{{ marka.cartoon_number }}</td>
  135.                         <td class="px-6 py-4">{{ marka.cbm }}</td>
  136.                         <td>
  137.                             {% if 'add_edit' in groups %}
  138.                                 <a class=" text-red-400 px-6 py-4"
  139.                                   hx-delete="{% url "htmx-delete-marka" marka.id %}"
  140.                                   hx-confirm="Sure you want to delete {{ marka.marka_name }} ?">Delete</a>
  141.                                 <a class=" text-red-400 px-6 py-4"
  142.                                    href="{% url 'edit-sea-marka' marka.id sea_container.id %}"
  143.                                ">Edit</a>
  144.                             {% endif %}
  145.                         </td>
  146.                     </tr>
  147.                 {% endpartialdef %}
  148.             {% endfor %}
  149.         </tbody>
  150.     </table>
  151. </div>
  152. <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  153. {% if 'add_edit' in groups %}
  154.     <h2 class="text-4xl font-extrabold dark:text-white">Create Sea Marka</h2>
  155.     {% include "sea/markas/create_sea_marka.html" %}
  156.     <br>
  157.     <br>
  158. {% endif %}
  159. <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  160. <h2 class="text-4xl font-extrabold dark:text-white">Files</h2>
  161. <div class="p-4">
  162.     <h2 class="text-2xl font-semibold mb-4">Hisab Files</h2>
  163.     {% if sea_container.hisab_files %}
  164.         <iframe src="{{ sea_container.hisab_files.url }}"
  165.                class="w-full h-64"
  166.                frameborder="0">
  167.         </iframe>
  168.         <a href="{{ sea_container.hisab_files.url }}"
  169.           target="_blank"
  170.           class="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900">View</a>
  171.         {% if 'add_edit' in groups %}
  172.             <a hx-delete="{% url "delete-container-hisab-file" sea_container.id %}"
  173.               hx-confirm="Sure want to remove this hisab file? You need to upload this again if you do that."
  174.               class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">Delete</a>
  175.         {% endif %}
  176.     {% else %}
  177.         <h2 class="font-semibold mb-4 text-red-500">No Hisab Files Uploaded</h2>
  178.         {% if 'add_edit' in groups %}
  179.             <form id="container-hisab-file-form"
  180.                  hx-encoding='multipart/form-data'
  181.                  hx-post='{% url 'upload-container-hisab-file' sea_container.id %}'
  182.                  hx-indicator="#hisab-upload-indicator">
  183.                 <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
  184.                       for="hisab_file"
  185.                       _='on htmx:xhr:progress(loaded, total) set #hisab-progress.value to (loaded/total)*100'>
  186.                     Upload file
  187.                 </label>
  188.                 <div class="grid grid-cols-2 gap-4">
  189.                     <div>
  190.                         <input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"
  191.                               id="id_hisab_file"
  192.                               Name="hisab_file"
  193.                               type="file"
  194.                               required
  195.                               accept="image/*,.pdf">
  196.                     </div>
  197.                     <div>
  198.                         <button type="submit"
  199.                                class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center">
  200.                             Submit
  201.                             <svg id="hisab-upload-indicator"
  202.                                 aria-hidden="true"
  203.                                 role="status"
  204.                                 class="htmx-indicator inline w-4 h-4 me-3 text-white animate-spin"
  205.                                 viewBox="0 0 100 101"
  206.                                 fill="none"
  207.                                 xmlns="http://www.w3.org/2000/svg">
  208.                                 <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="#E5E7EB" />
  209.                                 <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentColor" />
  210.                             </svg>
  211.                         </button>
  212.                     </div>
  213.                 </div>
  214.             </form>
  215.         {% endif %}
  216.     {% endif %}
  217.     <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  218.     <h2 class="text-2xl font-semibold mb-4">Insurance Files</h2>
  219.     {% if sea_container.insurance_file %}
  220.         <iframe src="{{ sea_container.insurance_file.url }}"
  221.                class="w-full h-64"
  222.                frameborder="0">
  223.         </iframe>
  224.         <a href="{{ sea_container.insurance_file.url }}"
  225.           target="_blank"
  226.           class="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900">View</a>
  227.         {% if 'add_edit' in groups %}
  228.             <a hx-delete="{% url "delete-container-insurance-file" sea_container.id %}"
  229.               hx-confirm="Sure want to remove this insurance file? You need to upload this again if you do that."
  230.               class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">Delete</a>
  231.         {% endif %}
  232.     {% else %}
  233.         <h2 class="font-semibold mb-4 text-red-500">No Insurance Files Uploaded</h2>
  234.         {% if 'add_edit' in groups %}
  235.             <form id="container=insurance-file-form"
  236.                  hx-encoding='multipart/form-data'
  237.                  hx-post='{% url "upload-container-insurance-file" sea_container.id %}'
  238.                  hx-indicator="#insurance-upload-indicator">
  239.                 <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
  240.                       for="hisab_file"
  241.                       _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
  242.                     Upload file
  243.                 </label>
  244.                 <div class="grid grid-cols-2 gap-4">
  245.                     <div>
  246.                         <input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"
  247.                               name="insurance_files"
  248.                               type="file"
  249.                               required
  250.                               accept="image/*,.pdf">
  251.                     </div>
  252.                     <div>
  253.                         <button type="submit"
  254.                                class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center">
  255.                             Submit
  256.                             <svg id="insurance-upload-indicator"
  257.                                 display="none"
  258.                                 aria-hidden="true"
  259.                                 role="status"
  260.                                 class="htmx-indicator inline w-4 h-4 me-3 text-white animate-spin"
  261.                                 viewBox="0 0 100 101"
  262.                                 fill="none"
  263.                                 xmlns="http://www.w3.org/2000/svg">
  264.                                 <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="#E5E7EB" />
  265.                                 <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentColor" />
  266.                             </svg>
  267.                         </button>
  268.                     </div>
  269.                 </div>
  270.             </form>
  271.         {% endif %}
  272.     {% endif %}
  273.     <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  274.     <h2 class="text-2xl font-semibold mb-4">Pragyapan Patra</h2>
  275.     {% partialdef sea-pragyapan-form inline=True %}
  276.     {% if sea_container.pragyapan_patra %}
  277.         <div id="pragyapan_form">
  278.             <iframe src="{{ sea_container.pragyapan_patra.url }}"
  279.                    class="w-full h-64"
  280.                    frameborder="0"></iframe>
  281.             <a href="{{ sea_container.pragyapan_patra.url }}"
  282.               target="_blank"
  283.               class="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900">View</a>
  284.             {% if 'add_edit' in groups %}
  285.                 <a hx-delete="{% url "delete-pragyapanpatra-file" sea_container.id %}"
  286.                   hx-confirm="Sure want to remove this insurance file? You need to upload this again if you do that."
  287.                   hx-target="#pragyapan_form"
  288.                   class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">Delete</a>
  289.             {% endif %}
  290.         {% else %}
  291.             <h2 class="font-semibold mb-4 text-red-500">No Pragyapan File Uploaded</h2>
  292.             {% if 'add_edit' in groups %}
  293.                 <form id="pragyapan-patra-form"
  294.                      hx-encoding='multipart/form-data'
  295.                      hx-post='{% url "upload-pragyapanpatra-file" sea_container.id %}'
  296.                      hx-indicator="#insurance-upload-indicator">
  297.                     <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
  298.                           for="hisab_file">Upload file</label>
  299.                     <div class="grid grid-cols-2 gap-4">
  300.                         <div>
  301.                             <input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"
  302.                                   id="id_pragyapan_patra"
  303.                                   name="pragyapan_patra"
  304.                                   type="file"
  305.                                   required
  306.                                   accept="image/*,.pdf">
  307.                         </div>
  308.                         <div>
  309.                             <button type="submit"
  310.                                    class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center">
  311.                                 Submit
  312.                             </button>
  313.                         </div>
  314.                     </div>
  315.                 </form>
  316.             {% endif %}
  317.         </div>
  318.     {% endif %}
  319. {% endpartialdef %}
  320. <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  321. <h2 class="text-2xl font-semibold mb-4">Container File</h2>
  322. {% if sea_container.contianer_file %}
  323.     <iframe src="{{ sea_container.contianer_file.url }}"
  324.            class="w-full h-64"
  325.            frameborder="0"></iframe>
  326.     <a href="{{ sea_container.contianer_file.url }}"
  327.       target="_blank"
  328.       class="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900">View</a>
  329.     {% if 'add_edit' in groups %}
  330.         <a hx-delete="{% url "delete-container-file" sea_container.id %}"
  331.           hx-confirm="Sure Want to delete?"
  332.           class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">Delete</a>
  333.     {% endif %}
  334. {% else %}
  335.     <p class="font-semibold mb-4 text-red-500">No Container File Uploaded</p>
  336.     {% if 'add_edit' in groups %}
  337.         <form id="container-form"
  338.              hx-encoding='multipart/form-data'
  339.              hx-post="{% url "upload-container-file" sea_container.id %}">
  340.             <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
  341.                   for="hisab_file">Upload file</label>
  342.             <div class="grid grid-cols-2 gap-4">
  343.                 <div>
  344.                     <input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"
  345.                           id="container_file"
  346.                           name="container_file"
  347.                           type="file"
  348.                           required
  349.                           accept="image/*,.pdf">
  350.                 </div>
  351.                 <div>
  352.                     <button type="submit"
  353.                            class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center">
  354.                         Submit
  355.                     </button>
  356.                 </div>
  357.             </div>
  358.         </form>
  359.     {% endif %}
  360. {% endif %}
  361. <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  362. <h2 class="text-2xl font-semibold mb-4">Excel File</h2>
  363. {% if sea_container.excel_file %}
  364.     <h3 class="text-2xl text-gray-400">
  365.         <a>{{ sea_container.excel_file }}</a>
  366.     </h3>
  367.     <br>
  368.     <a type="button"
  369.       href="{{ sea_container.excel_file.url }}"
  370.       class="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900">Download</a>
  371.     {% if 'add_edit' in groups %}
  372.         <a type="button"
  373.           hx-delete="{% url "delete-excel-file" sea_container.id %}"
  374.           hx-confirm="You sure want to delete the excel file?"
  375.           class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">Delete</a>
  376.     {% endif %}
  377. {% else %}
  378.     <h2 class="font-semibold mb-4 text-red-500">No Container Excel Uploaded</h2>
  379.     {% if 'add_edit' in groups %}
  380.         <form id="excel-file-form"
  381.              hx-encoding='multipart/form-data'
  382.              hx-post="{% url "upload-excel-file" sea_container.id %}">
  383.             <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
  384.                   for="hisab_file"
  385.                   _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
  386.                 Upload file
  387.             </label>
  388.             <div class="grid grid-cols-2 gap-4">
  389.                 <div>
  390.                     <input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"
  391.                           id="id_excel_file"
  392.                           name="excel_file"
  393.                           type="file"
  394.                           required
  395.                           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
  396.                 </div>
  397.                 <div>
  398.                     <button type="submit"
  399.                            class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center">
  400.                         Submit
  401.                     </button>
  402.                 </div>
  403.             </div>
  404.         </form>
  405.     {% endif %}
  406. {% endif %}
  407. <hr class="h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700">
  408. <h2 class="text-2xl font-semibold mb-4">Customs Excel File</h2>
  409. {% if sea_container.customs_excel_file %}
  410.     <h3 class="text-2xl text-gray-400">{{ sea_container.customs_excel_file }}</h3>
  411.     <br>
  412.     <a href="{{ sea_container.customs_excel_file.url }}"
  413.       type="button"
  414.       class="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900">Download</a>
  415.     {% if 'add_edit' in groups %}
  416.         <a hx-delete="{% url "delete-customs-excel-file" sea_container.id %}"
  417.           hx-confirm="Sure Want to Delete?"
  418.           type="button"
  419.           class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">Delete</a>
  420.     {% endif %}
  421. {% else %}
  422.     <h2 class="font-semibold mb-4 text-red-500">No Customs Excel Uploaded</h2>
  423.     {% if 'add_edit' in groups %}
  424.         <form id="excel-upload"
  425.              hx-encoding='multipart/form-data'
  426.              hx-post="{% url "upload-customs-excel-file" sea_container.id %}">
  427.             <label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
  428.                   for="hisab_file">Upload file</label>
  429.             <div class="grid grid-cols-2 gap-4">
  430.                 <div>
  431.                     <input class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"
  432.                           id="hisab_file"
  433.                           name="customs_excel_file"
  434.                           type="file"
  435.                           required
  436.                           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
  437.                 </div>
  438.                 <div>
  439.                     <button type="submit"
  440.                            class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center">
  441.                         Submit
  442.                     </button>
  443.                 </div>
  444.             </div>
  445.         </form>
  446.     {% endif %}
  447. {% endif %}
  448. </div>
  449. {% endblock content %}
  450.  
Advertisement
Add Comment
Please, Sign In to add comment