Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
validata-ui
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
13
Issues
13
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Validata
validata-ui
Commits
cc96ef18
Commit
cc96ef18
authored
Jun 28, 2019
by
Pierre Dittgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add catalog descriptions on home page
parent
b58cb4ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
5 deletions
+40
-5
homepage_config.json.example
homepage_config.json.example
+20
-0
validata_ui/templates/home.html
validata_ui/templates/home.html
+18
-3
validata_ui/views.py
validata_ui/views.py
+2
-2
No files found.
homepage_config.json.example
View file @
cc96ef18
...
...
@@ -3,11 +3,31 @@
{
"name": "scdl",
"title": "Socle Commun des Données Locales",
"description": "Ces schémas sont portés par OpenDataFrance et respectent un standard de qualité en terme de documentation.",
"catalog": "https://git.opendatafrance.net/scdl/catalog/raw/master/catalog.json"
},
{
"name": "draft",
"title": "Autres schémas",
"description": "Ces schémas ont été identifiés comme proches du SCDL, ils ne sont cependant pas gérés par OpenDataFrance.",
"catalog": {
"version": 1,
"schemas": [
{
"name": "lieux-covoiturage",
"repo_url": "https://github.com/etalab/schema-lieux-covoiturage"
},
{
"name": "decp-dpa",
"repo_url": "https://github.com/etalab/schema-decp-dpa"
}
]
}
},
{
"name": "external",
"title": "Validateurs externes",
"description": "Sélection d'outils de validation de données complémentaires à Validata.",
"links": [
{
"name": "inspire",
...
...
validata_ui/templates/home.html
View file @
cc96ef18
{% extends "base_template.html" %}
{% block head %}
{{ super() }}
<style>
div
.mb-5
h2
.my-4
,
div
.my-5
h2
.my-4
{
margin-bottom
:
0.2em
!important
;
}
</style>
{% endblock %}
{% block title %}Accueil{% endblock %}
{% block content %}
...
...
@@ -8,6 +17,9 @@
{% if section.catalog %}
<div
class=
"mb-5"
>
<h2
class=
"my-4"
>
{{ section.title }}
</h2>
{% if section.description %}
<p
class=
"text-muted"
>
{{ section.description }}
</p>
{% endif %}
</h2>
<form
action=
"{{ url_for('custom_validator') }}"
method=
"GET"
>
<div
class=
"form-row"
>
<div
class=
"form-group col-lg-9"
>
...
...
@@ -28,7 +40,8 @@
{% endfor %}
<div
class=
"my-5"
>
<h2
class=
"my-4"
>
Autre schéma
</h2>
<h2
class=
"my-4"
>
Schéma à la carte
</h2>
<p
class=
"text-muted"
>
Indiquez ici l'URL du schéma que vous souhaitez pour valider un fichier.
</p>
<form
action=
"{{ url_for('custom_validator') }}"
data-cy=
"custom_schema_form"
method=
"GET"
>
<div
class=
"form-row"
>
<div
class=
"form-group col-lg-9"
>
...
...
@@ -57,6 +70,9 @@
{% if section.links %}
<div
class=
"my-5"
>
<h2
class=
"my-4"
>
{{ section.title }}
</h2>
{% if section.description %}
<p
class=
"text-muted"
>
{{ section.description}}
</p>
{% endif %}
<div
class=
"row my-4"
>
{% for item in section.links %}
<div
class=
"col-sm-4 mb-4"
>
...
...
@@ -69,8 +85,7 @@
class=
"btn btn-outline-secondary mt-auto"
>
Utiliser
<i
class=
"fas fa-external-link-alt ml-1"
></i>
</a
>
</a>
</div>
</div>
</div>
...
...
validata_ui/views.py
View file @
cc96ef18
...
...
@@ -437,7 +437,7 @@ def home():
if
not
config
.
HOMEPAGE_CONFIG
:
return
for
section
in
config
.
HOMEPAGE_CONFIG
[
'sections'
]:
home_section
=
{
"name"
:
section
[
'name'
],
"title"
:
section
[
"title"
]
}
home_section
=
{
k
:
v
for
k
,
v
in
section
.
items
()
if
k
!=
'catalog'
}
if
"catalog"
in
section
:
schema_catalog
=
get_schema_catalog
(
section
[
'name'
])
if
schema_catalog
:
...
...
@@ -447,7 +447,7 @@ def home():
table_schema
=
tableschema_from_url
(
schema_reference
.
get_schema_url
())
home_section_catalog
.
append
({
"name"
:
schema_reference
.
name
,
"title"
:
table_schema
.
descriptor
.
get
(
"title"
)
or
schema_reference
.
name
"title"
:
table_schema
.
descriptor
.
get
(
"title"
)
or
schema_reference
.
name
,
})
home_section
[
'catalog'
]
=
home_section_catalog
if
"links"
in
section
:
...
...
Write
Preview
Markdown
is supported
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