Commit 6f9c2d8c authored by Pierre Dittgen's avatar Pierre Dittgen

Use 'resources' schema metadata to provide examples

parent 7022f3ce
......@@ -26,6 +26,12 @@ block head %}
<a class="nav-link" id="url-tab" data-toggle="tab" href="#url" role="tab" aria-controls="url"
aria-selected="false">URL</a>
</li>
{% if schema_info.resources %}
<li class="nav-item">
<a class="nav-link" id="examples-tab" data-toggle="tab" href="#example" role="tab"
aria-controls="examples" aria-selected="false">Exemples</a>
</li>
{% endif %}
</ul>
{% set padding_class = 'p-3' %}
<div class="tab-content" id="myTabContent">
......@@ -53,11 +59,30 @@ block head %}
<label for="url">Indiquez l'URL de la table à valider</label>
<input name="url" type="url" class="form-control" id="url" aria-describedby="urlHelp"
placeholder="https://..." />
</div>
<button type="submit" class="btn btn-primary">Valider</button>
</form>
</div>
{% if schema_info.resources %}
<div class="tab-pane fade {{ padding_class }}" id="example" role="tabpanel" aria-labelledby="examples-tab">
<form method="GET">
<input name="input" value="example" type="hidden">
{% for key, value in schema_params.items() %}
<input type="hidden" name="{{ key }}" value="{{ value }}" />
{% endfor %}
<div class="form-group">
<label for="url">Choisissez l'exemple à valider</label>
<select name="url" id="url" class="form-control">
<option value="">...</option>
{% for res in schema_info.resources %}
<option value="{{ res.path }}">{{ res.title }}</option>
{% endfor %}
</select>
</div>
<button type="submit" class="btn btn-primary">Valider</button>
</form>
</div>
{% endif %}
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment