Skip to content
Snippets Groups Projects
Commit 035702ae authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Contact details snippet

parent 65ebc5cd
Branches
Tags
1 merge request!51Display contact information on dataset page and use text-ellipsis for long description texts
......@@ -148,298 +148,7 @@
{% endblock collection %}
{% block contact %}
{% set author_name = pkg.author %}
{% set author_email = pkg.author_email %}
{% set author_tel = h.odsh_extract_value_from_extras(pkg.extras,'author_tel')%}
{% set author_fax = h.odsh_extract_value_from_extras(pkg.extras,'author_fax')%}
{% set author_city = h.odsh_extract_value_from_extras(pkg.extras,'author_city')%}
{% set author_zip = h.odsh_extract_value_from_extras(pkg.extras,'author_zip')%}
{% set author_street = h.odsh_extract_value_from_extras(pkg.extras,'author_street')%}
{% set author_country = h.odsh_extract_value_from_extras(pkg.extras,'author_country')%}
{% set author_zip = h.odsh_extract_value_from_extras(pkg.extras,'author_zip')%}
{% set maintainer_name = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_name')%}
{% set maintainer_email = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_email')%}
{% set maintainer_tel = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_tel')%}
{% set maintainer_fax = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_fax')%}
{% set maintainer_city = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_city')%}
{% set maintainer_zip = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_zip')%}
{% set maintainer_street = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_street')%}
{% set maintainer_country = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_country')%}
{% set maintainer_zip = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_zip')%}
{% set contact_name = h.odsh_extract_value_from_extras(pkg.extras,'contact_name')%}
{% set contact_email = h.odsh_extract_value_from_extras(pkg.extras,'contact_email')%}
{% set contact_tel = h.odsh_extract_value_from_extras(pkg.extras,'contact_tel')%}
{% set contact_fax = h.odsh_extract_value_from_extras(pkg.extras,'contact_fax')%}
{% set contact_city = h.odsh_extract_value_from_extras(pkg.extras,'contact_city')%}
{% set contact_zip = h.odsh_extract_value_from_extras(pkg.extras,'contact_zip')%}
{% set contact_street = h.odsh_extract_value_from_extras(pkg.extras,'contact_street')%}
{% set contact_country = h.odsh_extract_value_from_extras(pkg.extras,'contact_country')%}
{% set contact_zip = h.odsh_extract_value_from_extras(pkg.extras,'contact_zip')%}
{% set publisher_name = h.odsh_extract_value_from_extras(pkg.extras,'publisher_name')%}
{% set publisher_email = h.odsh_extract_value_from_extras(pkg.extras,'publisher_email')%}
{% set publisher_tel = h.odsh_extract_value_from_extras(pkg.extras,'publisher_tel')%}
{% set publisher_fax = h.odsh_extract_value_from_extras(pkg.extras,'publisher_fax')%}
{% set publisher_city = h.odsh_extract_value_from_extras(pkg.extras,'publisher_city')%}
{% set publisher_zip = h.odsh_extract_value_from_extras(pkg.extras,'publisher_zip')%}
{% set publisher_street = h.odsh_extract_value_from_extras(pkg.extras,'publisher_street')%}
{% set publisher_country = h.odsh_extract_value_from_extras(pkg.extras,'publisher_country')%}
{% set publisher_zip = h.odsh_extract_value_from_extras(pkg.extras,'publisher_zip')%}
{% if pkg.author or maintainer_name or contact_name or publisher_name %}
<div class="section">
<h3>{{ _('Contact') }}</h3>
{% if author_name %}
<div class="sub-section">
<h5>{{ _('Creator') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span property="dc:creator">{{ author_name }}</span>
</p>
{% if author_street %}
<p>
{% if author_street %}
{{ author_street }}
<br>
{% endif %}
{% if author_zip and author_city %}
{{ author_zip }}
{{ author_city }}
<br>
{% endif %}
{% if author_country %}
{{ author_country }}
{% endif %}
</p>
{% endif %}
{% if author_email or author_tel or author_fax %}
<div class="details">
{% if author_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ author_email }}">
{{ author_email }}
</a>
</div>
{% endif %}
{% if author_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ author_tel }}">
{{ author_tel }}
</a>
</div>
{% endif %}
{% if author_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ author_fax }}">
{{ author_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% if publisher_name %}
<div class="sub-section">
<h5>{{ _('Publisher') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span property="dc:publisher">{{ publisher_name }}</span>
</p>
{% if publisher_street %}
<p>
{% if publisher_street %}
{{ publisher_street }}
<br>
{% endif %}
{% if publisher_zip and publisher_city %}
{{ publisher_zip }}
{{ publisher_city }}
<br>
{% endif %}
{% if publisher_country %}
{{ publisher_country }}
{% endif %}
</p>
{% endif %}
{% if publisher_email or publisher_tel or publisher_fax %}
<div class="details">
{% if publisher_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ publisher_email }}">
{{ publisher_email }}
</a>
</div>
{% endif %}
{% if publisher_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ publisher_tel }}">
{{ publisher_tel }}
</a>
</div>
{% endif %}
{% if publisher_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ publisher_fax }}">
{{ publisher_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% if contact_name %}
<div class="sub-section">
<h5>{{ _('Contact person') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span>{{ contact_name }}</span>
</p>
{% if contact_street %}
<p>
{% if contact_street %}
{{ contact_street }}
<br>
{% endif %}
{% if contact_zip and contact_city %}
{{ contact_zip }}
{{ contact_city }}
<br>
{% endif %}
{% if contact_country %}
{{ contact_country }}
{% endif %}
</p>
{% endif %}
{% if contact_email or contact_tel or contact_fax %}
<div class="details">
{% if contact_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ contact_email }}">
{{ contact_email }}
</a>
</div>
{% endif %}
{% if contact_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ contact_tel }}">
{{ contact_tel }}
</a>
</div>
{% endif %}
{% if contact_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ contact_fax }}">
{{ contact_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% if maintainer_name %}
<div class="sub-section">
<h5>{{ _('Maintainer') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span property="dc:maintainer">{{ maintainer_name }}</span>
</p>
{% if maintainer_street %}
<p>
{% if maintainer_street %}
{{ maintainer_street }}
<br>
{% endif %}
{% if maintainer_zip and maintainer_city %}
{{ maintainer_zip }}
{{ maintainer_city }}
<br>
{% endif %}
{% if maintainer_country %}
{{ maintainer_country }}
{% endif %}
</p>
{% endif %}
{% if maintainer_email or maintainer_tel or maintainer_fax %}
<div class="details">
{% if maintainer_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ maintainer_email }}">
{{ maintainer_email }}
</a>
</div>
{% endif %}
{% if maintainer_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ maintainer_tel }}">
{{ maintainer_tel }}
</a>
</div>
{% endif %}
{% if maintainer_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ maintainer_fax }}">
{{ maintainer_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
{% endif %}
{% snippet "package/snippets/contact_details.html", pkg=pkg %}
{% endblock contact %}
<div class='tag-container'>
......
{% set author_name = pkg.author %}
{% set author_email = h.extract_email(pkg.author_email) %}
{% set author_tel = h.odsh_extract_value_from_extras(pkg.extras,'author_tel')%}
{% set author_fax = h.odsh_extract_value_from_extras(pkg.extras,'author_fax')%}
{% set author_city = h.odsh_extract_value_from_extras(pkg.extras,'author_city')%}
{% set author_zip = h.odsh_extract_value_from_extras(pkg.extras,'author_zip')%}
{% set author_street = h.odsh_extract_value_from_extras(pkg.extras,'author_street')%}
{% set author_country = h.odsh_extract_value_from_extras(pkg.extras,'author_country')%}
{% set author_zip = h.odsh_extract_value_from_extras(pkg.extras,'author_zip')%}
{% set maintainer_name = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_name')%}
{% set maintainer_email = h.extract_email(h.odsh_extract_value_from_extras(pkg.extras,'maintainer_email'))%}
{% set maintainer_tel = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_tel')%}
{% set maintainer_fax = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_fax')%}
{% set maintainer_city = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_city')%}
{% set maintainer_zip = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_zip')%}
{% set maintainer_street = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_street')%}
{% set maintainer_country = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_country')%}
{% set maintainer_zip = h.odsh_extract_value_from_extras(pkg.extras,'maintainer_zip')%}
{% set contact_name = h.odsh_extract_value_from_extras(pkg.extras,'contact_name')%}
{% set contact_email = h.extract_email(h.odsh_extract_value_from_extras(pkg.extras,'contact_email'))%}
{% set contact_tel = h.odsh_extract_value_from_extras(pkg.extras,'contact_tel')%}
{% set contact_fax = h.odsh_extract_value_from_extras(pkg.extras,'contact_fax')%}
{% set contact_city = h.odsh_extract_value_from_extras(pkg.extras,'contact_city')%}
{% set contact_zip = h.odsh_extract_value_from_extras(pkg.extras,'contact_zip')%}
{% set contact_street = h.odsh_extract_value_from_extras(pkg.extras,'contact_street')%}
{% set contact_country = h.odsh_extract_value_from_extras(pkg.extras,'contact_country')%}
{% set contact_zip = h.odsh_extract_value_from_extras(pkg.extras,'contact_zip')%}
{% set publisher_name = h.odsh_extract_value_from_extras(pkg.extras,'publisher_name')%}
{% set publisher_email = h.extract_email(h.odsh_extract_value_from_extras(pkg.extras,'publisher_email'))%}
{% set publisher_tel = h.odsh_extract_value_from_extras(pkg.extras,'publisher_tel')%}
{% set publisher_fax = h.odsh_extract_value_from_extras(pkg.extras,'publisher_fax')%}
{% set publisher_city = h.odsh_extract_value_from_extras(pkg.extras,'publisher_city')%}
{% set publisher_zip = h.odsh_extract_value_from_extras(pkg.extras,'publisher_zip')%}
{% set publisher_street = h.odsh_extract_value_from_extras(pkg.extras,'publisher_street')%}
{% set publisher_country = h.odsh_extract_value_from_extras(pkg.extras,'publisher_country')%}
{% set publisher_zip = h.odsh_extract_value_from_extras(pkg.extras,'publisher_zip')%}
{% if pkg.author or maintainer_name or contact_name or publisher_name %}
<div class="section">
<h3>{{ _('Contact') }}</h3>
{% if author_name %}
<div class="sub-section">
<h5>{{ _('Creator') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span property="dc:creator">{{ author_name }}</span>
</p>
{% if author_street %}
<p>
{% if author_street %}
{{ author_street }}
<br>
{% endif %}
{% if author_zip and author_city %}
{{ author_zip }}
{{ author_city }}
<br>
{% endif %}
{% if author_country %}
{{ author_country }}
{% endif %}
</p>
{% endif %}
{% if author_email or author_tel or author_fax %}
<div class="details">
{% if author_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ author_email }}">
{{ author_email }}
</a>
</div>
{% endif %}
{% if author_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ author_tel }}">
{{ author_tel }}
</a>
</div>
{% endif %}
{% if author_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ author_fax }}">
{{ author_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% if publisher_name %}
<div class="sub-section">
<h5>{{ _('Publisher') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span property="dc:publisher">{{ publisher_name }}</span>
</p>
{% if publisher_street %}
<p>
{% if publisher_street %}
{{ publisher_street }}
<br>
{% endif %}
{% if publisher_zip and publisher_city %}
{{ publisher_zip }}
{{ publisher_city }}
<br>
{% endif %}
{% if publisher_country %}
{{ publisher_country }}
{% endif %}
</p>
{% endif %}
{% if publisher_email or publisher_tel or publisher_fax %}
<div class="details">
{% if publisher_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ publisher_email }}">
{{ publisher_email }}
</a>
</div>
{% endif %}
{% if publisher_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ publisher_tel }}">
{{ publisher_tel }}
</a>
</div>
{% endif %}
{% if publisher_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ publisher_fax }}">
{{ publisher_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% if contact_name %}
<div class="sub-section">
<h5>{{ _('Contact Person') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span>{{ contact_name }}</span>
</p>
{% if contact_street %}
<p>
{% if contact_street %}
{{ contact_street }}
<br>
{% endif %}
{% if contact_zip and contact_city %}
{{ contact_zip }}
{{ contact_city }}
<br>
{% endif %}
{% if contact_country %}
{{ contact_country }}
{% endif %}
</p>
{% endif %}
{% if contact_email or contact_tel or contact_fax %}
<div class="details">
{% if contact_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ contact_email }}">
{{ contact_email }}
</a>
</div>
{% endif %}
{% if contact_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ contact_tel }}">
{{ contact_tel }}
</a>
</div>
{% endif %}
{% if contact_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ contact_fax }}">
{{ contact_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% if maintainer_name %}
<div class="sub-section">
<h5>{{ _('Maintainer') }}</h5>
<table class="table table-striped">
<tbody>
<tr>
<td>
<p>
<span property="dc:maintainer">{{ maintainer_name }}</span>
</p>
{% if maintainer_street %}
<p>
{% if maintainer_street %}
{{ maintainer_street }}
<br>
{% endif %}
{% if maintainer_zip and maintainer_city %}
{{ maintainer_zip }}
{{ maintainer_city }}
<br>
{% endif %}
{% if maintainer_country %}
{{ maintainer_country }}
{% endif %}
</p>
{% endif %}
{% if maintainer_email or maintainer_tel or maintainer_fax %}
<div class="details">
{% if maintainer_email %}
<div class="details-item">
<i class="fa-solid fa-envelope"></i>
<a href="mailto:{{ maintainer_email }}">
{{ maintainer_email }}
</a>
</div>
{% endif %}
{% if maintainer_tel %}
<div class="details-item">
<i class="fa-solid fa-phone"></i>
<a href="tel:{{ maintainer_tel }}">
{{ maintainer_tel }}
</a>
</div>
{% endif %}
{% if maintainer_fax %}
<div class="details-item">
<i class="fa-solid fa-fax"></i>
<a href="fax:{{ maintainer_fax }}">
{{ maintainer_fax }}
</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
{% endif %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment