-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libcoveweb2: additional_fields: additional_checks: jsonschema_validat…
…ion: Print JSON values nicer * quote strings * print lists as lists, with longer ones collapsed by default #20 #13 #22
- Loading branch information
1 parent
d00df4e
commit ba98bb3
Showing
7 changed files
with
79 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% load cove_tags %} | ||
|
||
{% if value|get_variable_type == 'str' %} | ||
"{{ value }}" | ||
{% elif value|get_variable_type == 'list' %} | ||
{% if value|length > 5 %} | ||
<ul> | ||
{% for v in value|slice:":5" %} | ||
<li>{% include "libcoveweb2/show_json_value.html" with value=v dont_expand_lists=True %}</li> | ||
{% endfor %} | ||
</ul> | ||
{% show_json_value_more_id as id %} | ||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#{{ id }}" aria-expanded="false" aria-controls="{{ id }}"> | ||
Show/Hide more | ||
</button> | ||
<div class="collapse" id="{{ id }}"> | ||
<ul> | ||
{% for v in value|slice:"5:" %} | ||
<li>{% include "libcoveweb2/show_json_value.html" with value=v dont_expand_lists=True %}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% else %} | ||
<ul> | ||
{% for v in value %} | ||
<li>{% include "libcoveweb2/show_json_value.html" with value=v dont_expand_lists=True %}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% else %} | ||
{{ value }} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters