Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata UI
Commits
6f9c2d8c
Commit
6f9c2d8c
authored
Jun 17, 2019
by
Pierre Dittgen
Browse files
Use 'resources' schema metadata to provide examples
parent
7022f3ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui/templates/validation_form.html
View file @
6f9c2d8c
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment