{% extends "base.html" %}

{% block content %}
<h2>{{ _("Disclaimer") }}</h2>
<p>{{ _("These device profiles are provided as-is with no guarantee to work equally to the actual physical device they are named after. You may need to provide appropirate device drivers and/or configuration parameters for them to function properly. If you would like to see data modified, or have additional devices to add to the list, please raise an issue ticket at <a href=\"%(url)s\">GitHub</a>.", url="https://github.com/PiSCSI/piscsi/issues") }}</p>
<h2>{{ _("Hard Disk Drives") }}</h2>

<table cellpadding="3" border="black" summary="List of hard drives">
<tbody>
<tr>
    <th scope="col">{{ _("Name") }}</th>
    <th scope="col">{{ _("Size (MiB)") }}</th>
    <th scope="col">{{ _("Description") }}</th>
    <th scope="col">{{ _("Action") }}</th>
</tr>
{% for hd in drive_properties['hd_conf']|sort(attribute='name') %}
<tr>
    <td align="center">
        {% if hd.url != "" %}
        <a href="{{ hd.url }}">{{ hd.name }}</a>
        {% else %}
        {{ hd.name }}
        {% endif %}
    </td>
    <td align="center">{{ hd.size_mb }}</td>
    <td>{{ hd.description }}</td>
    <td>
    <form action="/drive/create" method="post">
        <input type="hidden" name="drive_name" value="{{ hd.name }}">
        <label for="file_name_{{ hd.name }}">{{ _("Save as:") }}</label>
        <input type="text" name="file_name" id="file_name_{{ hd.name }}" value="{{ hd.secure_name }}" required />.{{ hd.file_type }}
    <input type="submit" value="{{ _("Create") }}" />
    </form>
    </td>
</tr>
{% endfor %}
</tbody>
</table>

<hr/>

<h2>{{ _("CD/DVD Drives") }}</h2>
<p><em>{{ _("This will create a properties file for the given CD-ROM or DVD image. No new image file will be created.") }}</em></p>
<table cellpadding="3" border="black" summary="List of CD-ROM or DVD drives">
<tbody>
<tr>
    <th scope="col">{{ _("Name") }}</th>
    <th scope="col">{{ _("Description") }}</th>
    <th scope="col">{{ _("Action") }}</th>
</tr>
{% for cd in drive_properties['cd_conf']|sort(attribute='name') %}
<tr>
    <td align="center">
        {% if cd.url != "" %}
        <a href="{{ cd.url }}">{{ cd.name }}</a>
        {% else %}
        {{ cd.name }}
        {% endif %}
    </td>
    <td>{{ cd.description }}</td>
    <td>
    <form action="/drive/cdrom" method="post">
        <input type="hidden" name="drive_name" value="{{ cd.name }}">
        <label for="file_name_{{ cd.name }}">{{ _("Create for:") }}</label>
        <select type="select" name="file_name" id="file_name_{{ cd.name }}">
        {% for file in files|sort(attribute='name') %}
        {% if file["name"].lower().endswith(env['cd_suffixes']) %}
        <option value="{{ file["name"] }}">{{ file["name"].replace(env["image_dir"], '') }}</option>
        {% endif %}
        {% endfor %}
        </select>
    <input type="submit" value="{{ _("Create") }}" />
    </form>
    </td>
</tr>
{% endfor %}
</tbody>
</table>

<hr/>

<h2>{{ _("Removable Disk Drives") }}</h2>
<table cellpadding="3" border="black" summary="List of removable disk drives">
<tbody>
<tr>
    <th scope="col">{{ _("Name") }}</th>
    <th scope="col">{{ _("Size (MiB)") }}</th>
    <th scope="col">{{ _("Description") }}</th>
    <th scope="col">{{ _("Action") }}</th>
</tr>
{% for rm in drive_properties['rm_conf']|sort(attribute='name') %}
<tr>
    <td align="center">
        {% if rm.url != "" %}
        <a href="{{ rm.url }}">{{ rm.name }}</a>
        {% else %}
        {{ rm.name }}
        {% endif %}
    </td>
    <td align="center">{{ rm.size_mb }}</td>
    <td>{{ rm.description }}</td>
    <td>
    <form action="/drive/create" method="post">
        <input type="hidden" name="drive_name" value="{{ rm.name }}">
        <label for="file_name_{{ rm.name }}">{{ _("Save as:") }}</label>
        <input type="text" name="file_name" id="file_name_{{ rm.name }}" value="{{ rm.secure_name }}" required />.{{ rm.file_type }}
        <input type="submit" value="{{ _("Create") }}" />
    </form>
    </td>
</tr>
{% endfor %}
</tbody>
</table>

<h2>{{ _("Tape Drives") }}</h2>
<table cellpadding="3" border="black" summary="List of tape drives">
<tbody>
<tr>
    <th scope="col">{{ _("Name") }}</th>
    <th scope="col">{{ _("Size (MiB)") }}</th>
    <th scope="col">{{ _("Description") }}</th>
    <th scope="col">{{ _("Action") }}</th>
</tr>
{% for st in drive_properties['st_conf']|sort(attribute='name') %}
<tr>
    <td align="center">
        {% if st.url != "" %}
        <a href="{{ st.url }}">{{ st.name }}</a>
        {% else %}
        {{ st.name }}
        {% endif %}
    </td>
    <td align="center">{{ st.size_mb }}</td>
    <td>{{ st.description }}</td>
    <td>
    <form action="/drive/create" method="post">
        <input type="hidden" name="drive_name" value="{{ st.name }}">
        <label for="file_name_{{ st.name }}">{{ _("Save as:") }}</label>
        <input type="text" name="file_name" id="file_name_{{ st.name }}" value="{{ st.secure_name }}" required />.{{ st.file_type }}
        <input type="submit" value="{{ _("Create") }}" />
    </form>
    </td>
</tr>
{% endfor %}
</tbody>
</table>

<p><small>{{ _("%(disk_space)s MiB disk space remaining on the Pi", disk_space=env["free_disk_space"]) }}</small></p>

<hr/>
{% endblock content %}
