mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Show community account last login and count info on admin page
The collection facility was added in [200~9e70a4e0c32f8db0178f05dac4c1fca7b317e7c5, but no way was added to view it. To make it a bit more useful, add a static set of info on the user edit page in /admin/ that shows the last login and number of logins per site.
This commit is contained in:
12
pgweb/util/widgets.py
Normal file
12
pgweb/util/widgets.py
Normal file
@ -0,0 +1,12 @@
|
||||
from django.forms.widgets import Widget
|
||||
|
||||
|
||||
class TemplateRenderWidget(Widget):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.template_name = kwargs.pop('template')
|
||||
self.templatecontext = kwargs.pop('context')
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def get_context(self, name, value, attrs):
|
||||
return self.templatecontext
|
Reference in New Issue
Block a user