{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_modify %}

{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}

{% block content %}
<div id="content-main">
  <form method="post" enctype="multipart/form-data">
    {% csrf_token %}
    <fieldset class="module aligned">
      <h2>Import Legacy SQL Database for Company: <b>{{ company.name }}</b></h2>
      <div class="form-row">
        <div>
          <label class="required" for="sql_file">SQL File:</label>
          <input type="file" name="sql_file" id="sql_file" required accept=".sql">
          <p class="help">Upload the raw MySQL dump (e.g. tzyesyiz_yem.sql). This will parse products, categories, orders, customers, users, branches into this company's account.</p>
        </div>
      </div>
    </fieldset>
    <div class="submit-row">
      <input type="submit" value="Import Database" class="default" name="_save">
      <p class="deletelink-box"><a href="{% url 'admin:companies_company_change' company.id %}" class="cancellink">Cancel</a></p>
    </div>
  </form>
</div>
{% endblock %}
