Skip to content

Commit

Permalink
Fixing tiny things on displays. Good
Browse files Browse the repository at this point in the history
@alliomeria this is not including yet all your new elements from the forms. But its a step forward. We may want to do more here for RC2!
  • Loading branch information
DiegoPino committed Dec 31, 2020
1 parent b6db120 commit 0cbd2fb
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 55 deletions.
2 changes: 1 addition & 1 deletion d8content/metadatadisplay_entity_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "bde1cb38-e1b8-4f2d-bc1c-bff646d2e8b7",
"attributes": {
"name": "Object Description",
"twig": "<blockquote class=\"blockquote\">\n{% if node.id %}\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\n{% else %}\n {% set nodeurl = '<current>' ~ '\/iiif\/manifest' %}\n{% endif%}\n {% if attribute(data, 'ismemberof') %}\n {% if attribute(data, 'ismemberof') is iterable %}\n {% for collection in attribute(data, 'ismemberof')%}\n {% set parentnode = bamboo_load_entity('node', collection) %}\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\n <footer class=\"blockquote-footer\">In <cite title=\"{{ parentnode.title.value }}\"><a href=\"{{ parentnodeurl }}\">{{ parentnode.title.value }}<\/a><\/cite><\/footer>\n{% endfor %}\n{% else %}\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\n<footer class=\"blockquote-footer\">In <cite title=\"{{ parentnode.title.value }}\"><a href=\"{{ parentnodeurl }}\">{{ parentnode.title.value }}<\/a><\/cite><\/footer>\n{% endif %}\n{% endif %}\n<\/blockquote>\n <h2>Title<\/h2>\n <p>{{ data.label }}<\/p>\n <h2>Description<\/h2>\n <p>{{ data.description }}<\/p>\n <h2>Type of Resource<\/h2>\n <p>{{ data.type }}<\/p>\n <h2>Author(s)<\/h2>\n <p>\n <name type=\"personal\">\n \t{% for people in attribute(data, 'agent_author') %}\n \t\t<namePart>{{ people.name_label|escape('html_attr') }}<\/namePart><br>\n \t{% endfor %} \n <\/name>\n <\/p>\n <h2>Description<\/h2>\n <p>{{ data.description }}<\/p>\n <h2>Date Published<\/h2>\n <p>{{ data.date_published }}<\/p> \n{% if logged_in %}\n <h2>Local Identifier<\/h2>\n <p>{{ data.local_identifier }}<\/p>\n{% endif %}\n{% if attribute(data, 'as:image')|length > 0 or attribute(data, 'as:document')|length > 0 %}\n<h2><span class=\"align-middle\">Direct Link to Digital Object's IIIF Presentation Manifest V3 <\/span><img src=\"https:\/\/iiif.io\/img\/logo-iiif-34x30.png\"><\/h2>\n{% set iiifmanifest = nodeurl|render ~ \"\/metadata\/iiifmanifest\/default.jsonld\" %}\n<ul><li>\n<input type=\"text\" value=\"{{ iiifmanifest }}\" id=\"iiifmanifest_copy\" size=\"{{ iiifmanifest|length }}\" class=\"col-xs-3\">\n<\/li><\/ul>\n{% endif %}\n\n{% if attribute(data, 'as:document') %}\n<h2>Files<\/h2>\n<ul>\n{% for document in attribute(data, 'as:document') %}\n <li><a download href=\"\/do\/{{ node.id }}\/iiif\/{{ document['dr:uuid'] }}\/full\/full\/0\/{{ document.name }}\" target=\"_blank\">Download {{ document.name }}<\/a><\/li>\n{% endfor %}\n<\/ul>\n{% endif %}\n{% if attribute(data, 'as:images') %}\n<h2>Images<\/h2>\n<ul>\n{% for document in attribute(data, 'as:images') %}\n <li><a download href=\"\/do\/{{ node.id }}\/iiif\/{{ document['dr:uuid'] }}\/full\/full\/0\/{{ document.name }}\" target=\"_blank\">Download {{ document.name }}<\/a><\/li>\n{% endfor %}\n<\/ul>\n{% endif %}\n<h2>Rights Statements<\/h2>\n<a href=\"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\">In Copyright - Educational Use Permitted<\/a>\n\n",
"twig": "<blockquote class=\"blockquote\">\n{% if node.id %}\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\n{% else %}\n {% set nodeurl = '<current>' ~ '\/iiif\/manifest' %}\n{% endif%}\n {% if attribute(data, 'ismemberof') %}\n {% if attribute(data, 'ismemberof') is iterable %}\n {% for collection in attribute(data, 'ismemberof')%}\n {% set parentnode = bamboo_load_entity('node', collection) %}\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\n <footer class=\"blockquote-footer\">In <cite title=\"{{ parentnode.title.value }}\"><a href=\"{{ parentnodeurl }}\">{{ parentnode.title.value }}<\/a><\/cite><\/footer>\n{% endfor %}\n{% else %}\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\n<footer class=\"blockquote-footer\">In <cite title=\"{{ parentnode.title.value }}\"><a href=\"{{ parentnodeurl }}\">{{ parentnode.title.value }}<\/a><\/cite><\/footer>\n{% endif %}\n{% endif %}\n<\/blockquote>\n <h2>Title<\/h2>\n <p>{{ data.label }}<\/p>\n {% if data.creator|length > 0 %}\n <h2>Creator(s)<\/h2>\n <p>\n {% if data.creator %}\n {% if data.creator is iterable %}\n {% for creator in data.creator %}\n {{ creator }} <br>\n {% endfor %}\n {% else %}\n {{ data.creator }} <br>\n {% endif %} \n {% endif %}\n {% endif %} \n <h2>Description<\/h2>\n <p>\n {% if data.description %}\n {% if data.description is iterable %}\n {% for description in data.description %}\n {{ description }} <br>\n {% endfor %}\n {% else %}\n {{ data.description }} <br>\n {% endif %} \n {% endif %}\n <\/p>\n {% if data.date_original|length > 0 %}\n <h2>Date (of Original)<\/h2>\n <p>{{ data.date_original }}<\/p>\n {% endif %}\n {% if data.publisher|length > 0 %}\n <h2>Publisher<\/h2>\n <p>{{ data.publisher }}<\/p>\n {% endif %} \n <h2>Rights<\/h2>\n <p>{{ data.rights }}<\/p>\n <p>\n <a href=\"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\"><img src=\"https:\/\/rightsstatements.org\/files\/buttons\/InC-EDU.white.svg\" title=\"In Copyright - Educational Use Permitted\" style=\"max-width:200px;height:auto;background-color:pink ;padding:1em\"><\/a>\n <\/p>\n{% if logged_in %}\n <h2>Type of Resource<\/h2>\n <p>{{ data.type }}<\/p>\n <h2>Language<\/h2>\n <p>\n {% if data.language %}\n {% if data.language is iterable %}\n {% for language in data.language %}\n {{ language }} <br>\n {% endfor %}\n {% else %}\n {{ data.language }} <br>\n {% endif %} \n {% endif %}\n <\/p> \n <h2>Date (of Digital)<\/h2>\n <p>{{ data.date_digital }}<\/p> \n <h2>Institutional Owner<\/h2>\n <p>{{ data.owner }}<\/p>\n <h2>Identifier<\/h2>\n <p>{{ data.local_identifier }}<\/p>\n{% endif %}\n\n<p>\n{% if attribute(data, 'as:document') %}\n<h2>Files referenced in this Digital Object<\/h2>\n<ul>\n{% for document in attribute(data, 'as:document') %}\n<li><a download href=\"\/do\/{{ node.id }}\/iiif\/{{ document['dr:uuid'] }}\/full\/full\/0\/{{ document.name }}\" target=\"_blank\">Download {{ document.name }}<\/a><\/li>\n{% endfor %}\n<\/ul>\n{% endif %}\n{% if attribute(data, 'as:image') %}\n<h2>Images in this Digital Object<\/h2>\n<ul>\n{% for singleimage in attribute(data, 'as:image') %}\n<li><a href=\"\/do\/{{ node.id }}\/iiif\/{{ singleimage['dr:uuid'] }}\/full\/full\/0\/{{ singleimage.name }}\" target=\"_blank\">Download Image {{ singleimage.name }}<\/a><\/li>\n{% endfor %}\n<\/ul>\n{% endif %}\n<p>\n{% if attribute(data, 'as:image')|length > 0 or attribute(data, 'as:document')|length > 0 %}\n<h2><span class=\"align-middle\">Direct Link to Digital Object's IIIF Presentation Manifest V3 <\/span><img src=\"https:\/\/iiif.io\/img\/logo-iiif-34x30.png\"><\/h2>\n{% set iiifmanifest = nodeurl|render ~ \"\/metadata\/iiifmanifest\/default.jsonld\" %}\n<input type=\"text\" value=\"{{ iiifmanifest }}\" id=\"iiifmanifest_copy\" size=\"{{ iiifmanifest|length }}\" class=\"col-xs-3\">\n{% endif %}",
"langcode": "und",
"mimetype": "text/html"
}
Expand Down
2 changes: 1 addition & 1 deletion d8content/metadatadisplay_entity_02.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "998d30c0-57b7-4219-bcff-6ac2c0bf6563",
"attributes": {
"name": "Linked Data",
"twig": "{% if data.subject_wikidata|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-3\" text-truncate\">Wikidata subjects<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n{% for subjects in attribute(data, 'subject_wikidata') %}\n<ul class=\"nav nav-pills\" style=\"padding-top: 3px\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"\/search?search_api_fulltext=&sort_by=changed&sort_order=DESC&items_per_page=25&f%5B0%5D=descriptive_metadata_subjects%3A{{ subjects.label }}\" target=\"_blank\" >{{ subjects.label }}<\/a>\n <\/li>\n <li class=\"nav-item\">\n <a class=\"nav-link active\" href=\"{{ subjects.uri }}\" target=\"_blank\" >Wikidata<\/a>\n <\/li>\n <\/ul>\n{% endfor %}\n<\/dd>\n<\/dl>\n{% endif %} \n{% if data.term_aat_getty|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-3\" text-truncate\">Getty terms<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n<div class=\"list-group\">\n {% if data.term_aat_getty.uri is defined %}\n<a href=\"{{ data.term_aat_getty.uri }}\" target=\"_blank\" > {{ data.term_aat_getty.label }}<\/a>\n {% else %}\n {% if data.term_aat_getty is iterable %}\n {% for getty_subjects in attribute(data, 'term_aat_getty') %}\n<a href=\"{{ getty_subjects.uri }}\" target=\"_blank\" > {{ getty_subjects.label }}<\/a>\n {% endfor %}\n {% endif %}\n {% endif %}\n<\/div>\n<\/dd>\n<\/dl>\n{% endif %}\n{% if data.subject_loc|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-3\" text-truncate\">Library Of Congress subjects<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n<div class=\"list-group\">\n{% for subjects in attribute(data, 'subject_loc') %}\n<a href=\"{{ subjects.uri }}\" target=\"_blank\" > {{ subjects.label }}<\/a>\n{% endfor %}\n<\/div>\n<\/dd>\n<\/dl>\n{% endif %}\n{% if data.edm_agent|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-3\" text-truncate\">Wikidata Agents<\/dt>\n<dd class=\"col-sm-9\" text-truncate\">\n<div class=\"list-group\">\n{# \n\"edm_agent\": [\n {\n \"name_uri\": \"http:\\\/\\\/www.wikidata.org\\\/entity\\\/Q15253272\",\n \"role_uri\": \"http:\\\/\\\/www.wikidata.org\\\/entity\\\/Q483501\",\n \"name_label\": \"Metropolitan New York Library Council \",\n \"role_label\": \"artist \"\n }\n ],\n#}\n{% for agent in attribute(data, 'edm_agent') %}\n<a href=\"{{ agent.role_uri }}\" target=\"_blank\" > {{ agent.role_label }}<\/a>:\n{% if agent.name_uri|default is not empty %}\n<a href=\"{{ agent.name_uri }}\" target=\"_blank\" > {{ agent.name_label }}<\/a>\n{% else %}\n{{ agent.name_label }}\n{% endif %}\n{% endfor %}\n<\/div>\n<\/dd>\n<\/dl>\n{% endif %}",
"twig": "{% if data.subject_wikidata|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-12\" text-truncate\">Wikidata terms<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n{% for subjects in attribute(data, 'subject_wikidata') %}\n<ul class=\"nav nav-pills\" style=\"padding-top:3px\">\n <li class=\"nav-item\" style=\"padding:3px;margin-top:4px;\">\n <a href=\"\/search?search_api_fulltext=&sort_by=changed&sort_order=DESC&items_per_page=25&f%5B0%5D=descriptive_metadata_subjects%3A{{ subjects.label }}\" target=\"_blank\" >{{ subjects.label }}<\/a>\n <\/li>\n <li class=\"nav-item\">\n <a class=\"nav-link active\" href=\"{{ subjects.uri }}\" target=\"_blank\" >Wikidata<\/a>\n <\/li>\n <\/ul>\n{% endfor %}\n<\/dd>\n<\/dl>\n{% endif %} \n{% if data.term_aat_getty|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-12\" text-truncate\">Getty terms<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n<div class=\"list-group\">\n {% if data.term_aat_getty.uri is defined %}\n<a href=\"{{ data.term_aat_getty.uri }}\" target=\"_blank\" >{{ data.term_aat_getty.label }}<\/a>\n {% else %}\n {% if data.term_aat_getty is iterable %}\n {% for getty_subjects in attribute(data, 'term_aat_getty') %}\n<a href=\"{{ getty_subjects.uri }}\" target=\"_blank\" >{{ getty_subjects.label }}<\/a>\n {% endfor %}\n {% endif %}\n {% endif %}\n<\/div>\n<\/dd>\n<\/dl>\n{% endif %}\n{% if data.subject_loc|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-12\" text-truncate\">Library Of Congress subjects<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n<div class=\"list-group\">\n{% for subjects in attribute(data, 'subject_loc') %}\n<a href=\"{{ subjects.uri }}\" target=\"_blank\" >{{ subjects.label }}<\/a>\n{% endfor %}\n<\/div>\n<\/dd>\n<\/dl>\n{% endif %}\n{% if data.edm_agent|length > 1 %}\n<dl class=\"row\">\n<dt class=\"col-sm-12\" text-truncate\">Wikidata Agents<\/dt>\n<\/dl>\n<dl class=\"row\">\n<dd class=\"col-sm-12\" text-truncate\">\n<div class=\"list-group\">\n{% for agent in attribute(data, 'edm_agent') %}\n<dl class=\"row\">\n<dd class=\"col-sm-8\" text-truncate\">\n{% if agent.name_uri|default is not empty %}\n<a href=\"{{ agent.name_uri }}\" target=\"_blank\" >{{ agent.name_label }}<\/a>\n{% else %}\n{{ agent.name_label }}\n{% endif %}\n:\n<\/dd>\n<dd class=\"col-sm-4\" text-truncate\">\n{% if agent.role_uri|default is not empty %}\n<a href=\"{{ agent.role_uri }}\" target=\"_blank\" >{{ agent.role_label }}<\/a>\n{% else %}\n{{ agent.role_label }}\n{% endif %}\n<\/dd>\n<\/dl>\n{% endfor %}\n<\/div>\n<\/dd>\n<\/dl>\n{% endif %}",
"langcode": "und",
"mimetype": "text/html"
}
Expand Down
49 changes: 26 additions & 23 deletions d8content/metadatadisplays/linked_data.twig.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% if data.subject_wikidata|length > 1 %}
<dl class="row">
<dt class="col-sm-3" text-truncate">Wikidata subjects</dt>
<dt class="col-sm-12" text-truncate">Wikidata terms</dt>
</dl>
<dl class="row">
<dd class="col-sm-12" text-truncate">
{% for subjects in attribute(data, 'subject_wikidata') %}
<ul class="nav nav-pills" style="padding-top: 3px">
<li class="nav-item">
<a class="nav-link" href="/search?search_api_fulltext=&sort_by=changed&sort_order=DESC&items_per_page=25&f%5B0%5D=descriptive_metadata_subjects%3A{{ subjects.label }}" target="_blank" >{{ subjects.label }}</a>
<ul class="nav nav-pills" style="padding-top:3px">
<li class="nav-item" style="padding:3px;margin-top:4px;">
<a href="/search?search_api_fulltext=&sort_by=changed&sort_order=DESC&items_per_page=25&f%5B0%5D=descriptive_metadata_subjects%3A{{ subjects.label }}" target="_blank" >{{ subjects.label }}</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="{{ subjects.uri }}" target="_blank" >Wikidata</a>
Expand All @@ -19,17 +19,17 @@
{% endif %}
{% if data.term_aat_getty|length > 1 %}
<dl class="row">
<dt class="col-sm-3" text-truncate">Getty terms</dt>
<dt class="col-sm-12" text-truncate">Getty terms</dt>
</dl>
<dl class="row">
<dd class="col-sm-12" text-truncate">
<div class="list-group">
{% if data.term_aat_getty.uri is defined %}
<a href="{{ data.term_aat_getty.uri }}" target="_blank" > {{ data.term_aat_getty.label }}</a>
<a href="{{ data.term_aat_getty.uri }}" target="_blank" >{{ data.term_aat_getty.label }}</a>
{% else %}
{% if data.term_aat_getty is iterable %}
{% for getty_subjects in attribute(data, 'term_aat_getty') %}
<a href="{{ getty_subjects.uri }}" target="_blank" > {{ getty_subjects.label }}</a>
<a href="{{ getty_subjects.uri }}" target="_blank" >{{ getty_subjects.label }}</a>
{% endfor %}
{% endif %}
{% endif %}
Expand All @@ -39,40 +39,43 @@
{% endif %}
{% if data.subject_loc|length > 1 %}
<dl class="row">
<dt class="col-sm-3" text-truncate">Library Of Congress subjects</dt>
<dt class="col-sm-12" text-truncate">Library Of Congress subjects</dt>
</dl>
<dl class="row">
<dd class="col-sm-12" text-truncate">
<div class="list-group">
{% for subjects in attribute(data, 'subject_loc') %}
<a href="{{ subjects.uri }}" target="_blank" > {{ subjects.label }}</a>
<a href="{{ subjects.uri }}" target="_blank" >{{ subjects.label }}</a>
{% endfor %}
</div>
</dd>
</dl>
{% endif %}
{% if data.edm_agent|length > 1 %}
<dl class="row">
<dt class="col-sm-3" text-truncate">Wikidata Agents</dt>
<dd class="col-sm-9" text-truncate">
<dt class="col-sm-12" text-truncate">Wikidata Agents</dt>
</dl>
<dl class="row">
<dd class="col-sm-12" text-truncate">
<div class="list-group">
{#
"edm_agent": [
{
"name_uri": "http:\/\/www.wikidata.org\/entity\/Q15253272",
"role_uri": "http:\/\/www.wikidata.org\/entity\/Q483501",
"name_label": "Metropolitan New York Library Council ",
"role_label": "artist "
}
],
#}
{% for agent in attribute(data, 'edm_agent') %}
<a href="{{ agent.role_uri }}" target="_blank" > {{ agent.role_label }}</a>:
<dl class="row">
<dd class="col-sm-8" text-truncate">
{% if agent.name_uri|default is not empty %}
<a href="{{ agent.name_uri }}" target="_blank" > {{ agent.name_label }}</a>
<a href="{{ agent.name_uri }}" target="_blank" >{{ agent.name_label }}</a>
{% else %}
{{ agent.name_label }}
{% endif %}
:
</dd>
<dd class="col-sm-4" text-truncate">
{% if agent.role_uri|default is not empty %}
<a href="{{ agent.role_uri }}" target="_blank" >{{ agent.role_label }}</a>
{% else %}
{{ agent.role_label }}
{% endif %}
</dd>
</dl>
{% endfor %}
</div>
</dd>
Expand Down
Loading

0 comments on commit 0cbd2fb

Please sign in to comment.