*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects

Add template for user preferences about record curation

Merged Moser, Maximilian requested to merge mm/curation-consent into master
3 files
+ 53
2
Compare changes
  • Side-by-side
  • Inline
Files
3
{#-
Copyright (C) 2023 TU Wien.
Invenio Theme TUW is free software; you can redistribute it and/or modify
it under the terms of the MIT License; see LICENSE file for more details.
#}
{%- extends config.USERPROFILES_SETTINGS_TEMPLATE %}
{%- from "invenio_userprofiles/settings/_macros.html" import render_field, form_errors %}
{%- block settings_content scoped %}
<section aria-label="{{ _('Curation') }}" class="ui segments">
<div class="ui segment secondary">
<i class="file icon" aria-hidden="true"></i>
<strong class="header item">{{ _("Curation") }}</strong>
</div>
<div class="ui segment">
<form method="POST" name="preferences_curation_form" class="ui form">
{%- set form = preferences_curation_form %}
{%- for field in form %}
{%- if field.widget.input_type == 'hidden' %}
{{ field() }}
{%- endif %}
{%- endfor %}
{%- set consent_field = form.consent %}
{%- set consent_given = current_user.preferences.get("curation", {}).get("consent", False) %}
<div class="field">
<label for="{{ consent_field.id }}">{{ consent_field.label }}</label>
<p><small>{{ consent_field.description }}</small></p>
<div class="ui toggle on-off checkbox">
<input type="checkbox" name="{{ consent_field.id }}" id="{{ consent_field.id }}" {{ "checked" if consent_given else "" }} />
<label for="{{ consent_field.id }}">Curate my records</label>
</div>
</div>
<div class="form-actions">
<a href="." class="ui labeled icon button mt-5">
<i class="close icon" aria-hidden="true"></i>
{{ _('Cancel') }}
</a>
<button type="submit" name="submit" value="{{ form._prefix }}" class="ui primary labeled icon button mt-5">
<i class="check icon" aria-hidden="true"></i>
{{ _('Update curation preferences') }}
</button>
</div>
</form>
</div>
</section>
{% endblock %}
Loading