Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
035702ae
Commit
035702ae
authored
Oct 13, 2023
by
Thorge Petersen
Browse files
Options
Downloads
Patches
Plain Diff
Contact details snippet
parent
65ebc5cd
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!51
Display contact information on dataset page and use text-ellipsis for long description texts
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ckanext/odsh/templates/package/read.html
+1
-292
1 addition, 292 deletions
ckanext/odsh/templates/package/read.html
ckanext/odsh/templates/package/snippets/contact_details.html
+291
-0
291 additions, 0 deletions
ckanext/odsh/templates/package/snippets/contact_details.html
with
292 additions
and
292 deletions
ckanext/odsh/templates/package/read.html
+
1
−
292
View file @
035702ae
...
...
@@ -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'
>
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/templates/package/snippets/contact_details.html
0 → 100644
+
291
−
0
View file @
035702ae
{% 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment