{% if sw_name != "freenas" or license %}
<h1>
{% trans "License Information" %}
{% if allow_update %}
<div data-dojo-type="dijit/form/Button">
  {% trans "Update License" %}
  <script type="dojo/method" data-dojo-event="onClick">
    editObject('{% trans "Update License"|escapejs %}', '{% url "support_license_update" %}', [this, ]);
  </script>
</div>
{% endif %}
</h1>
<table class="form">
{% if license %}
  <tr>
    <th>{% trans "Model" %}</th>
    <td>{{ license.model }}</td>
    <th>{% trans "System Serial" %}</th>
    <td>{{ license.system_serial }}{% if license.system_serial_ha %} / {{ license.system_serial_ha }}{% endif %}</td>
    <th>{% trans "Contract Type" %}</th>
    <td>
      {% if license.contract_type == 0 %}
        Hardware:
        {% if license.contract_hardware == 0 %}Advanced Parts Replacement{% endif %}
        {% if license.contract_hardware == 1 %}Next Business Day On-Site{% endif %}
        {% if license.contract_hardware == 2 %}4-Hour On-Site{% endif %}
        <br />
        Software:
        {% if license.contract_software == 0 %}None{% endif %}
        {% if license.contract_software == 1 %}8x5 Help Desk{% endif %}
        {% if license.contract_software == 2 %}24x7 Help Desk{% endif %}
      {% endif %}
      {% if license.contract_type == 1 %}{% trans "Standard" %}{% endif %}
      {% if license.contract_type == 2 %}{% trans "Bronze" %}{% endif %}
      {% if license.contract_type == 3 %}{% trans "Silver" %}{% endif %}
      {% if license.contract_type == 4 %}{% trans "Gold" %}{% endif %}
      {% if license.contract_type == 5 %}{% trans "8x5 FreeNAS Support" %}{% endif %}
      {% if license.contract_type == 6 %}{% trans "8x5 FreeNAS Support" %}<br />{% trans "Maximum of 6 incidents per year" %}{% endif %}
    </td>
    <th>{% trans "Contract Date" %}</th>
    <td>{{ license.contract_start }} - {{ license.contract_end }}{% if license.expired %} <span style="color: red;">({% trans "Expired" %})</span>{% endif %}</td>
  </tr>
  <tr>
    <th>{% trans "Customer Name" %}</th>
    <td>{{ license.customer_name }}</td>
    <th>{% trans "Features" %}</th>
    <td>
      {% for f in license.features %}
        {% if f.value == 1 %}{% trans "Deduplication" %}<br />{% endif %}
        {% if f.value == 2 %}{% trans "Jails/Plugins" %}<br />{% endif %}
      {% empty %}
        {% trans "None" %}
      {% endfor %}
    </td>
    <th>{% trans "Additional Hardware" %}</th>
    <td>
      {% for f in license.addhw %}
        {% if f.1 == 1 %}{% trans "E16 Enclosure" %}{% endif %}
        {% if f.1 == 2 %}{% trans "E24 Enclosure" %}{% endif %}
        {% if f.1 == 3 %}{% trans "E60 Enclosure" %}{% endif %}: {{ f.0 }}<br />
      {% empty %}
        {% trans "None" %}
      {% endfor %}
    </td>
  </tr>
{% else %}
  {% if license_invalid %}
  <tr>
    <td colspan="2">{% trans "License is not valid! Contact iXsystems support." %}</td>
  </tr>
  {% else %}
  <tr>
    <td colspan="2">{% trans "License not found! Contact iXsystems support." %}</td>
  </tr>
  {% endif %}
{% endif %}
</table>
{% endif %}

{% if sw_name == "freenas" %}
<p style="margin-left: 15px;">{% trans "Before filing a bug report or feature request, search" %} <a href="http://bugs.freenas.org" target="_blank">http://bugs.freenas.org</a> {% trans "to ensure the issue has not already been reported. If it has, add a comment to the existing issue instead of creating a new one." %}<br />
{% trans "For enterprise-grade storage solutions and support, please visit" %} <a href="http://www.ixsystems.com/storage/" target="_blank">http://www.ixsystems.com/storage/</a>.</p>
{% endif %}

<div data-dojo-type="freeadmin/SupportTicket" data-dojo-props="url: '{% url "support_ticket" %}', softwareName: '{{ sw_name }}'{% if error_message %}, errorMessage: '{{ error_message|escapejs }}'{% endif %}{% if initial %}, initial: '{{ initial|escapejs }}'{% endif %}, categoriesUrl: '{% url "support_ticket_categories" %}', progressUrl: '{% url "support_ticket_progress" %}'"></div>
