Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity Stream and Archive UI/UX Improvements #1402

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ckanext/canada/templates/internal/package/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{% endblock %}

{% block content_primary_nav %}
{{ h.build_nav_icon(pkg.type + '.read', _('Dataset'), id=pkg.name) }}
{{ h.build_nav_icon('dataset.activity', _('Activity Stream'), id=pkg.name) }}
{% set dataset_label = _('Dataset') %}
{% if pkg.type in h.recombinant_get_types() %}
{% set dataset_label = _(pkg.title) %}
{% endif %}
{{ h.build_nav_icon(pkg.type + '.read', dataset_label, id=pkg.name) }}
{{ h.build_nav_icon(pkg.type + '.activity', _('Activity Stream'), id=pkg.name) }}
{% endblock %}
4 changes: 2 additions & 2 deletions ckanext/canada/templates/public/package/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{% set client_lang = h.lang() %}

{% block breadcrumb_content %}
{% set pkg_url = h.url_for(pkg.type ~ '.read', id=pkg.id if is_activity_archive else pkg.name) %}
{% set pkg_url = h.url_for(pkg.type ~ '.read', id=pkg.id if is_activity_archive else pkg.name, **({'activity_id': request.args['activity_id']} if 'activity_id' in request.args else {})) %}
{% if c.action != 'new' and pkg %}
{% set dataset = h.get_translated(pkg, 'title') %}
<li>{% link_for dataset|truncate(30), named_route=pkg.type ~ '.read', id=pkg.id if is_activity_archive else pkg.name %}</li>
<li><a href="{{ pkg_url }}">{{ dataset|truncate(30) }}</a></li>
{% endif %}
{% endblock %}

19 changes: 9 additions & 10 deletions ckanext/canada/templates/public/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,23 @@ <h1>{{ title or pkg.name }}
<i class="fa fa-language text-muted mrgn-lft-sm" title="{{ _("This third party metadata element has been translated using an automated translation tool. To report any discrepancies please contact [email protected]") }}"></i>
{% endif %}
</h1>
{% if is_activity_archive %}
<div class="module-alert alert alert-danger mrgn-tp-sm">
<p>
{% trans url = h.url_for(pkg.type + '.read', id=pkg.id) %}You're currently viewing an old version of this dataset. Some resources may no longer exist or the dataset may not display correctly. To see the current version, click <a href="{{ url }}">here</a>.{% endtrans %}
</p>
</div>
{% endif %}
{% endblock %}

{% block primary_content_inner %}
{% if not c.is_activity_archive %}
{% if not is_activity_archive %}
{%- snippet 'package/snippets/schemaorg.html', data=pkg -%}
{% endif %}
<div class="module">
{% block internal_actions %}{% endblock %}

{% block package_archive_notice %}
{% if c.is_activity_archive %}
<div class="alert alert-error">
<p>
{% trans url = h.url_for(pkg.type + '.read', id=pkg.id) %}You're currently viewing an old version of this dataset. Some resources may no longer exist or the dataset may not display correctly. To see the current version, click <a href="{{ url }}">here</a>.{% endtrans %}
</p>
</div>
{% endif %}
{% endblock %}
{% block package_archive_notice %}{% endblock %}

{% block package_item_title %}
<section class="module-content indent-large">
Expand Down
4 changes: 2 additions & 2 deletions ckanext/canada/templates/public/package/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@
{{ _('Link to JSON format') }}
</a>
</li>
{% if h.plugin_loaded('dcat_json_interface') %}
{% if h.plugin_loaded('dcat_json_interface') and pkg.type not in h.recombinant_get_types() %}
<li class="list-group-item" style="border: none;">
<a href="{{ h.url_for(pkg.type + '.read', id=pkg.id) }}.jsonld" rel="nofollow">
{{ _('DCAT (JSON-LD)') }}
</a>
</li>
{% endif %}
{% if h.plugin_loaded('dcat') %}
{% if h.plugin_loaded('dcat') and pkg.type not in h.recombinant_get_types() %}
<li class="list-group-item" style="border: none;">
<a href="{{ h.url_for(pkg.type + '.read', id=pkg.id) }}.xml" rel="nofollow">
{{ _('DCAT (XML)') }}
Expand Down
11 changes: 11 additions & 0 deletions ckanext/canada/templates/public/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

{% block page_title %}
{{ super() }}
{% if is_activity_archive %}
<div class="module-alert alert alert-danger mrgn-tp-sm">
<p>
{% trans url = h.url_for(pkg.type + '.read', id=pkg.id) %}You're currently viewing an old version of this dataset. Some resources may no longer exist or the dataset may not display correctly. To see the current version, click <a href="{{ url }}">here</a>.{% endtrans %}
</p>
</div>
{% endif %}
{% if h.is_registry() %}
{{ h.get_validation_badge(res)|safe }}
{% endif %}
Expand All @@ -11,6 +18,10 @@
<div class="resource-actions-toolbar">{{ super() }}</div>
{% endblock %}

{% block action_manage %}
{% if not is_activity_archive %}{{ super() }}{% endif %}
{% endblock %}

{% block resource_content %}
{% block resource_read_title %}{{ super() }}{% endblock %}
{% block resource_read_url %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
{%- if machine_translated -%}
<i class="fa fa-language text-muted" style="margin-left: 10px;" title="{{ _("This third party metadata element has been translated using an automated translation tool. To report any discrepancies please contact [email protected]") }}"></i>
{%- endif -%}
{{ h.popular('views', res.tracking_summary.total, min=10) }}
{% if 'tracking_summary' in res %}
{{ h.popular('views', res.tracking_summary.total, min=10) }}
{% endif %}
</a>
{% set language_options = h.scheming_get_preset('canada_resource_language').choices %}
<div>
Expand Down Expand Up @@ -74,7 +76,7 @@
</a>
</li>
{% endif %}
{% if can_edit %}
{% if can_edit and not is_activity_archive %}
<li>{% link_for _('Edit resource'), named_route=pkg.type ~ '_resource.edit', id=pkg.name, resource_id=res.id, class_='dropdown-item', icon='pencil' %}</li>
{% block resource_item_explore_inner scoped %}{% endblock %}
<li>{% link_for _('Views'), named_route=pkg.type ~ '_resource.views', id=pkg.name, resource_id=res.id, class_='dropdown-item', icon='chart-bar' %}
Expand Down
Loading