Skip to content

Commit

Permalink
Merge pull request #112 from mjanez/develop
Browse files Browse the repository at this point in the history
Improve metadata fields truncation
  • Loading branch information
mjanez authored Nov 11, 2024
2 parents f628b9c + 7e6d3fb commit 12bbf83
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 2 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
<!-- insertion marker -->
## Unreleased

<small>[Compare with latest](https://github.com/mjanez/ckanext-scheming_dcat/compare/v4.2.1...HEAD)</small>
<small>[Compare with latest](https://github.com/mjanez/ckanext-scheming_dcat/compare/v4.2.2...HEAD)</small>

<!-- insertion marker -->
## [v4.2.2](https://github.com/mjanez/ckanext-scheming_dcat/releases/tag/v4.2.2) - 2024-11-11

<small>[Compare with v4.2.1](https://github.com/mjanez/ckanext-scheming_dcat/compare/v4.2.1...v4.2.2)</small>

### Added

- Add text truncation styles for links, texts, and lists in metadata/resource info ([a48f239](https://github.com/mjanez/ckanext-scheming_dcat/commit/a48f23925ab131d0359156fbe13842e506da48a4) by mjanez).
- Add informational message for sysadmin users managing harvest sources and improve README ([6392811](https://github.com/mjanez/ckanext-scheming_dcat/commit/6392811c60f4758634340695562aa9c5004662eb) by mjanez).
- Add text truncation styles for dataset/resource metadata display ([e09c8c6](https://github.com/mjanez/ckanext-scheming_dcat/commit/e09c8c6664158441772d4f6d923d7c2df956a20d) by mjanez).


<!-- insertion marker -->
## [v4.2.1](https://github.com/mjanez/ckanext-scheming_dcat/releases/tag/v4.2.1) - 2024-11-04
Expand All @@ -24,6 +36,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Fix org label breadcrumb navigation ([ead4bfc](https://github.com/mjanez/ckanext-scheming_dcat/commit/ead4bfc79068d6a63a748bbe6bd8b6a9681f7795) by mjanez).
- Fix DCAT_AP_HVD_CATEGORY_LEGISLATION duplicates bug ([df062da](https://github.com/mjanez/ckanext-scheming_dcat/commit/df062da16832f6e81f8e56424c15f3e742c573ca) by mjanez).
- Fix data attributes for purge action (admin/trash.html) ([73311ba](https://github.com/mjanez/ckanext-scheming_dcat/commit/73311ba6f5be10e74acde1a5ca53e8f203cafb6b) by mjanez).
- Fix access_rights, maintainer and author field bugs ([ef1f26c](https://github.com/mjanez/ckanext-scheming_dcat/commit/ef1f26cdc7c9cdc1e3275214d6dda0522fa1d1b7) by mjanez).
- Fix dataset_id_field assignment in SchemingDCATXLSHarvester configuration ([1705773](https://github.com/mjanez/ckanext-scheming_dcat/commit/1705773a9a0e3e35b67f23eb3867bc0f95aa6e2b) by mjanez).
- Fix validators for dataset privacy settings (private) ([7b86e3c](https://github.com/mjanez/ckanext-scheming_dcat/commit/7b86e3cc02a0a4bf409a29ed49ff5930679ab44e) by mjanez).
Expand All @@ -34,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Removed old logic.py ([8de31b9](https://github.com/mjanez/ckanext-scheming_dcat/commit/8de31b94efc0602336cfb59952b28f82b7df13f0) by mjanez).

<!-- insertion marker -->
## [v4.2.0](https://github.com/mjanez/ckanext-scheming_dcat/releases/tag/v4.2.0) - 2024-10-17

<small>[Compare with v4.1.0](https://github.com/mjanez/ckanext-scheming_dcat/compare/v4.1.0...v4.2.0)</small>
Expand Down
9 changes: 8 additions & 1 deletion ckanext/schemingdcat/assets/css/schemingdcat.css
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ img.spatial_uri-icon {
vertical-align: middle;
}

/* Rows dataset/resource metadata */
/* Truncate Rows dataset/resource metadata */
.truncate-text {
white-space: nowrap;
overflow: hidden;
Expand All @@ -970,6 +970,13 @@ img.spatial_uri-icon {
vertical-align: middle;
}

.truncate-td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}

/* Links list*/
.link-list {
list-style-type: "🔗 ";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<section class="additional-info">
<h3>{{ _('Additional Info') }}</h3>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">{{ _('Field') }}</th>
<th scope="col">{{ _('Value') }}</th>
</tr>
</thead>
<tbody>
{% block package_additional_info %}
{% if pkg_dict.url %}
<tr>
<th scope="row" class="dataset-label">{{ _('Source') }}</th>
{% if h.is_url(pkg_dict.url) %}
<td class="dataset-details" property="foaf:homepage">
<a href="{{ pkg_dict.url }}" rel="foaf:homepage" target="_blank" class="truncate-link">
{{ pkg_dict.url }}
</a>
</td>
{% else %}
<td class="dataset-details" property="foaf:homepage">{{ pkg_dict.url }}</td>
{% endif %}
</tr>
{% endif %}

{% if pkg_dict.author_email %}
<tr>
<th scope="row" class="dataset-label">{{ _("Author") }}</th>
<td class="dataset-details" property="dc:creator">{{ h.mail_to(email_address=pkg_dict.author_email, name=pkg_dict.author) }}</td>
</tr>
{% elif pkg_dict.author %}
<tr>
<th scope="row" class="dataset-label">{{ _("Author") }}</th>
<td class="dataset-details" property="dc:creator">{{ pkg_dict.author }}</td>
</tr>
{% endif %}

{% if pkg_dict.maintainer_email %}
<tr>
<th scope="row" class="dataset-label">{{ _('Maintainer') }}</th>
<td class="dataset-details" property="dc:contributor">{{ h.mail_to(email_address=pkg_dict.maintainer_email, name=pkg_dict.maintainer) }}</td>
</tr>
{% elif pkg_dict.maintainer %}
<tr>
<th scope="row" class="dataset-label">{{ _('Maintainer') }}</th>
<td class="dataset-details" property="dc:contributor">{{ pkg_dict.maintainer }}</td>
</tr>
{% endif %}

{% if pkg_dict.version %}
<tr>
<th scope="row" class="dataset-label">{{ _("Version") }}</th>
<td class="dataset-details">{{ pkg_dict.version }}</td>
</tr>
{% endif %}

{% if h.check_access('package_update',{'id':pkg_dict.id}) %}
<tr>
<th scope="row" class="dataset-label">{{ _("State") }}</th>
<td class="dataset-details">{{ _(pkg_dict.state) }}</td>
</tr>
{% endif %}
{% if pkg_dict.metadata_modified %}
<tr>
<th scope="row" class="dataset-label">{{ _("Last Updated") }}</th>
<td class="dataset-details">
{% snippet 'snippets/local_friendly_datetime.html', datetime_obj=pkg_dict.metadata_modified %}
</td>
</tr>
{% endif %}
{% if pkg_dict.metadata_created %}
<tr>
<th scope="row" class="dataset-label">{{ _("Created") }}</th>

<td class="dataset-details">
{% snippet 'snippets/local_friendly_datetime.html', datetime_obj=pkg_dict.metadata_created %}
</td>
</tr>
{% endif %}

{% block extras scoped %}
{% for extra in h.sorted_extras(pkg_dict.extras) %}
{% set key, value = extra %}
<tr rel="dc:relation" resource="_:extra{{ i }}">
<th scope="row" class="dataset-label" property="rdfs:label">{{ _(key|e) }}</th>
<td class="dataset-details truncate-td" property="rdf:value">{{ value }}</td>
</tr>
{% endfor %}
{% endblock %}

{% endblock %}
</tbody>
</table>
</section>

0 comments on commit 12bbf83

Please sign in to comment.