From 9bc1f960fedc50f4128b3ee5ab2dd9c00f894428 Mon Sep 17 00:00:00 2001 From: Joseph Muller Date: Fri, 6 Dec 2024 16:51:25 +0000 Subject: [PATCH] UI for core affiliation management #3168 --- src/core/forms/__init__.py | 1 + src/core/forms/forms.py | 15 ++ src/core/include_urls.py | 32 ++++ src/core/views.py | 154 +++++++++++++++++- src/static/admin/img/icons/ror-icon-rgb.svg | 19 +++ src/static/common/css/utilities.css | 4 + .../admin/core/accounts/edit_profile.html | 26 ++- .../core/affiliation_confirm_delete.html | 62 +++++++ .../admin/core/affiliation_display.html | 20 +++ .../admin/core/affiliation_form.html | 83 ++++++++++ .../admin/core/affiliation_summary.html | 12 ++ .../admin/core/manager/users/edit.html | 2 +- .../admin/core/organization_list.html | 70 ++++++++ .../admin/core/organization_search.html | 84 ++++++++++ .../admin/core/organizationname_form.html | 47 ++++++ .../admin/elements/accounts/user_form.html | 7 - .../elements/layout/key_value_above.html | 8 +- .../admin/elements/list_filters.html | 4 +- 18 files changed, 636 insertions(+), 14 deletions(-) create mode 100644 src/static/admin/img/icons/ror-icon-rgb.svg create mode 100644 src/templates/admin/core/affiliation_confirm_delete.html create mode 100644 src/templates/admin/core/affiliation_display.html create mode 100644 src/templates/admin/core/affiliation_form.html create mode 100644 src/templates/admin/core/affiliation_summary.html create mode 100644 src/templates/admin/core/organization_list.html create mode 100644 src/templates/admin/core/organization_search.html create mode 100644 src/templates/admin/core/organizationname_form.html diff --git a/src/core/forms/__init__.py b/src/core/forms/__init__.py index 168dc67668..c973535d7f 100644 --- a/src/core/forms/__init__.py +++ b/src/core/forms/__init__.py @@ -2,6 +2,7 @@ AccessRequestForm, AccountRoleForm, AdminUserForm, + AffiliationForm, ArticleMetaImageForm, CBVFacetForm, ConfirmableForm, diff --git a/src/core/forms/forms.py b/src/core/forms/forms.py index cfe028106c..785a2d56ba 100755 --- a/src/core/forms/forms.py +++ b/src/core/forms/forms.py @@ -940,3 +940,18 @@ class AccountRoleForm(forms.ModelForm): class Meta: model = models.AccountRole fields = '__all__' + + +class AffiliationForm(forms.ModelForm): + + class Meta: + model = models.Affiliation + fields = '__all__' + widgets = { + 'account': forms.HiddenInput, + 'frozen_author': forms.HiddenInput, + 'preprint_author': forms.HiddenInput, + 'organization': forms.HiddenInput, + 'start': HTMLDateInput, + 'end': HTMLDateInput, + } diff --git a/src/core/include_urls.py b/src/core/include_urls.py index dea31e2e0b..ac924f8e97 100644 --- a/src/core/include_urls.py +++ b/src/core/include_urls.py @@ -118,6 +118,38 @@ re_path(r'^manager/user/(?P\d+)/edit/$', core_views.user_edit, name='core_user_edit'), re_path(r'^manager/user/(?P\d+)/history/$', core_views.user_history, name='core_user_history'), + ## Affiliations + re_path( + r'^profile/organization/search/$', + core_views.OrganizationListView.as_view(), + name='core_organization_search' + ), + re_path( + r'^profile/organization_name/create/$', + core_views.OrganizationNameCreateView.as_view(), + name='core_organization_name_create' + ), + re_path( + r'^profile/organization_name/(?P\d+)/update/$', + core_views.OrganizationNameUpdateView.as_view(), + name='core_organization_name_update' + ), + re_path( + r'^profile/organization/(?P\d+)/affiliation/create/$', + core_views.AffiliationCreateView.as_view(), + name='core_affiliation_create' + ), + re_path( + r'^profile/affiliation/(?P\d+)/update/$', + core_views.AffiliationUpdateView.as_view(), + name='core_affiliation_update' + ), + re_path( + r'^profile/affiliation/(?P\d+)/delete/$', + core_views.AffiliationDeleteView.as_view(), + name='core_affiliation_delete' + ), + # Templates re_path(r'^manager/templates/$', core_views.email_templates, name='core_email_templates'), diff --git a/src/core/views.py b/src/core/views.py index b8c1a36810..882aa046bc 100755 --- a/src/core/views.py +++ b/src/core/views.py @@ -15,11 +15,12 @@ from django.contrib.auth import authenticate, logout, login from django.contrib.auth.decorators import login_required from django.core.cache import cache -from django.urls import NoReverseMatch, reverse +from django.urls import NoReverseMatch, reverse, reverse_lazy from django.shortcuts import render, get_object_or_404, redirect, Http404 from django.utils import timezone from django.utils.decorators import method_decorator from django.http import HttpResponse, QueryDict +from django.contrib.messages.views import SuccessMessageMixin from django.contrib.sessions.models import Session from django.core.validators import validate_email from django.core.exceptions import ValidationError @@ -27,6 +28,7 @@ from django.conf import settings as django_settings from django.views.decorators.http import require_POST from django.views.decorators.csrf import ensure_csrf_cookie +from django.views.generic import CreateView, UpdateView, DeleteView from django.contrib.contenttypes.models import ContentType from django.utils.translation import gettext_lazy as _ from django.utils import translation @@ -2775,3 +2777,153 @@ def post(self, request, *args, **kwargs): messages.success(request, message) return super().post(request, *args, **kwargs) + + +@method_decorator(login_required, name='dispatch') +class OrganizationListView(GenericFacetedListView): + """ + Allows a user to search for an organization to add + as one of their own affiliations. + """ + + model = core_models.Organization + template_name = 'admin/core/organization_search.html' + + def get_context_data(self, *args, **kwargs): + context = super().get_context_data(*args, **kwargs) + context['account'] = self.request.user + return context + + def get_queryset(self, *args, **kwargs): + queryset = super().get_queryset(*args, **kwargs) + # Exclude user-created organizations from search results + return queryset.exclude(custom_label__isnull=False) + + def get_facets(self): + return { + 'q': { + 'type': 'search', + 'field_label': 'Search', + }, + } + + +@method_decorator(login_required, name='dispatch') +class OrganizationNameCreateView(SuccessMessageMixin, CreateView): + """ + Allows a user to create a custom organization name + if they cannot find one in ROR data. + """ + + model = core_models.OrganizationName + fields = ['value'] + + def get_context_data(self, *args, **kwargs): + context = super().get_context_data(*args, **kwargs) + context['account'] = self.request.user + return context + + def form_valid(self, form): + organization_name = form.save() + organization = core_models.Organization.objects.create() + organization_name.custom_label_for = organization + organization_name.save() + return redirect( + reverse( + 'affiliation_create', + kwargs={ + 'user_id': self.kwargs.get('user_id'), + 'organization_id': organization.pk, + } + ) + ) + + +@method_decorator(login_required, name='dispatch') +class OrganizationNameUpdateView(SuccessMessageMixin, UpdateView): + """ + Allows a user to update a custom organization name. + """ + + model = core_models.OrganizationName + fields = ['value'] + pk_url_kwarg = 'organization_name_id' + success_url = reverse_lazy('core_edit_profile') + success_message = _("Custom organization updated: %(value)s") + + def get_context_data(self, *args, **kwargs): + context = super().get_context_data(*args, **kwargs) + context['account'] = self.request.user + return context + + +@method_decorator(login_required, name='dispatch') +class AffiliationCreateView(SuccessMessageMixin, CreateView): + """ + Allows a user to create a new affiliation for themselves. + """ + + model = core_models.Affiliation + form_class = forms.AffiliationForm + success_url = reverse_lazy('core_edit_profile') + success_message = _("Affiliation created: %(organization)s") + + def get_context_data(self, *args, **kwargs): + context = super().get_context_data(*args, **kwargs) + context['account'] = self.request.user + organization_id = self.kwargs.get('organization_id') + context['organization'] = core_models.Organization.objects.get( + pk=organization_id + ) + return context + + def get_initial(self): + initial = super().get_initial() + initial['account'] = self.request.user + initial['organization'] = self.kwargs.get('organization_id') + return initial + + +@method_decorator(login_required, name='dispatch') +class AffiliationUpdateView(SuccessMessageMixin, UpdateView): + """ + Allows a user to update one of their own affiliations. + """ + + model = core_models.Affiliation + pk_url_kwarg = 'affiliation_id' + form_class = forms.AffiliationForm + success_url = reverse_lazy('core_edit_profile') + success_message = _("Affiliation updated: %(organization)s") + + def get_context_data(self, *args, **kwargs): + context = super().get_context_data(*args, **kwargs) + context['account'] = self.request.user + affiliation_id = self.kwargs.get('affiliation_id') + context['affiliation'] = core_models.Affiliation.objects.get( + pk=affiliation_id + ) + context['organization'] = context['affiliation'].organization + return context + + +@method_decorator(login_required, name='dispatch') +class AffiliationDeleteView(SuccessMessageMixin, DeleteView): + """ + Allows a user to delete one of their own affiliations. + """ + + model = core_models.Affiliation + pk_url_kwarg = 'affiliation_id' + success_url = reverse_lazy('core_edit_profile') + success_message = _("Affiliation deleted") + + def get_context_data(self, *args, **kwargs): + context = super().get_context_data(*args, **kwargs) + context['account'] = self.request.user + affiliation_id = self.kwargs.get('affiliation_id') + context['affiliation'] = core_models.Affiliation.objects.get( + pk=affiliation_id + ) + context['organization'] = context['affiliation'].organization + return context diff --git a/src/static/admin/img/icons/ror-icon-rgb.svg b/src/static/admin/img/icons/ror-icon-rgb.svg new file mode 100644 index 0000000000..4cabc057df --- /dev/null +++ b/src/static/admin/img/icons/ror-icon-rgb.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/src/static/common/css/utilities.css b/src/static/common/css/utilities.css index 5c754a2a0a..1ae8cb3f98 100644 --- a/src/static/common/css/utilities.css +++ b/src/static/common/css/utilities.css @@ -12,6 +12,10 @@ &.items-start { align-items: flex-start; } &.items-center { align-items: center; } + /* Flex direction */ + &.direction-row { flex-direction: row; } + &.direction-column { flex-direction: column; } + /* Responsive flex direction */ @media (orientation: portrait) { &.portrait-row { flex-direction: row; } diff --git a/src/templates/admin/core/accounts/edit_profile.html b/src/templates/admin/core/accounts/edit_profile.html index 07a17c68b9..d1aed3de3c 100644 --- a/src/templates/admin/core/accounts/edit_profile.html +++ b/src/templates/admin/core/accounts/edit_profile.html @@ -2,7 +2,7 @@ {% load i18n foundation static %} {% block css %} - + {% endblock %} {% block contextual_title %} @@ -10,7 +10,6 @@ {% endblock contextual_title %} {% block breadcrumbs %} -
  • Edit Profile
  • {% endblock breadcrumbs %} {% block title-section %} @@ -117,6 +116,29 @@

    {% trans "Update Password" %}

    {% include "admin/elements/forms/denotes_required.html" %} +
    +
    +

    {% trans "Affiliations" %}

    +
    +
    + {% for affiliation in request.user.affiliations %} +
    + {% include "admin/core/affiliation_display.html" with affiliation=affiliation %} +
    + {% url 'core_affiliation_update' affiliation.pk as update_url %} + {% include "elements/a_edit.html" with href=update_url size="small" %} + {% url 'core_affiliation_delete' affiliation.pk as delete_url %} + {% include "elements/a_delete.html" with href=delete_url size="small" %} +
    +
    + {% endfor %} +
    + {% url 'core_organization_search' as create_url %} + {% trans "Add affiliation" as add_affiliation %} + {% include "elements/a_create.html" with href=create_url size="small" label=add_affiliation %} +
    +
    +

    {% trans 'Profile Details' %}

    diff --git a/src/templates/admin/core/affiliation_confirm_delete.html b/src/templates/admin/core/affiliation_confirm_delete.html new file mode 100644 index 0000000000..eff9ff5c77 --- /dev/null +++ b/src/templates/admin/core/affiliation_confirm_delete.html @@ -0,0 +1,62 @@ +{% extends "admin/core/large_form.html" %} + +{% load i18n foundation %} + +{% block contextual_title %} + {% blocktrans with organization=affiliation.organization.name %} + Delete affiliation: {{ organization }} + {% endblocktrans %} +{% endblock contextual_title %} + +{% block title-section %} + {% blocktrans with organization=affiliation.organization.name %} + Delete affiliation: {{ organization }} + {% endblocktrans %} +{% endblock title-section %} + +{% block breadcrumbs %} + {% if request.user == account %} +
  • + + {% trans "Edit Profile" %} + +
  • +
  • + + {% trans "Edit Affiliation" %} + +
  • +
  • + {% blocktrans with organization=affiliation.organization.name %} + Delete affiliation: {{ organization }} + {% endblocktrans %} +
  • + {% endif %} +{% endblock breadcrumbs %} + +{% block body %} +
    +
    + {% include "admin/core/affiliation_summary.html" %} +
    +
    +

    {% trans "Confirmation" %}

    +
    + {% include "admin/elements/forms/messages_in_callout.html" with form=form %} +
    + {% csrf_token %} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} +

    {% blocktrans %} + Are you sure you want to delete the affiliation "{{ object }}"? + {% endblocktrans %}

    + {{ form }} + {% include "elements/button_yes_delete.html" %} + {% url 'core_edit_profile' as go_back_url %} + {% include "elements/a_no_go_back.html" with href=go_back_url %} +
    +
    +
    +
    +{% endblock body %} diff --git a/src/templates/admin/core/affiliation_display.html b/src/templates/admin/core/affiliation_display.html new file mode 100644 index 0000000000..fd1e17918d --- /dev/null +++ b/src/templates/admin/core/affiliation_display.html @@ -0,0 +1,20 @@ +{% load static %} + +
    + {% if affiliation.title_department %} + {{ affiliation.title_department }}, + {% endif %} + {% if affiliation.organization.ror %} + + {{ affiliation.organization }} + (opens in new tab) + ROR logo + + {% else %} + {{ affiliation.organization }} + {% endif %} +
    diff --git a/src/templates/admin/core/affiliation_form.html b/src/templates/admin/core/affiliation_form.html new file mode 100644 index 0000000000..62f22c5c17 --- /dev/null +++ b/src/templates/admin/core/affiliation_form.html @@ -0,0 +1,83 @@ +{% extends "admin/core/large_form.html" %} + +{% load i18n static foundation %} + +{% block contextual_title %} + {% blocktrans with organization=organization.name %} + Affiliation details for {{ organization }} + {% endblocktrans %} +{% endblock contextual_title %} + +{% block title-section %} + {% blocktrans with organization=organization.name %} + Affiliation details for {{ organization }} + {% endblocktrans %} +{% endblock title-section %} + +{% block breadcrumbs %} + {% if request.user == account %} +
  • Edit Profile
  • + {% if not affiliation %} +
  • + + {% trans "Add Affiliation" %} + +
  • + {% endif %} +
  • {% blocktrans with organization=organization.name %} + Affiliation details for {{ organization }} + {% endblocktrans %}
  • + {% endif %} +{% endblock breadcrumbs %} + +{% block body %} +
    +
    + {% include "admin/core/affiliation_summary.html" %} +
    +
    +

    + {% trans "Affiliation details for" %} {{ organization.name }} +

    +
    + {% include "admin/elements/forms/messages_in_callout.html" with form=form %} + {% blocktrans with organization=organization.name %} +

    Enter optional affiliation details, and select Save to create the affiliation.

    + {% endblocktrans %} + {% if organization.custom_label %} +
    + {% include "admin/elements/layout/key_value_above.html" with key="Custom organization" value=organization.custom_label %} + {% if affiliation %} +
    + {% url 'core_organization_name_update' organization.custom_label.pk as edit_url %} + {% include "elements/a_edit.html" with href=edit_url size="small" %} +
    + {% endif %} +
    + {% endif %} +
    + {% csrf_token %} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} +
    + {% include "admin/elements/forms/field.html" with field=form.title %} + {% include "admin/elements/forms/field.html" with field=form.department %} +
    +
    + {% include "admin/elements/forms/field.html" with field=form.start %} + {% include "admin/elements/forms/field.html" with field=form.end %} + {% include "admin/elements/forms/field.html" with field=form.is_primary %} +
    + {% include "elements/button_save.html" %} + {% if affiliation %} + {% url 'core_affiliation_delete' affiliation.pk as delete_url %} + {% include "elements/a_delete.html" with href=delete_url %} + {% endif %} + {% url 'core_edit_profile' as cancel_url %} + {% include "elements/a_cancel.html" with href=cancel_url %} +
    +
    +
    +
    +{% endblock body %} diff --git a/src/templates/admin/core/affiliation_summary.html b/src/templates/admin/core/affiliation_summary.html new file mode 100644 index 0000000000..466629e6cf --- /dev/null +++ b/src/templates/admin/core/affiliation_summary.html @@ -0,0 +1,12 @@ +
    +
    +
    +

    {% trans "Summary" %}

    +
    + {% include "admin/elements/layout/key_value_above.html" with key="Account Name" value=account %} + {% include "admin/elements/layout/key_value_above.html" with key="Email" value=account.email %} + {% if organization %} + {% include "admin/elements/layout/key_value_above.html" with key="Organization" value=organization %} + {% endif %} +
    +
    diff --git a/src/templates/admin/core/manager/users/edit.html b/src/templates/admin/core/manager/users/edit.html index 7093cc3e0d..43a3ec67f8 100644 --- a/src/templates/admin/core/manager/users/edit.html +++ b/src/templates/admin/core/manager/users/edit.html @@ -5,7 +5,7 @@ {% block title %}{{ active|capfirst }} Profile{% endblock title %} {% block css %} - + {% endblock %} {% block breadcrumbs %} diff --git a/src/templates/admin/core/organization_list.html b/src/templates/admin/core/organization_list.html new file mode 100644 index 0000000000..63f18d7461 --- /dev/null +++ b/src/templates/admin/core/organization_list.html @@ -0,0 +1,70 @@ +{% extends "admin/submission/submit_authors_base.html" %} + +{% load static %} +{% load i18n %} + +{% block manage_authors %} +
    +
    +

    {% trans "Add affiliation for " %}{{ account.full_name }}

    +
    +
    +
    + + +
    + +
    +
    +
    + {% for organization in organization_list %} +
    +
    +
    +

    {{ organization.ror_display }}

    +
    + {% include "admin/elements/layout/key_value_above.html" with key="Locations" value=organization.locations.all list=True %} + {% if organization.also_known_as %} + {% include "admin/elements/layout/key_value_above.html" with key="Also known as" value=organization.also_known_as list=True %} + {% endif %} + {% if organization.locations.count > 1 %} + {% include "admin/elements/layout/key_value_above.html" with key="Locations" value=organization.locations.all list=True %} + {% endif %} + {% include "admin/elements/layout/key_value_above.html" with key="ROR ID" value=organization.ror link=organization.ror %} + {% include "admin/elements/layout/key_value_above.html" with key="Website" value=organization.website link=organization.website %} +
    +
    +
    + {% url 'core_affiliation_create' organization.pk as create_url %} + {% trans "Add affiliation" as add_affiliation %} + {% include "elements/a_create.html" with href=create_url label=add_affiliation %} +
    +
    +
    + {% empty %} +

    {% trans 'No organizations to display.' %}

    + {% endfor %} +
    +

    Organization not found?

    + {% url 'core_organization_name_create' as create_url %} + {% trans "Create custom organization" as create_custom_organization %} + {% include "elements/a_create.html" with href=create_url label=create_custom_organization %} +
    + {% if organization_list %} + {% include "common/elements/pagination.html" with form_id=facet_form.id %} + {% endif %} +
    + {% include "admin/core/affiliation_summary.html" %} +{% endblock manage_authors %} diff --git a/src/templates/admin/core/organization_search.html b/src/templates/admin/core/organization_search.html new file mode 100644 index 0000000000..0facd3dc8e --- /dev/null +++ b/src/templates/admin/core/organization_search.html @@ -0,0 +1,84 @@ +{% extends "admin/core/large_form.html" %} + +{% load i18n static %} + +{% block contextual_title %} + {% trans "Add Affiliation" %} +{% endblock contextual_title %} + +{% block title-section %} + {% trans "Add Affiliation" %} +{% endblock title-section %} + +{% block breadcrumbs %} + {% if request.user == account %} +
  • Edit Profile
  • +
  • {% trans "Add Affiliation" %}
  • + {% endif %} +{% endblock breadcrumbs %} + +{% block body %} +
    +
    + {% include "admin/core/affiliation_summary.html" %} +
    + {% include "admin/elements/forms/messages_in_callout.html" with form=form %} +
    +
    +

    {% trans "Search for organization" %}

    +
    +
    + + +
    + +
    +
    +
    + {% for organization in organization_list %} +
    +
    +
    +

    {{ organization.ror_display }}

    + {% include "admin/elements/layout/key_value_above.html" with key="Locations" value=organization.locations.all list=True %} + {% if organization.also_known_as %} + {% include "admin/elements/layout/key_value_above.html" with key="Also known as" value=organization.also_known_as list=True %} + {% endif %} + {% include "admin/elements/layout/key_value_above.html" with key="ROR ID" value=organization.ror link=organization.ror %} + {% include "admin/elements/layout/key_value_above.html" with key="Website" value=organization.website link=organization.website %} +
    +
    + {% url 'core_affiliation_create' organization.pk as create_url %} + {% trans "Add affiliation" as add_affiliation %} + {% include "elements/a_create.html" with href=create_url label=add_affiliation %} +
    +
    +
    + {% empty %} +

    {% trans 'No organizations to display.' %}

    + {% endfor %} +
    +

    Organization not found?

    + {% url 'core_organization_name_create' as create_url %} + {% trans "Create custom organization" as create_custom_organization %} + {% include "elements/a_create.html" with href=create_url label=create_custom_organization %} +
    + {% if organization_list %} + {% include "common/elements/pagination.html" with form_id=facet_form.id %} + {% endif %} +
    +
    +
    +{% endblock body %} diff --git a/src/templates/admin/core/organizationname_form.html b/src/templates/admin/core/organizationname_form.html new file mode 100644 index 0000000000..319abf1e74 --- /dev/null +++ b/src/templates/admin/core/organizationname_form.html @@ -0,0 +1,47 @@ +{% extends "admin/core/large_form.html" %} + +{% load i18n static foundation %} + +{% block contextual_title %} + {% trans "Custom organization" %} +{% endblock contextual_title %} + +{% block title-section %} + {% trans "Custom organization" %} +{% endblock title-section %} + +{% block breadcrumbs %} + {% if request.user == account %} +
  • Edit Profile
  • +
  • + + {% trans "Add Affiliation" %} + +
  • +
  • {% trans "Custom organization" %}
  • + {% endif %} +{% endblock breadcrumbs %} + +{% block body %} +
    +
    + {% include "admin/core/affiliation_summary.html" %} +
    +
    +

    {% trans "Custom name" %}

    +
    +
    + {% include "admin/elements/forms/messages_in_callout.html" with form=form %} + {% csrf_token %} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} + {% include "admin/elements/forms/field.html" with field=form.value %} + {% include "elements/button_save.html" %} + {% url 'core_edit_profile' as cancel_url %} + {% include "elements/a_cancel.html" with href=cancel_url %} +
    +
    +
    +
    +{% endblock body %} diff --git a/src/templates/admin/elements/accounts/user_form.html b/src/templates/admin/elements/accounts/user_form.html index e2bc6119b5..a0fdfdb389 100644 --- a/src/templates/admin/elements/accounts/user_form.html +++ b/src/templates/admin/elements/accounts/user_form.html @@ -10,13 +10,6 @@

    {% trans "Name" %}

    {% include "admin/elements/forms/field.html" with field=form.suffix %}

    -

    {% trans "Affiliations" %}

    -
    - {% include "admin/elements/forms/field.html" with field=form.department %} - {% include "admin/elements/forms/field.html" with field=form.institution %} - {% include "admin/elements/forms/field.html" with field=form.country %} -
    -

    {% trans "Social Media and Accounts" %}

    {% include "admin/elements/forms/field.html" with field=form.twitter %} diff --git a/src/templates/admin/elements/layout/key_value_above.html b/src/templates/admin/elements/layout/key_value_above.html index ce8f663829..10fafcf3aa 100644 --- a/src/templates/admin/elements/layout/key_value_above.html +++ b/src/templates/admin/elements/layout/key_value_above.html @@ -17,10 +17,16 @@
  • {{ item }}
  • {% endfor %} + {% elif link %} + + {{ value }} + (opens in new tab) + + {% elif render_line_breaks %} {{ value|linebreaksbr|default:"No value supplied" }} {% else %} {{ value|default:"No value supplied" }} {% endif %} -
    \ No newline at end of file + diff --git a/src/templates/admin/elements/list_filters.html b/src/templates/admin/elements/list_filters.html index ac2f5f4835..6252d73075 100644 --- a/src/templates/admin/elements/list_filters.html +++ b/src/templates/admin/elements/list_filters.html @@ -1,7 +1,7 @@ {% load foundation %} {% if facet_form.fields %} - +
    {% endif %}