Skip to content

Commit

Permalink
Add blacklist display to curated contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Aug 8, 2022
1 parent 31d46f9 commit b1e9c98
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/bioregistry/app/templates/context.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ <h5 style="margin: 0"><a href="{{ url_for("ui.contexts") }}">Contexts</a>
<ol>
{% for metaprefix in entry.prefix_priority %}
<li>
<a href="{{ url_for("ui.metaresource", metaprefix=metaprefix) }}">
<code>{{ metaprefix }}</code>
</a>
{{ utils.render_metaprefix(metaprefix) }}
</li>
{% endfor %}
</ol>
Expand All @@ -94,9 +92,7 @@ <h5 style="margin: 0"><a href="{{ url_for("ui.contexts") }}">Contexts</a>
<ol>
{% for metaprefix in entry.uri_prefix_priority %}
<li>
<a href="{{ url_for("ui.metaresource", metaprefix=metaprefix) }}">
<code>{{ metaprefix }}</code>
</a>
{{ utils.render_metaprefix(metaprefix) }}
</li>
{% endfor %}
</ol>
Expand Down Expand Up @@ -128,6 +124,17 @@ <h5 style="margin: 0"><a href="{{ url_for("ui.contexts") }}">Contexts</a>
</dl>
</dd>
{% endif %}
{% if entry.blacklist %}
<dt>Prefix Blacklist</dt>
<dd>
<p>{{ schema.blacklist.description }}</p>
<ul>
{% for blacklist_prefix in entry.blacklist %}
<li>{{ utils.render_prefix(blacklist_prefix) }}</li>
{% endfor %}
</ul>
</dd>
{% endif %}
</dl>
</div>
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/bioregistry/app/templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
<code>{{ bioregistry.curie_to_str(prefix, identifier) }}</code>
{% endmacro %}

{% macro render_prefix(prefix) -%}
<a href="{{ url_for("ui.resource", prefix=prefix) }}">
<code>{{ prefix }}</code>
</a>
{% endmacro %}

{% macro render_metaprefix(metaprefix) -%}
<a href="{{ url_for("ui.metaresource", metaprefix=metaprefix) }}">
<code>{{ metaprefix }}</code>
</a>
{% endmacro %}

{% macro render_resource_warnings(resource) -%}
{% if resource.deprecated %}
<span class="badge badge-warning" style="display: inline-block;">
Expand Down

0 comments on commit b1e9c98

Please sign in to comment.