Initial work on #655: CSV import headers

This commit is contained in:
Jeremy Stretch
2017-05-31 17:40:11 -04:00
parent 4686b266a6
commit cac3d5a6e6
6 changed files with 168 additions and 52 deletions

View File

@@ -1,40 +1,3 @@
{% extends 'utilities/obj_import.html' %}
{% block title %}Tenant Import{% endblock %}
{% block instructions %}
<h4>CSV Format</h4>
<table class="table">
<thead>
<tr>
<th>Field</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>Name</td>
<td>Tenant name</td>
<td>WIDG01</td>
</tr>
<tr>
<td>Slug</td>
<td>URL-friendly name</td>
<td>widg01</td>
</tr>
<tr>
<td>Group</td>
<td>Tenant group (optional)</td>
<td>Customers</td>
</tr>
<tr>
<td>Description</td>
<td>Long-form name or other text (optional)</td>
<td>Widgets Inc.</td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<pre>WIDG01,widg01,Customers,Widgets Inc.</pre>
{% endblock %}

View File

@@ -28,6 +28,23 @@
</div>
<div class="col-md-6">
{% block instructions %}{% endblock %}
{% if fields %}
<h4>CSV Format</h4>
<table class="table">
<tr>
<th>Field</th>
<th>Required</th>
<th>Description</th>
</tr>
{% for name, field in fields.items %}
<tr>
<td><code>{{ name }}</code></td>
<td>{% if field.required %}<i class="glyphicon glyphicon-ok" title="Required"></i>{% endif %}</td>
<td>{{ field.help_text }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>
</div>
{% endblock %}