{% extends "site/base.html" %}
{% load util %}
{% load i18n %}

{% block content %}
<div class="row panel">
  <div class="col-xs-12">
{% if user.is_verified_user %}


<div class="marg-bot-15" id="success" style="display:none;">
<div class="editable popin info center">
<p>
{% blocktrans trimmed %}
Thank you for your suggestion.
{% endblocktrans %}
</p>
<p>
<a href="/suggest/fac">{% trans "Suggest another facility" %}</a>
</p>
</div>
</div>


      <div class="editable always auto-toggled create-form"
           id="create-fac-form"
           data-edit-target="api:fac:create"
           data-edit-enter-action="submit">

        <div class="payload">
          <div data-edit-name="suggest">yes</div>
          <div data-edit-name="org_id">0</div>
        </div>

        <div class="row">
          <div class="col-xs-12 col-sm-6 col-md-6">
            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Name" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-required="yes"
                     data-edit-name="name"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Website" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="url"
                     data-edit-required="yes"
                     data-edit-name="website"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Address 1" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-required="yes"
                     data-edit-name="address1"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Address 2" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-name="address2"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "City" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-required="yes"
                     data-edit-name="city"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "State" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-name="state"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Zip-Code" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-required="no"
                     data-edit-name="zipcode"></div>
              </div>
            </div>



            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Country" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="select"
                     data-edit-name="country"
                     data-edit-required="yes"
                     data-edit-data="countries"
                     data-edit-value="US"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "CLLI Code" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-name="clli"></div>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "NPA-NXX" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-name="npanxx"></div>
              </div>
            </div>


            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Technical E-mail" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="email"
                     data-edit-name="tech_email"></div>
              </div>
            </div>
            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4 help-text"
                data-bs-toggle="tooltip"
                data-placement="top"
                title="{{ phone_help_text }}">
              {% trans "Technical Phone" %}
              <span class="glyphicon glyphicon-question-sign"></span>
            </div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-name="tech_phone"></div>
              </div>
            </div>
            <div class="row">
              <div class="col-xs-4 col-sm-5 col-md-4">{% trans "Sales E-mail" %}</div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="email"
                     data-edit-name="sales_email"></div>
              </div>
            </div>
            <div class="row">
              <div
                class="col-xs-4 col-sm-5 col-md-4 help-text"
                data-bs-toggle="tooltip"
                data-placement="top"
                title="{{ phone_help_text }}">
              {% trans "Sales Phone" %}
              <span class="glyphicon glyphicon-question-sign"></span>
              </div>
              <div class="col-xs-8 col-sm-7 col-md-8">
                <div data-edit-type="string"
                     data-edit-name="sales_phone"></div>
              </div>
            </div>
          </div>
          <div class="col-xs-12 col-sm-6 col-md-6">
            {% include "site/entity_suggest.html" with entity_name="Facility" %}
          </div>
        </div>
      </div>
    </div>


{% else %}
<div class="marg-bot-15">
<div class="editable popin error">
<p>
{% blocktrans trimmed %}
Only verified users may suggest entities.
{% endblocktrans %}
</p>
</div>
</div>
{% endif %}
</div>
</div>

<script language="javascript" type="text/javascript">
$('#create-fac-form').each(function(idx) {
  form = $(this)
  $(this).on("action-success:submit", function(ev, data) {
    $("#success").show();
    form.hide();
  })
});
$(function () {
    $("[data-bs-toggle=tooltip]").tooltip();
});

</script>
{% endblock %}
