diff --git a/hypha/apply/funds/models/applications.py b/hypha/apply/funds/models/applications.py index 13837638bc5b5e5d94837eeab6297f921f8ee35b..f10aafcab2f9a849eb7668965e2cabaa21da3a58 100644 --- a/hypha/apply/funds/models/applications.py +++ b/hypha/apply/funds/models/applications.py @@ -33,7 +33,8 @@ from wagtail.admin.edit_handlers import ( ) from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.core.fields import RichTextField -from wagtail.core.models import Page, PageManager, PageQuerySet +from wagtail.core.models import Page, PageManager +from wagtail.query import PageQuerySet from ..admin_forms import RoundBasePageAdminForm, WorkflowFormAdminForm from ..edit_handlers import ReadOnlyInlinePanel, ReadOnlyPanel diff --git a/hypha/apply/users/admin_views.py b/hypha/apply/users/admin_views.py index 17c8da5835ebda9c2525cb5ba735abf5247e78a9..d5e96cfbd373692112c768c33c2d1d41bc2f3ad8 100644 --- a/hypha/apply/users/admin_views.py +++ b/hypha/apply/users/admin_views.py @@ -10,7 +10,7 @@ from django.views.decorators.vary import vary_on_headers from wagtail.admin.auth import any_permission_required from wagtail.admin.filters import WagtailFilterSet from wagtail.admin.forms.search import SearchForm -from wagtail.core.compat import AUTH_USER_APP_LABEL, AUTH_USER_MODEL_NAME +from wagtail.compat import AUTH_USER_APP_LABEL, AUTH_USER_MODEL_NAME User = get_user_model() diff --git a/hypha/apply/users/templates/wagtailusers/users/edit.html b/hypha/apply/users/templates/wagtailusers/users/edit.html index 6acd9e295ceed8f8f298f0f7472ececa06c58757..1846bcb2872d6e8993df85cdbde49bc80ad9353c 100644 --- a/hypha/apply/users/templates/wagtailusers/users/edit.html +++ b/hypha/apply/users/templates/wagtailusers/users/edit.html @@ -6,7 +6,7 @@ {% trans "Editing" as editing_str %} {% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=user.get_username merged=1 tabbed=1 icon="user" %} - <ul class="tab-nav merged" data-tab-nav> + <ul class="tab-nav merged"> <li class="active"><a href="#account">{% trans "Account" %}</a></li> <li><a href="#roles">{% trans "Roles" %}</a></li> </ul> @@ -24,6 +24,7 @@ {% endif %} {% include "wagtailadmin/shared/field_as_li.html" with field=form.email %} {% include "wagtailadmin/shared/field_as_li.html" with field=form.full_name %} + {% block extra_fields %}{% endblock extra_fields %} {% comment %} First/last name hidden input with dummy values because.. Wagtail admin @@ -41,8 +42,8 @@ {% if form.is_active %} {% include "wagtailadmin/shared/field_as_li.html" with field=form.is_active %} {% endif %} - {% endblock fields %} + {% endblock fields %} <li> <input type="submit" value="{% trans 'Save' %}" class="button" /> {% if can_delete %} diff --git a/hypha/apply/users/templates/wagtailusers/users/index.html b/hypha/apply/users/templates/wagtailusers/users/index.html index fd28fb0f853ace65d13e46235be626bcfb50a80b..251f77009c006c1e8c9e09f519408a3aab5e94f0 100644 --- a/hypha/apply/users/templates/wagtailusers/users/index.html +++ b/hypha/apply/users/templates/wagtailusers/users/index.html @@ -21,10 +21,7 @@ {% endblock %} {% block extra_css %} - {{ block.super }} <link rel="stylesheet" href="{% static 'css/apply/wagtail_users_list.css' %}" type="text/css" /> - - {{ filters.form.media.css }} {% endblock %} {% block content %} diff --git a/hypha/apply/users/templates/wagtailusers/users/list.html b/hypha/apply/users/templates/wagtailusers/users/list.html index 1ba5b89f7ce5284077d112e25fd76b4cf87cca4d..c80d25ea818cf65ee9d05d1122de052616fa1e3e 100644 --- a/hypha/apply/users/templates/wagtailusers/users/list.html +++ b/hypha/apply/users/templates/wagtailusers/users/list.html @@ -28,6 +28,7 @@ <a href="{% url 'wagtailusers_users:index' %}?ordering=status" class="icon icon-arrow-down-after"></a> {% endif %} </th> + <th class="last-login">{% trans "Last Login" %}</th> </tr> </thead> <tbody> @@ -36,7 +37,7 @@ {% include "wagtailadmin/bulk_actions/listing_checkbox_cell.html" with obj_type="user" obj=user aria_labelledby_prefix="user_" aria_labelledby=user.pk|unlocalize aria_labelledby_suffix="_title" %} <td id="user_{{ user.pk|unlocalize }}_title" class="title" valign="top"> <h2 class="title-wrapper"> - <span class="avatar small"><img src="{% avatar_url user size=25 %}" /></span> + <span class="avatar small"><img src="{% avatar_url user size=25 %}" alt="" /></span> <a href="{% url 'wagtailusers_users:edit' user.pk %}">{{ user.get_full_name|default:user.get_username }}</a> </h2> <ul class="actions"> @@ -46,6 +47,7 @@ <td class="username" valign="top">{{ user.get_username }}</td> <td class="level" valign="top">{{ user.roles|join:', ' }}{% if user.is_superuser %} ({% trans "Admin" %}){% endif %}</td> <td class="status" valign="top"><div class="status-tag {% if user.is_active %}primary{% endif %}">{% if user.is_active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %}</div></td> + <td {% if user.last_login %} class="human-readable-date" title="{{ user.last_login|date:"d M Y H:i" }}"{% endif %}>{% if user.last_login %}{% blocktrans with time_period=user.last_login|timesince %}{{ time_period }} ago{% endblocktrans %}{% endif %}</td> </tr> {% endfor %} </tbody> diff --git a/hypha/public/people/models.py b/hypha/public/people/models.py index a41e750bbbd40a84064ea491d015cb04767d64d5..763543683c316a509b30038780b3c00bb42ab843 100644 --- a/hypha/public/people/models.py +++ b/hypha/public/people/models.py @@ -14,8 +14,9 @@ from wagtail.admin.edit_handlers import ( StreamFieldPanel, ) from wagtail.core.fields import StreamField -from wagtail.core.models import Orderable, PageManager, PageQuerySet +from wagtail.core.models import Orderable, PageManager from wagtail.images.edit_handlers import ImageChooserPanel +from wagtail.query import PageQuerySet from wagtail.search import index from hypha.public.utils.blocks import StoryBlock diff --git a/requirements.txt b/requirements.txt index 32d27a17ab16f3959f46d5aec8089c12117dbd1c..0231604ad8f329a9faf005a7a725b91397d60e6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -48,6 +48,6 @@ social_auth_app_django==5.0.0 tomd==0.1.3 wagtail-cache==1.0.2 wagtail-purge==0.1 -wagtail==2.16.1 +wagtail==3.0.0 whitenoise==5.3.0 xmltodict==0.12.0