{% extends "base_table.html" %}

{% block structure_tab_class %} active{% endblock %}

{% block inner_content %}
<h3>Add Column</h3>
<form action="{{ url_for('add_column', table=table) }}" class="form" method="post">
  <div class="form-group">
    <label for="id_name">Column name</label>
    <input class="form-control" id="id_name" name="name" type="text" placeholder="my_column" value="{{ name }}" />
  </div>
  <div class="form-group">
    <label for="id_type">Column type</label>
    <select class="form-control" id="id_type" name="type">
      <option value="">Select column type</option>
      {% for column in column_mapping %}
      <option {% if column == col_type %}selected="selected" {% endif %}value="{{ column }}">{{ column }}</option>
      {% endfor %}
    </select>
  </div>
  <button class="btn btn-primary" type="submit">Add column</button>
  <a class="btn btn-secondary" href="{{ url_for('table_structure', table=table) }}">Cancel</a>
</form>

<hr style="padding: 16px;" />

<h3 id="sql">Current Schema</h3>
{{ table_sql|format_create_table|highlight }}
{% endblock %}
