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

Weekly release 2024-05-07 #772

Merged
merged 6 commits into from
May 7, 2024
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
11 changes: 8 additions & 3 deletions ckanext/nhm/routes/liv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@


@blueprint.route('/')
@blueprint.route('/<path:mode>')
def index(mode=''):
@blueprint.route('/<mode>')
@blueprint.route('/<mode>/<path:mode_params>')
def index(mode='', mode_params=''):
"""
Render the image viewer page.
"""
return toolkit.render('liv.html', extra_vars={'mode': mode})
# the template doesn't actually do anything with the args but we may as well pass
# them in anyway
return toolkit.render(
'liv.html', extra_vars={'mode': mode, 'mode_params': mode_params}
)
2 changes: 1 addition & 1 deletion ckanext/nhm/theme/templates/beetle_iiif.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% asset 'ckanext-nhm/beetle-iiif-css' %}
{% asset 'ckanext-nhm/beetle-iiif-js' %}
<div class="biiif-deprecation-banner">
You can view this dataset with our <a href="{{ h.url_for('liv.index', mode='resource/' + h.get_beetle_iiif_resource_id()) }}">new image viewer</a>.
You can view this dataset with our <a href="{{ h.url_for('liv.index', mode='resource', mode_params=h.get_beetle_iiif_resource_id()) }}">new image viewer</a>.
</div>
<div id="beetle-iiif-app" data-resource-id="{{ h.get_beetle_iiif_resource_id() }}">
</div>
Expand Down
6 changes: 6 additions & 0 deletions ckanext/nhm/theme/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
{% if 'datastore' in g.plugins and res.datastore_active %}
<li>{% snippet 'package/snippets/data_api_button.html', resource=res, datastore_root_url=g.datastore_api %}</li>
{% endif %}
{% if res._image_field %}
<li><a class="btn btn-primary"
href="{{ h.url_for('liv.index', mode='resource', mode_params=res.id) }}">
<i class="fas fa-images"></i> {{ _('Open in image viewer') }}
</a></li>
{% endif %}
<li>{% snippet "contact/snippets/modal_link.html", pkg=g.pkg, res=res %}</li>
{% endblock %}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions ckanext/nhm/theme/templates/record/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ <h3>Images</h3>
View Manifest
</a> |
<a target="_blank"
href="https://projectmirador.org/embed/?iiif-content={{ iiif_manifest_url }}">
View in Mirador
href="{{ h.url_for('liv.index', mode='record', mode_params=res.id ~ '/' ~ rec['_id']) }}">
View in Image Viewer
</a>
{% endif %} {% endblock %}

Expand Down
21 changes: 21 additions & 0 deletions ckanext/nhm/theme/templates/user/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% ckan_extends %}

{% block help_forgotten %}
<section class="module module-narrow module-shallow">
<h2 class="module-heading">{{ _('Accounts') }}</h2>
<div class="module-content">
<p>{% trans %}You do not need to log in to view or download data.{% endtrans %}</p>
<p>{% trans %}Accounts are used by Natural History Museum staff to create and administrate datasets. Only Natural History Museum staff can log in to the portal.{% endtrans %}</p>
</div>
</section>
<section class="module module-narrow module-shallow">
{% block help_forgotten_inner %}
<h2 class="module-heading">{{ _('Trouble logging in?') }}</h2>
<div class="module-content">
<p>{% trans %}Use your regular Museum username and password.{% endtrans %}</p>
<p>{% trans %}Please check that your password has not expired, and if you have recently updated your password please wait a while before trying again.{% endtrans %}</p>
<p>{% trans %}If you are still having trouble, please <a href="/contact">contact us</a>.{% endtrans %}</p>
</div>
{% endblock %}
</section>
{% endblock %}
Loading