Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
validata-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Validata
validata-ui
Commits
0239870f
Commit
0239870f
authored
Jun 21, 2019
by
Christophe Benz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If latest tag, display doc_url, else project URL at ref
parent
f0fdc2f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
validata_ui/templates/schema_info_macros.html
validata_ui/templates/schema_info_macros.html
+1
-1
validata_ui/views.py
validata_ui/views.py
+5
-3
No files found.
validata_ui/templates/schema_info_macros.html
View file @
0239870f
...
...
@@ -50,7 +50,7 @@
</a>
{% endif %}
{% if
schema_current_version == 'master'
%}
{% if
doc_url and doc_url != schema_info.homepage
%}
<a
href=
"{{ doc_url }}"
target=
"_blank"
class=
"card-link d-block ml-0"
>
Documentation
</a>
{% endif %}
{% endmacro %}
...
...
validata_ui/views.py
View file @
0239870f
...
...
@@ -74,11 +74,10 @@ class SchemaInstance:
if
schema_reference
is
None
:
abort
(
400
,
"Schéma '{}' non trouvé dans le catalogue de la section '{}'"
.
format
(
self
.
name
,
self
.
section_name
))
self
.
doc_url
=
schema_reference
.
doc_url
if
isinstance
(
schema_reference
,
GitSchemaReference
):
latest_tag
=
schema_reference
.
get_latest_tag
()
if
self
.
ref
is
None
:
schema_ref
=
schema_reference
.
get_latest_tag
()
or
schema_reference
.
get_default_branch
()
schema_ref
=
latest_tag
or
schema_reference
.
get_default_branch
()
abort
(
redirect
(
compute_validation_form_url
({
'schema_name'
:
self
.
schema_and_section_name
,
'schema_ref'
:
schema_ref
.
name
...
...
@@ -87,6 +86,9 @@ class SchemaInstance:
tag_names
=
[
tag
.
name
for
tag
in
self
.
tags
]
self
.
branches
=
[
branch
for
branch
in
schema_reference
.
iter_branches
()
if
branch
.
name
not
in
tag_names
]
self
.
doc_url
=
schema_reference
.
doc_url
\
if
self
.
ref
==
latest_tag
.
name
\
else
schema_reference
.
get_project_url
(
self
.
ref
)
self
.
url
=
schema_reference
.
get_schema_url
(
ref
=
self
.
ref
)
...
...
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