{% extends 'list-crud.html' %}
{% load static %}

{% block filter %}

{% endblock filter %}

{% block table_header %}
        <th style="display: none;">Select</th>
        <th>Preinfo №</th>
        <th>Container №</th>
        <th>Container type</th>
        <th>Line</th>
        <th>Created on</th>
        <th>Created by</th>
        <th>Status</th>
{% endblock table_header %}

{% block table_data %}
    <td>{{ object.id }}</td>
    <td>{{ object.container_number|upper }}</td>
    <td>{{ object.container_type }}</td>
    <td>{{ object.line.short_name }}</td>
    <td>{{ object.created_on|date:"d.m.Y h:m" }}</td>
    <td>{{ object.created_by.username }}</td>
    <td>{{ object.received|yesno:"Received,Pending" }}</td>
{% endblock %}

{% block buttons %}
{#    <a href="{% url 'client_preinfo_create' %}" class="btn btn-primary">Create Preinfo</a>#}
{#    <a href="#" id="editBtn" data-url="{% url 'client_preinfo_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>  #}
{#    <button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>#}
    
    <button class="btn btn-primary" type="button" onclick="window.location.href='{% url 'client_preinfo_create' %}'">Create Preinfo</button>
    <button class="btn btn-primary" type="button" id="deleteBtn" data-url="{% url 'client_preinfo_delete' pk=0 %}" data-requires-selection disabled>Delete Preinfo</button>        
{% endblock buttons %}

{% block create_modal_header %}
    <h2>Create Preinfo</h2>
{% endblock %}

{% block modal_header %}
            <h2>Edit Preinfo</h2>
{% endblock modal_header %}
