pg.ddx.io  pgsql-www@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[PATCH v2] Introduce contributor badges
45+ messages / 7 participants
[nested] [flat]

* [PATCH v2] Introduce contributor badges
@ 2026-01-05 22:03  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-01-05 22:03 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they a can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable to prevent these entries from showing up on the contributors
page. If a user later contributes more, we can simply set the field to
the desired recognized contributors status.)

Badges are represented by pictures. These are currently stored
externally and will manually be added to the pgweb repo in media/badges/
(or be external URLs). We can move them into the database later if
manual management of them turns out to be too much work.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)
- The badge image is mailed to contributors@postgresql.org
- The contributors team adds the image to git and updates the filename
  stored in the Badge object

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 pgweb/account/urls.py                  |  2 +-
 pgweb/account/views.py                 | 16 ++++-
 pgweb/contributors/admin.py            | 20 +++++-
 pgweb/contributors/forms.py            | 92 ++++++++++++++++++++++++++
 pgweb/contributors/models.py           | 48 ++++++++++++--
 pgweb/contributors/views.py            | 28 +++++++-
 pgweb/core/forms.py                    |  2 +-
 pgweb/urls.py                          |  5 +-
 pgweb/util/contexts.py                 |  2 +
 pgweb/util/moderation.py               |  3 +-
 templates/account/index.html           |  7 +-
 templates/account/userprofileform.html | 29 +++++++-
 templates/contributors/badge.html      | 45 +++++++++++++
 templates/contributors/list.html       | 27 ++++----
 templates/contributors/people.html     | 42 ++++++++++++
 templates/contributors/profile.html    | 64 ++++++++++++++++++
 16 files changed, 402 insertions(+), 30 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: pgweb/account/urls.py, pgweb/account/views.py, pgweb/contributors/admin.py and 13 more (+402/-30 lines) download inline-1.patchdiff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index 4f6cfa78..54fd7e3e 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -126,6 +126,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -143,11 +148,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -179,7 +186,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contributor = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -212,6 +221,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index cdb733b9..71024b36 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge class ContributorAdminForm(forms.ModelForm): @@ -18,9 +19,24 @@ class ContributorAdmin(admin.ModelAdmin): autocomplete_fields = ['user', ] list_display = ('__str__', 'user', 'ctype',) list_filter = ('ctype',) - ordering = ('firstname', 'lastname',) + ordering = ('ctype', 'lastname', 'firstname') search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..54dbdd23 --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,92 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to remove") + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'image', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['remove_holder', 'add_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['remove_holder'].queryset = self.instance.holders + else: + del self.fields['remove_holder'] + del self.fields['add_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + model = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + model.holders.add(user) + ops.append('Added badge holder {}'.format(user.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + model.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, model), + "The following changes were made to {}:\n\n{}".format(model, "\n".join(ops)) + ) + + return model + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 342cddb2..f189a1a3 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,8 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel class ContributorType(models.Model): @@ -19,22 +22,59 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') - lastname = models.CharField(max_length=100, null=False, blank=False) + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) + lastname = models.CharField(max_length=100, null=False, blank=False) email = models.EmailField(null=False, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') + help_text='Describe what you did in the PostgreSQL community') user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + image = models.CharField(max_length=100, verbose_name='Path to contribution image', null=True, blank=True, help_text="Badge images should be square (usually shown at 150x150 pixels). When left blank, the Slony logo will be used. External URLs work, but preferably the image should be hosted on postgresql.org. Mail the Contributors team to have your image added.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url', 'image'] + + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..4f920c38 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,7 @@ +from django.shortcuts import get_object_or_404 from pgweb.util.contexts import render_pgweb -from .models import ContributorType +from .models import ContributorType, Contributor, Badge def completelist(request): @@ -8,3 +9,28 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = list(Contributor.objects.all()) + badges = list(Badge.objects.filter(approved=True)) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = list(Badge.objects.filter(approved=True, holders=contributor.user)) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index d73f3151..599f4bf7 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index d9b81f75..2bb875f7 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -70,9 +70,12 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index 412b7b61..d4c00a25 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -45,6 +45,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -84,6 +85,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 45db593f..841908ae 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -156,7 +156,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..ab292476 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,30 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <table class="table"> + <tbody> + {%for b in badges %} + {%if forloop.counter0|divisibleby:"4" %} + {%if not forloop.first%}</tr>{%endif%} + <tr> + {%endif%} + <td align="center"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"><br> + {{b}} + </a> + </td> + {%if forloop.last%}</tr>{%endif%} + {%endfor%} + </tbody> + </table> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +137,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..b35d6e3e --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,45 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>{{badge}} <i class="fa fa-code"></i></h1> +<p><img src="{%if badge.image %}{{badge.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Contributors</h2> +<ul> + {%for u in badge.holders.all%} + {%for c in u.contributor_set.all%} + <li><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a></li> + {%endfor%} + {%endfor%} +</ul> +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..01659045 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} <h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> -<p>These are the fine people that make PostgreSQL what it is today!</p> - <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people that make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..79689ece --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,42 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people that have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}·{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> +<table class="table"> + <tbody> + {%for b in badges %} + {%if forloop.counter0|divisibleby:"4" %} + {%if not forloop.first%}</tr>{%endif%} + <tr> + {%endif%} + <td align="center"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"><br> + {{b}} + </a> + </td> + {%if forloop.last%}</tr>{%endif%} + {%endfor%} + </tbody> +</table> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..c7efaa44 --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,64 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <table class="table"> + <tbody> + {%for b in badges %} + {%if forloop.counter0|divisibleby:"4" %} + {%if not forloop.first%}</tr>{%endif%} + <tr> + {%endif%} + <td align="center"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"><br> + {{b}} + </a> + </td> + {%if forloop.last%}</tr>{%endif%} + {%endfor%} + </tbody> + </table> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.51.0
--5MSjHfPoqsxdXc0M-- ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v2] Introduce contributor badges
@ 2026-01-05 22:03  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-01-05 22:03 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they a can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable to prevent these entries from showing up on the contributors
page. If a user later contributes more, we can simply set the field to
the desired recognized contributors status.)

Badges are represented by pictures. These are currently stored
externally and will manually be added to the pgweb repo in media/badges/
(or be external URLs). We can move them into the database later if
manual management of them turns out to be too much work.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)
- The badge image is mailed to contributors@postgresql.org
- The contributors team adds the image to git and updates the filename
  stored in the Badge object

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 pgweb/account/urls.py                  |  2 +-
 pgweb/account/views.py                 | 16 ++++-
 pgweb/contributors/admin.py            | 20 +++++-
 pgweb/contributors/forms.py            | 92 ++++++++++++++++++++++++++
 pgweb/contributors/models.py           | 48 ++++++++++++--
 pgweb/contributors/views.py            | 28 +++++++-
 pgweb/core/forms.py                    |  2 +-
 pgweb/urls.py                          |  5 +-
 pgweb/util/contexts.py                 |  2 +
 pgweb/util/moderation.py               |  3 +-
 templates/account/index.html           |  7 +-
 templates/account/userprofileform.html | 29 +++++++-
 templates/contributors/badge.html      | 45 +++++++++++++
 templates/contributors/list.html       | 27 ++++----
 templates/contributors/people.html     | 42 ++++++++++++
 templates/contributors/profile.html    | 64 ++++++++++++++++++
 16 files changed, 402 insertions(+), 30 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: pgweb/account/urls.py, pgweb/account/views.py, pgweb/contributors/admin.py and 13 more (+402/-30 lines) download inline-1.patchdiff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index 4f6cfa78..54fd7e3e 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -126,6 +126,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -143,11 +148,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -179,7 +186,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contributor = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -212,6 +221,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index cdb733b9..71024b36 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge class ContributorAdminForm(forms.ModelForm): @@ -18,9 +19,24 @@ class ContributorAdmin(admin.ModelAdmin): autocomplete_fields = ['user', ] list_display = ('__str__', 'user', 'ctype',) list_filter = ('ctype',) - ordering = ('firstname', 'lastname',) + ordering = ('ctype', 'lastname', 'firstname') search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..54dbdd23 --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,92 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to remove") + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'image', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['remove_holder', 'add_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['remove_holder'].queryset = self.instance.holders + else: + del self.fields['remove_holder'] + del self.fields['add_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + model = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + model.holders.add(user) + ops.append('Added badge holder {}'.format(user.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + model.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, model), + "The following changes were made to {}:\n\n{}".format(model, "\n".join(ops)) + ) + + return model + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 342cddb2..f189a1a3 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,8 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel class ContributorType(models.Model): @@ -19,22 +22,59 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') - lastname = models.CharField(max_length=100, null=False, blank=False) + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) + lastname = models.CharField(max_length=100, null=False, blank=False) email = models.EmailField(null=False, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') + help_text='Describe what you did in the PostgreSQL community') user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + image = models.CharField(max_length=100, verbose_name='Path to contribution image', null=True, blank=True, help_text="Badge images should be square (usually shown at 150x150 pixels). When left blank, the Slony logo will be used. External URLs work, but preferably the image should be hosted on postgresql.org. Mail the Contributors team to have your image added.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url', 'image'] + + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..4f920c38 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,7 @@ +from django.shortcuts import get_object_or_404 from pgweb.util.contexts import render_pgweb -from .models import ContributorType +from .models import ContributorType, Contributor, Badge def completelist(request): @@ -8,3 +9,28 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = list(Contributor.objects.all()) + badges = list(Badge.objects.filter(approved=True)) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = list(Badge.objects.filter(approved=True, holders=contributor.user)) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index d73f3151..599f4bf7 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index d9b81f75..2bb875f7 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -70,9 +70,12 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index 412b7b61..d4c00a25 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -45,6 +45,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -84,6 +85,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 45db593f..841908ae 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -156,7 +156,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..ab292476 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,30 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <table class="table"> + <tbody> + {%for b in badges %} + {%if forloop.counter0|divisibleby:"4" %} + {%if not forloop.first%}</tr>{%endif%} + <tr> + {%endif%} + <td align="center"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"><br> + {{b}} + </a> + </td> + {%if forloop.last%}</tr>{%endif%} + {%endfor%} + </tbody> + </table> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +137,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..b35d6e3e --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,45 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>{{badge}} <i class="fa fa-code"></i></h1> +<p><img src="{%if badge.image %}{{badge.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Contributors</h2> +<ul> + {%for u in badge.holders.all%} + {%for c in u.contributor_set.all%} + <li><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a></li> + {%endfor%} + {%endfor%} +</ul> +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..01659045 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} <h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> -<p>These are the fine people that make PostgreSQL what it is today!</p> - <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people that make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..79689ece --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,42 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people that have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}·{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> +<table class="table"> + <tbody> + {%for b in badges %} + {%if forloop.counter0|divisibleby:"4" %} + {%if not forloop.first%}</tr>{%endif%} + <tr> + {%endif%} + <td align="center"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"><br> + {{b}} + </a> + </td> + {%if forloop.last%}</tr>{%endif%} + {%endfor%} + </tbody> +</table> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..c7efaa44 --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,64 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <table class="table"> + <tbody> + {%for b in badges %} + {%if forloop.counter0|divisibleby:"4" %} + {%if not forloop.first%}</tr>{%endif%} + <tr> + {%endif%} + <td align="center"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"><br> + {{b}} + </a> + </td> + {%if forloop.last%}</tr>{%endif%} + {%endfor%} + </tbody> + </table> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.51.0
--5MSjHfPoqsxdXc0M-- ^ permalink raw reply [nested|flat] 45+ messages in thread

* Introduce contributor badges
@ 2026-01-19 16:28  Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-01-19 16:28 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: Melanie Plageman <melanieplageman@gmail.com>; pgsql-www@lists.postgresql.org, PostgreSQL Contributors <contributors@lists.postgresql.org>

Over the holidays, I used the time to implement the badges idea. We've
discussed in the team and we are happy with how it looks like now, and
I'm attaching the version with the changes from the last contributors
team meeting.

The technical description is in the commit message, so I'm not
duplicating that here. It's obviously a larger patch, but since the
badges are new, I'm not sure it's possible to split it up.

To make rollout less disruptive, we could deploy everything, but leave
out the part that creates links to the new parts
(pgweb/util/contexts.py, anything else?). That way we could test
everything, prefill some initial badges and badge holders, and put in
the links once everything is confirmed to work.

I also plan to present the design at the dev meeting in Brussels.


Re: Magnus Hagander
> If they are not based on the recognized contributors, they should probably
> not be part of that in the data model either. But in particular, we
> shouldn't start creating empty contributor profiles before we even *knoiw*
> that it would.

That part works like this in the patch:
- badges are awarded to users (not to contributors)
- users who have at least one badge are offered to create a profile
  page (creates the contributors object)
- these users can then fill in the data fields

> So any user without any confirmation can just add themselves as a
> contributor, without even moderation, and publish data? That sounds like a
> *really* bad idea, tbh.
> 
> If it's data published by users where we have at one point added them to
> the contributors list and therefore pre-moderated to some point that is
> reasonable. But allowing random people to add records and then edit them
> and then it turns out to be published is going to be a hard no -- we've
> spent many hundreds of hours dealing with that on the wiki for example, and
> we will definitely not open up another venue for that. If it's things that
> not-specifically-approved users can add, then it *must* be moderated.

The moderation part is that people have to convince a badge-issuing
organisation to add their pg.o account as badge holder. This is
possibly a lot of organisations and people, but everyone involved
should be a recognised community member. Also, the worst harm would be
that could publish a random text on a ..../username/ sub-page that is
easily deleted again if we monitor changes. (Afaict any changes to
contributor objects are mailed somewhere. Not sure if that includes
the bio part already, but it could certainly made to be.)

> The latest one that includes that field. Doing that makes the "manage.py
> makemigration" no longer think there are any changes and stop emitting
> anything for that object.

I haven't included the migrations in the patch yet, will do that after
review of the general feature.

> > As for the questions - I think we should absolutely do opt-in, and I do
> > think it makes sense to auto-opt-in the current major contributors since
> > "it's been like that forever and they haven't complained", but listing the
> > others and in a more visible way there are sure to be some who might not
> > want it. In particular, maybe we should make the listing of *email* a
> > separate opt-in/opt-out? That is you can opt-out of being listed
> > completely, or you can say "list me, but not my email"?
> >
> > So there would be a separate opt-in for being listed on the recognized
> > contributor page and for having a public individual contributor
> > profile? And we would only auto opt-in major contributors to the
> > public individual contributor profiles?
> 
> When writing that I was not aware that you were intending to have both a
> "recognized contributor" and a "self-claimed contributor". That does change
> it a bit. If it's a self-claimed contributor then it doesn't make much
> sense to opt-out.

The listing is opt-in. If the user never clicks the "create a profile
page" button, their name is not shown. Not even in the list of badge
holders on the badge page.

Once we have this system, the expectation would be that anyone who
we'd want to promote to a recognized contributor would already have a
profile page created. (If not, we should ask them first why.)

> I think Christoph made a good point about this -- once the contributor
> profile requires an account, which it does in order to get published here,
> they can opt out by just changing their email to being empty. It's only for
> contributors that do not have an account connected that *we* need the email
> (so we can reach them), but with the discussed plan those wouldn't be
> listed anyway  since a username is needed in order to get listed. So that
> should leave us without needing a separate opt-out.

Contributor.email is currently still "null=False, blank=True", should
probably change that to null=True.

> Per above, if it is a field that any user can directly edit and it goes to
> publication, it must be moderated. That's a hard requirement. Before we
> made the whole "make me an editor" requirement for the wiki, for examples,
> we had upwards of 10,000 new accounts signed up every day just to post spam
> when it hit the peak.
> 
> We might need to add more moderators for it, but it needs to be moderated :)

(See above) Even if that's people who have already proven to have
contributed something useful?

> What does it mean that we would get notifications for them? Is "we"
> > the contributors committee?
> 
> Right now, there's just the one moderation team and address that gets it
> for all types of objects. But it would probably be relatively easy to split
> that up so there could be multiple moderation-and-notification teams.

That might make sense. Or some of the contributors team members get an
extra job at pgweb moderation...

Christoph

Attachments:

  v2-0001-Introduce-contributor-badges.patch (text/x-diff, 0B) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-01-20 11:56  Andrey Borodin <x4mmm@yandex-team.ru>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Andrey Borodin @ 2026-01-20 11:56 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; pgsql-www@lists.postgresql.org, PostgreSQL Contributors <contributors@lists.postgresql.org>



> On 19 Jan 2026, at 21:28, Christoph Berg <myon@debian.org> wrote:
> 
> Over the holidays, I used the time to implement the badges idea. We've
> discussed in the team and we are happy with how it looks like now, and
> I'm attaching the version with the changes from the last contributors
> team meeting.

Thanks for working on this! Looks great!
I've setup preview version to test how things will look like. There's some generated sample data.

http://89.169.141.31:8000/community/people/alice/
ogin:moderator pwd:moderator123 
orgmanager1 manager123 
orgmanager2 manager123 
alice alice123 -- Has 3 badges + profile page
bob bob123 -- Has 2 bandges
charlie charlie123 -- 2 badges, without profile


I'm slightly worried that user does not approve their badges.
Also do we plan to add a page where user can claim a badge so org admin can approve their claim?

And I find it a bit oxymoron: "Basic contributor, not recognized"


Best regards, Andrey Borodin.




^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-01-20 12:11  Christoph Berg <myon@debian.org>
  parent: Andrey Borodin <x4mmm@yandex-team.ru>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-01-20 12:11 UTC (permalink / raw)
  To: Andrey Borodin <x4mmm@yandex-team.ru>; +Cc: Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; pgsql-www@lists.postgresql.org, PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Andrey Borodin
> Thanks for working on this! Looks great!
> I've setup preview version to test how things will look like. There's some generated sample data.
> 
> http://89.169.141.31:8000/community/people/alice/

Thanks, that makes review a bit easier for everyone else I guess.

The "people" page there has a problem:
http://89.169.141.31:8000/community/people/
It's not happening here, so I can't say if that's a bug in the patch.

> I'm slightly worried that user does not approve their badges.

The idea is that the badge itself needs approval and then is trusted.
So I think the worst thing that could happen is that someone
legitimately creates a "PostgreSQL Conf Antarctica Speaker", awards it
to you, but you don't want to publicly admit that you've been there.
Anything I'm missing?

> Also do we plan to add a page where user can claim a badge so org admin can approve their claim?

I think the basic workflow is that people contribute, an organisation
creates a badge for it and awards it to these people. For example,
after the PG19 release, we would create a "PostgreSQL 19 Contributor"
badge and award it to everyone listed in the release notes. Similarly
for conference speakers.

Maybe the other way round shouldn't be too easy so badge issuers don't
get flooded with requests. That's why we put the email link there.

Perhaps we need to make sure all approved badges have clear criteria
for badge holders. For example, "Has said something useful on the
mailing list" would be very fuzzy and invite request spam too much.

> And I find it a bit oxymoron: "Basic contributor, not recognized"

That's there to make the distinction to recognized contributors clear.
Better suggestions welcome.

Christoph





^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-01-20 12:52  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-01-20 12:52 UTC (permalink / raw)
  To: Andrey Borodin <x4mmm@yandex-team.ru>; +Cc: Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; pgsql-www@lists.postgresql.org, PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: To Andrey Borodin
> It's not happening here, so I can't say if that's a bug in the patch.

My mail client recoded the attachment as latin1. I'll replace the "·"
there by &middot; , that's cleaner anyway.

Christoph





^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-01-23 10:14  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-01-23 10:14 UTC (permalink / raw)
  To: Andrey Borodin <x4mmm@yandex-team.ru>; +Cc: Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; pgsql-www@lists.postgresql.org, PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: To Andrey Borodin
> My mail client recoded the attachment as latin1. I'll replace the "·"
> there by &middot; , that's cleaner anyway.

New version attached, with ^ this change and rebased.

Christoph

Attachments:

  v3-0001-Introduce-contributor-badges.patch.gz (application/gzip, 9.5K) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-01-23 19:03  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-01-23 19:03 UTC (permalink / raw)
  To: Andrey Borodin <x4mmm@yandex-team.ru>; +Cc: Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; pgsql-www@lists.postgresql.org, PostgreSQL Contributors <contributors@lists.postgresql.org>

More polishing done, now including the database migration script.

Christoph

Attachments:

  v4-0001-Introduce-contributor-badges.patch.gz (application/gzip, 10.6K) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* [PATCH v7 3/5] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures. These are currently stored
externally and will manually be added to the pgweb repo in media/badges/
(or be external URLs). We can move them into the database later if
manual management of them turns out to be too much work.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)
- The badge image is mailed to contributors@postgresql.org
- The contributors team adds the image to git and updates the filename
  stored in the Badge object

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            | 22 +++++
 pgweb/account/forms.py                        |  2 +-
 pgweb/account/urls.py                         |  2 +-
 pgweb/account/views.py                        | 16 +++-
 pgweb/contributors/admin.py                   | 18 +++-
 pgweb/contributors/forms.py                   | 92 +++++++++++++++++++
 pgweb/contributors/migrations/0001_initial.py |  2 +-
 pgweb/contributors/models.py                  | 50 +++++++++-
 pgweb/contributors/views.py                   | 34 ++++++-
 pgweb/core/forms.py                           |  2 +-
 pgweb/urls.py                                 |  5 +-
 pgweb/util/contexts.py                        |  2 +
 pgweb/util/moderation.py                      |  3 +-
 templates/account/index.html                  |  7 +-
 templates/account/userprofileform.html        | 22 ++++-
 templates/contributors/badge.html             | 49 ++++++++++
 templates/contributors/list.html              | 29 +++---
 templates/contributors/people.html            | 36 ++++++++
 templates/contributors/profile.html           | 57 ++++++++++++
 19 files changed, 417 insertions(+), 33 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 16 more (+417/-33 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..71024b36 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,20 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..54dbdd23 --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,92 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to remove") + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'image', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['remove_holder', 'add_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['remove_holder'].queryset = self.instance.holders + else: + del self.fields['remove_holder'] + del self.fields['add_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + model = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + model.holders.add(user) + ops.append('Added badge holder {}'.format(user.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + model.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, model), + "The following changes were made to {}:\n\n{}".format(model, "\n".join(ops)) + ) + + return model + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..4a0532ba 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,8 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel class ContributorType(models.Model): @@ -19,22 +22,59 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + image = models.CharField(max_length=100, verbose_name='Path to contribution image', null=True, blank=True, help_text="Badge images should be square (usually shown at 150x150 pixels). When left blank, the Slony logo will be used. External URLs work, but preferably the image should be hosted on postgresql.org. Mail the Contributors team to have your image added.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url', 'image'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..ee0124ac 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,8 @@ +from django.shortcuts import get_object_or_404 + from pgweb.util.contexts import render_pgweb -from .models import ContributorType +from .models import ContributorType, Contributor, Badge def completelist(request): @@ -8,3 +10,33 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = badge.holders.filter(contributor__isnull=False). \ + prefetch_related('contributor'). \ + order_by('contributor__lastname', 'contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badge.objects.filter(approved=True, holders=contributor.user) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..50eb4acc 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,12 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..4d6fc04a 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..16c995ca --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.image %}{{badge.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a> {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a></li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..20950de3 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..eca38dc2 --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename=v7-0004-Add-dates-on-badgeholders-so-people-can-be-retire.patch ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v8 3/3] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures, preferably square and 150x150,
stored in a ImageBinaryField.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status, and a badge
  image
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>/
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

community/badge/<number>/image/
  -- the badge image

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            |  22 +++
 pgweb/account/forms.py                        |   2 +-
 pgweb/account/urls.py                         |   2 +-
 pgweb/account/views.py                        |  16 +-
 pgweb/contributors/admin.py                   |  19 +-
 pgweb/contributors/forms.py                   | 106 ++++++++++
 pgweb/contributors/migrations/0001_initial.py |   2 +-
 ..._ctype_alter_contributor_email_and_more.py | 182 ++++++++++++++++++
 pgweb/contributors/models.py                  |  74 ++++++-
 pgweb/contributors/views.py                   |  51 ++++-
 pgweb/core/forms.py                           |   2 +-
 pgweb/urls.py                                 |   6 +-
 pgweb/util/contexts.py                        |   2 +
 pgweb/util/moderation.py                      |   3 +-
 templates/account/index.html                  |   7 +-
 templates/account/userprofileform.html        |  22 ++-
 templates/base/form_contents.html             |   2 +-
 templates/contributors/badge.html             |  49 +++++
 templates/contributors/list.html              |  29 +--
 templates/contributors/people.html            |  36 ++++
 templates/contributors/profile.html           |  57 ++++++
 21 files changed, 657 insertions(+), 34 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 18 more (+657/-34 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..9bedc4cd 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge, Badgeholder class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,21 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) +admin.site.register(Badgeholder) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..a2bc587f --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,106 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge, Badgeholder +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + +from datetime import date + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + retire_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to retire.") + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Retired badge holders", help_text="Select one or more users to remove. To un-retire a user, add their email address again in the first field.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'imagedata', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['add_holder', 'retire_holder', 'remove_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['retire_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=True) + self.fields['remove_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=False) + else: + del self.fields['add_holder'] + del self.fields['retire_holder'] + del self.fields['remove_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + badge = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + holder = Badgeholder.objects.get_or_create(user=user, badge=badge, awarded_by=get_current_user())[0] + if holder.date_retired: # un-retire them + holder.date_retired = None + holder.save() + ops.append('Un-retired badge holder {}'.format(user.username)) + else: + ops.append('Added badge holder {}'.format(user.username)) + if 'retire_holder' in self.cleaned_data and self.cleaned_data['retire_holder']: + for toretire in self.cleaned_data['retire_holder']: + Badgeholder.objects.filter(user=toretire).update(date_retired=date.today()) + ops.append('Retired badge holder {}'.format(toretire.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + badge.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, badge), + "The following changes were made to {}:\n\n{}".format(badge, "\n".join(ops)) + ) + + return badge + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py new file mode 100644 index 00000000..ed6734d5 --- /dev/null +++ b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py @@ -0,0 +1,182 @@ +# Generated by Django 5.2.16 on 2026-07-29 12:45 + +import django.db.models.deletion +import pgweb.util.fields +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("contributors", "0003_make_email_nullable"), + ("core", "0007_usersubmissions"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AlterField( + model_name="contributor", + name="ctype", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="contributors.contributortype", + verbose_name="Contributor Type", + ), + ), + migrations.AlterField( + model_name="contributor", + name="email", + field=models.EmailField(blank=True, max_length=254, null=True), + ), + migrations.AlterField( + model_name="contributor", + name="user", + field=models.OneToOneField( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.CreateModel( + name="Badge", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("approved", models.BooleanField(default=False)), + ( + "badge", + models.CharField( + help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".', + max_length=32, + unique=True, + ), + ), + ( + "description", + models.TextField( + blank=True, + help_text="What did the people do who contributed here?", + null=True, + ), + ), + ( + "url", + models.URLField( + blank=True, + help_text="URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)", + max_length=100, + null=True, + verbose_name="Contribution URL", + ), + ), + ( + "imagedata", + pgweb.util.fields.ImageBinaryField( + blank=True, + help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.", + max_length=1000000, + null=True, + verbose_name="Image", + ), + ), + ( + "contact", + models.CharField( + blank=True, + help_text="Contact address (email, URL, other) for people who want to be added as badge holder", + max_length=100, + null=True, + verbose_name="Contact address", + ), + ), + ("sortorder", models.IntegerField(blank=True, default=100, null=True)), + ( + "org", + models.ForeignKey( + help_text='If no organisations are listed here, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if no managers are listed. If your organisation is not listed, you can <a href="/account/edit/organisations/">create it</a>.', + on_delete=django.db.models.deletion.CASCADE, + to="core.organisation", + verbose_name="Organisation", + ), + ), + ], + options={ + "ordering": ("sortorder", "badge"), + }, + ), + migrations.CreateModel( + name="Badgeholder", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date_awarded", models.DateField(auto_now_add=True)), + ("date_retired", models.DateField(blank=True, null=True)), + ( + "awarded_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="awarded_by", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "badge", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="contributors.badge", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "ordering": ( + "badge__sortorder", + "badge", + "user__last_name", + "user__first_name", + ), + }, + ), + migrations.AddField( + model_name="badge", + name="holders", + field=models.ManyToManyField( + blank=True, + through="contributors.Badgeholder", + through_fields=("badge", "user"), + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.AddConstraint( + model_name="badgeholder", + constraint=models.UniqueConstraint( + fields=("user", "badge"), name="unique_user_badge" + ), + ), + ] diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..11589d36 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,9 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel +from pgweb.util.fields import ImageBinaryField class ContributorType(models.Model): @@ -19,22 +23,82 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, through="Badgeholder", through_fields=("badge", "user"), blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm + + +class Badgeholder(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + badge = models.ForeignKey(Badge, on_delete=models.CASCADE) + + date_awarded = models.DateField(auto_now_add=True) + date_retired = models.DateField(null=True, blank=True) + awarded_by = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL, related_name="awarded_by") + + purge_urls = ('/community/people/', '/community/badge/') + + def __str__(self): + label = f"{self.badge} {self.user.first_name} {self.user.last_name} ({self.user})" + if self.date_retired: + label += " (retired)" + return label + + class Meta: + ordering = ('badge__sortorder', 'badge', 'user__last_name', 'user__first_name') + constraints = [ + models.UniqueConstraint(fields=["user", "badge"], name="unique_user_badge") + ] diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..f439671c 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,12 @@ +import hashlib + +from django.shortcuts import get_object_or_404 +from django.http import HttpResponse, HttpResponseNotModified, Http404 + from pgweb.util.contexts import render_pgweb +from pgweb.util.image import get_image_contenttype_from_bytes -from .models import ContributorType +from .models import ContributorType, Contributor, Badge, Badgeholder def completelist(request): @@ -8,3 +14,46 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = Badgeholder.objects.filter(badge=badge, user__contributor__isnull=False). \ + prefetch_related('user__contributor'). \ + order_by('user__contributor__lastname', 'user__contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badgeholder.objects.filter(user=contributor.user, badge__approved=True) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) + + +def badge_image(request, badgeid): + badge = get_object_or_404(Badge.objects.only('id', 'imagedata'), id=badgeid, approved=True) + if not badge.imagedata: + raise Http404 + etag = '"' + hashlib.md5(bytes(badge.imagedata)).hexdigest() + '"' + if request.headers.get('If-None-Match') == etag: + return HttpResponseNotModified() + return HttpResponse( + bytes(badge.imagedata), + content_type=get_image_contenttype_from_bytes(badge.imagedata[:8]), + ) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..8bbdfdf6 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,13 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/badge/(\d+)/image/$', pgweb.contributors.views.badge_image), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..c6c49e52 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/base/form_contents.html b/templates/base/form_contents.html index 9a00c216..4f9b4263 100644 --- a/templates/base/form_contents.html +++ b/templates/base/form_contents.html @@ -1,5 +1,5 @@ {%load pgfilters%} -<form class="form-horizontal" method="post" action=".">{%if not nocsrf%}{% csrf_token %}{%endif%} +<form class="form-horizontal" method="post" action="."{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>{%if not nocsrf%}{% csrf_token %}{%endif%} {%if form.errors %} <div class="alert alert-danger"> Please correct the errors below, and re-submit the form. diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..0e2cee40 --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.imagedata %}/community/badge/{{badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%}</em>{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..ce192cd7 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..fc2eaabc --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.badge.id}}/"> + <img src="{%if b.badge.imagedata %}/community/badge/{{b.badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b.badge}}{%if b.date_retired%}<br><em>(retired)</em>{%endif%}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti-- ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v7 3/5] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures. These are currently stored
externally and will manually be added to the pgweb repo in media/badges/
(or be external URLs). We can move them into the database later if
manual management of them turns out to be too much work.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)
- The badge image is mailed to contributors@postgresql.org
- The contributors team adds the image to git and updates the filename
  stored in the Badge object

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            | 22 +++++
 pgweb/account/forms.py                        |  2 +-
 pgweb/account/urls.py                         |  2 +-
 pgweb/account/views.py                        | 16 +++-
 pgweb/contributors/admin.py                   | 18 +++-
 pgweb/contributors/forms.py                   | 92 +++++++++++++++++++
 pgweb/contributors/migrations/0001_initial.py |  2 +-
 pgweb/contributors/models.py                  | 50 +++++++++-
 pgweb/contributors/views.py                   | 34 ++++++-
 pgweb/core/forms.py                           |  2 +-
 pgweb/urls.py                                 |  5 +-
 pgweb/util/contexts.py                        |  2 +
 pgweb/util/moderation.py                      |  3 +-
 templates/account/index.html                  |  7 +-
 templates/account/userprofileform.html        | 22 ++++-
 templates/contributors/badge.html             | 49 ++++++++++
 templates/contributors/list.html              | 29 +++---
 templates/contributors/people.html            | 36 ++++++++
 templates/contributors/profile.html           | 57 ++++++++++++
 19 files changed, 417 insertions(+), 33 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 16 more (+417/-33 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..71024b36 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,20 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..54dbdd23 --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,92 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to remove") + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'image', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['remove_holder', 'add_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['remove_holder'].queryset = self.instance.holders + else: + del self.fields['remove_holder'] + del self.fields['add_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + model = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + model.holders.add(user) + ops.append('Added badge holder {}'.format(user.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + model.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, model), + "The following changes were made to {}:\n\n{}".format(model, "\n".join(ops)) + ) + + return model + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..4a0532ba 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,8 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel class ContributorType(models.Model): @@ -19,22 +22,59 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + image = models.CharField(max_length=100, verbose_name='Path to contribution image', null=True, blank=True, help_text="Badge images should be square (usually shown at 150x150 pixels). When left blank, the Slony logo will be used. External URLs work, but preferably the image should be hosted on postgresql.org. Mail the Contributors team to have your image added.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url', 'image'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..ee0124ac 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,8 @@ +from django.shortcuts import get_object_or_404 + from pgweb.util.contexts import render_pgweb -from .models import ContributorType +from .models import ContributorType, Contributor, Badge def completelist(request): @@ -8,3 +10,33 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = badge.holders.filter(contributor__isnull=False). \ + prefetch_related('contributor'). \ + order_by('contributor__lastname', 'contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badge.objects.filter(approved=True, holders=contributor.user) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..50eb4acc 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,12 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..4d6fc04a 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..16c995ca --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.image %}{{badge.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a> {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a></li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..20950de3 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..eca38dc2 --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename=v7-0004-Add-dates-on-badgeholders-so-people-can-be-retire.patch ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v8 3/3] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures, preferably square and 150x150,
stored in a ImageBinaryField.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status, and a badge
  image
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>/
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

community/badge/<number>/image/
  -- the badge image

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            |  22 +++
 pgweb/account/forms.py                        |   2 +-
 pgweb/account/urls.py                         |   2 +-
 pgweb/account/views.py                        |  16 +-
 pgweb/contributors/admin.py                   |  19 +-
 pgweb/contributors/forms.py                   | 106 ++++++++++
 pgweb/contributors/migrations/0001_initial.py |   2 +-
 ..._ctype_alter_contributor_email_and_more.py | 182 ++++++++++++++++++
 pgweb/contributors/models.py                  |  74 ++++++-
 pgweb/contributors/views.py                   |  51 ++++-
 pgweb/core/forms.py                           |   2 +-
 pgweb/urls.py                                 |   6 +-
 pgweb/util/contexts.py                        |   2 +
 pgweb/util/moderation.py                      |   3 +-
 templates/account/index.html                  |   7 +-
 templates/account/userprofileform.html        |  22 ++-
 templates/base/form_contents.html             |   2 +-
 templates/contributors/badge.html             |  49 +++++
 templates/contributors/list.html              |  29 +--
 templates/contributors/people.html            |  36 ++++
 templates/contributors/profile.html           |  57 ++++++
 21 files changed, 657 insertions(+), 34 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 18 more (+657/-34 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..9bedc4cd 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge, Badgeholder class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,21 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) +admin.site.register(Badgeholder) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..a2bc587f --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,106 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge, Badgeholder +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + +from datetime import date + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + retire_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to retire.") + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Retired badge holders", help_text="Select one or more users to remove. To un-retire a user, add their email address again in the first field.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'imagedata', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['add_holder', 'retire_holder', 'remove_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['retire_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=True) + self.fields['remove_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=False) + else: + del self.fields['add_holder'] + del self.fields['retire_holder'] + del self.fields['remove_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + badge = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + holder = Badgeholder.objects.get_or_create(user=user, badge=badge, awarded_by=get_current_user())[0] + if holder.date_retired: # un-retire them + holder.date_retired = None + holder.save() + ops.append('Un-retired badge holder {}'.format(user.username)) + else: + ops.append('Added badge holder {}'.format(user.username)) + if 'retire_holder' in self.cleaned_data and self.cleaned_data['retire_holder']: + for toretire in self.cleaned_data['retire_holder']: + Badgeholder.objects.filter(user=toretire).update(date_retired=date.today()) + ops.append('Retired badge holder {}'.format(toretire.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + badge.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, badge), + "The following changes were made to {}:\n\n{}".format(badge, "\n".join(ops)) + ) + + return badge + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py new file mode 100644 index 00000000..ed6734d5 --- /dev/null +++ b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py @@ -0,0 +1,182 @@ +# Generated by Django 5.2.16 on 2026-07-29 12:45 + +import django.db.models.deletion +import pgweb.util.fields +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("contributors", "0003_make_email_nullable"), + ("core", "0007_usersubmissions"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AlterField( + model_name="contributor", + name="ctype", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="contributors.contributortype", + verbose_name="Contributor Type", + ), + ), + migrations.AlterField( + model_name="contributor", + name="email", + field=models.EmailField(blank=True, max_length=254, null=True), + ), + migrations.AlterField( + model_name="contributor", + name="user", + field=models.OneToOneField( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.CreateModel( + name="Badge", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("approved", models.BooleanField(default=False)), + ( + "badge", + models.CharField( + help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".', + max_length=32, + unique=True, + ), + ), + ( + "description", + models.TextField( + blank=True, + help_text="What did the people do who contributed here?", + null=True, + ), + ), + ( + "url", + models.URLField( + blank=True, + help_text="URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)", + max_length=100, + null=True, + verbose_name="Contribution URL", + ), + ), + ( + "imagedata", + pgweb.util.fields.ImageBinaryField( + blank=True, + help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.", + max_length=1000000, + null=True, + verbose_name="Image", + ), + ), + ( + "contact", + models.CharField( + blank=True, + help_text="Contact address (email, URL, other) for people who want to be added as badge holder", + max_length=100, + null=True, + verbose_name="Contact address", + ), + ), + ("sortorder", models.IntegerField(blank=True, default=100, null=True)), + ( + "org", + models.ForeignKey( + help_text='If no organisations are listed here, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if no managers are listed. If your organisation is not listed, you can <a href="/account/edit/organisations/">create it</a>.', + on_delete=django.db.models.deletion.CASCADE, + to="core.organisation", + verbose_name="Organisation", + ), + ), + ], + options={ + "ordering": ("sortorder", "badge"), + }, + ), + migrations.CreateModel( + name="Badgeholder", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date_awarded", models.DateField(auto_now_add=True)), + ("date_retired", models.DateField(blank=True, null=True)), + ( + "awarded_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="awarded_by", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "badge", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="contributors.badge", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "ordering": ( + "badge__sortorder", + "badge", + "user__last_name", + "user__first_name", + ), + }, + ), + migrations.AddField( + model_name="badge", + name="holders", + field=models.ManyToManyField( + blank=True, + through="contributors.Badgeholder", + through_fields=("badge", "user"), + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.AddConstraint( + model_name="badgeholder", + constraint=models.UniqueConstraint( + fields=("user", "badge"), name="unique_user_badge" + ), + ), + ] diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..11589d36 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,9 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel +from pgweb.util.fields import ImageBinaryField class ContributorType(models.Model): @@ -19,22 +23,82 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, through="Badgeholder", through_fields=("badge", "user"), blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm + + +class Badgeholder(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + badge = models.ForeignKey(Badge, on_delete=models.CASCADE) + + date_awarded = models.DateField(auto_now_add=True) + date_retired = models.DateField(null=True, blank=True) + awarded_by = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL, related_name="awarded_by") + + purge_urls = ('/community/people/', '/community/badge/') + + def __str__(self): + label = f"{self.badge} {self.user.first_name} {self.user.last_name} ({self.user})" + if self.date_retired: + label += " (retired)" + return label + + class Meta: + ordering = ('badge__sortorder', 'badge', 'user__last_name', 'user__first_name') + constraints = [ + models.UniqueConstraint(fields=["user", "badge"], name="unique_user_badge") + ] diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..f439671c 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,12 @@ +import hashlib + +from django.shortcuts import get_object_or_404 +from django.http import HttpResponse, HttpResponseNotModified, Http404 + from pgweb.util.contexts import render_pgweb +from pgweb.util.image import get_image_contenttype_from_bytes -from .models import ContributorType +from .models import ContributorType, Contributor, Badge, Badgeholder def completelist(request): @@ -8,3 +14,46 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = Badgeholder.objects.filter(badge=badge, user__contributor__isnull=False). \ + prefetch_related('user__contributor'). \ + order_by('user__contributor__lastname', 'user__contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badgeholder.objects.filter(user=contributor.user, badge__approved=True) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) + + +def badge_image(request, badgeid): + badge = get_object_or_404(Badge.objects.only('id', 'imagedata'), id=badgeid, approved=True) + if not badge.imagedata: + raise Http404 + etag = '"' + hashlib.md5(bytes(badge.imagedata)).hexdigest() + '"' + if request.headers.get('If-None-Match') == etag: + return HttpResponseNotModified() + return HttpResponse( + bytes(badge.imagedata), + content_type=get_image_contenttype_from_bytes(badge.imagedata[:8]), + ) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..8bbdfdf6 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,13 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/badge/(\d+)/image/$', pgweb.contributors.views.badge_image), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..c6c49e52 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/base/form_contents.html b/templates/base/form_contents.html index 9a00c216..4f9b4263 100644 --- a/templates/base/form_contents.html +++ b/templates/base/form_contents.html @@ -1,5 +1,5 @@ {%load pgfilters%} -<form class="form-horizontal" method="post" action=".">{%if not nocsrf%}{% csrf_token %}{%endif%} +<form class="form-horizontal" method="post" action="."{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>{%if not nocsrf%}{% csrf_token %}{%endif%} {%if form.errors %} <div class="alert alert-danger"> Please correct the errors below, and re-submit the form. diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..0e2cee40 --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.imagedata %}/community/badge/{{badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%}</em>{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..ce192cd7 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..fc2eaabc --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.badge.id}}/"> + <img src="{%if b.badge.imagedata %}/community/badge/{{b.badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b.badge}}{%if b.date_retired%}<br><em>(retired)</em>{%endif%}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti-- ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v8 3/3] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures, preferably square and 150x150,
stored in a ImageBinaryField.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status, and a badge
  image
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>/
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

community/badge/<number>/image/
  -- the badge image

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            |  22 +++
 pgweb/account/forms.py                        |   2 +-
 pgweb/account/urls.py                         |   2 +-
 pgweb/account/views.py                        |  16 +-
 pgweb/contributors/admin.py                   |  19 +-
 pgweb/contributors/forms.py                   | 106 ++++++++++
 pgweb/contributors/migrations/0001_initial.py |   2 +-
 ..._ctype_alter_contributor_email_and_more.py | 182 ++++++++++++++++++
 pgweb/contributors/models.py                  |  74 ++++++-
 pgweb/contributors/views.py                   |  51 ++++-
 pgweb/core/forms.py                           |   2 +-
 pgweb/urls.py                                 |   6 +-
 pgweb/util/contexts.py                        |   2 +
 pgweb/util/moderation.py                      |   3 +-
 templates/account/index.html                  |   7 +-
 templates/account/userprofileform.html        |  22 ++-
 templates/base/form_contents.html             |   2 +-
 templates/contributors/badge.html             |  49 +++++
 templates/contributors/list.html              |  29 +--
 templates/contributors/people.html            |  36 ++++
 templates/contributors/profile.html           |  57 ++++++
 21 files changed, 657 insertions(+), 34 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 18 more (+657/-34 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..9bedc4cd 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge, Badgeholder class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,21 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) +admin.site.register(Badgeholder) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..a2bc587f --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,106 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge, Badgeholder +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + +from datetime import date + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + retire_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to retire.") + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Retired badge holders", help_text="Select one or more users to remove. To un-retire a user, add their email address again in the first field.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'imagedata', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['add_holder', 'retire_holder', 'remove_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['retire_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=True) + self.fields['remove_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=False) + else: + del self.fields['add_holder'] + del self.fields['retire_holder'] + del self.fields['remove_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + badge = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + holder = Badgeholder.objects.get_or_create(user=user, badge=badge, awarded_by=get_current_user())[0] + if holder.date_retired: # un-retire them + holder.date_retired = None + holder.save() + ops.append('Un-retired badge holder {}'.format(user.username)) + else: + ops.append('Added badge holder {}'.format(user.username)) + if 'retire_holder' in self.cleaned_data and self.cleaned_data['retire_holder']: + for toretire in self.cleaned_data['retire_holder']: + Badgeholder.objects.filter(user=toretire).update(date_retired=date.today()) + ops.append('Retired badge holder {}'.format(toretire.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + badge.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, badge), + "The following changes were made to {}:\n\n{}".format(badge, "\n".join(ops)) + ) + + return badge + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py new file mode 100644 index 00000000..ed6734d5 --- /dev/null +++ b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py @@ -0,0 +1,182 @@ +# Generated by Django 5.2.16 on 2026-07-29 12:45 + +import django.db.models.deletion +import pgweb.util.fields +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("contributors", "0003_make_email_nullable"), + ("core", "0007_usersubmissions"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AlterField( + model_name="contributor", + name="ctype", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="contributors.contributortype", + verbose_name="Contributor Type", + ), + ), + migrations.AlterField( + model_name="contributor", + name="email", + field=models.EmailField(blank=True, max_length=254, null=True), + ), + migrations.AlterField( + model_name="contributor", + name="user", + field=models.OneToOneField( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.CreateModel( + name="Badge", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("approved", models.BooleanField(default=False)), + ( + "badge", + models.CharField( + help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".', + max_length=32, + unique=True, + ), + ), + ( + "description", + models.TextField( + blank=True, + help_text="What did the people do who contributed here?", + null=True, + ), + ), + ( + "url", + models.URLField( + blank=True, + help_text="URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)", + max_length=100, + null=True, + verbose_name="Contribution URL", + ), + ), + ( + "imagedata", + pgweb.util.fields.ImageBinaryField( + blank=True, + help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.", + max_length=1000000, + null=True, + verbose_name="Image", + ), + ), + ( + "contact", + models.CharField( + blank=True, + help_text="Contact address (email, URL, other) for people who want to be added as badge holder", + max_length=100, + null=True, + verbose_name="Contact address", + ), + ), + ("sortorder", models.IntegerField(blank=True, default=100, null=True)), + ( + "org", + models.ForeignKey( + help_text='If no organisations are listed here, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if no managers are listed. If your organisation is not listed, you can <a href="/account/edit/organisations/">create it</a>.', + on_delete=django.db.models.deletion.CASCADE, + to="core.organisation", + verbose_name="Organisation", + ), + ), + ], + options={ + "ordering": ("sortorder", "badge"), + }, + ), + migrations.CreateModel( + name="Badgeholder", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date_awarded", models.DateField(auto_now_add=True)), + ("date_retired", models.DateField(blank=True, null=True)), + ( + "awarded_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="awarded_by", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "badge", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="contributors.badge", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "ordering": ( + "badge__sortorder", + "badge", + "user__last_name", + "user__first_name", + ), + }, + ), + migrations.AddField( + model_name="badge", + name="holders", + field=models.ManyToManyField( + blank=True, + through="contributors.Badgeholder", + through_fields=("badge", "user"), + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.AddConstraint( + model_name="badgeholder", + constraint=models.UniqueConstraint( + fields=("user", "badge"), name="unique_user_badge" + ), + ), + ] diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..11589d36 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,9 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel +from pgweb.util.fields import ImageBinaryField class ContributorType(models.Model): @@ -19,22 +23,82 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, through="Badgeholder", through_fields=("badge", "user"), blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm + + +class Badgeholder(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + badge = models.ForeignKey(Badge, on_delete=models.CASCADE) + + date_awarded = models.DateField(auto_now_add=True) + date_retired = models.DateField(null=True, blank=True) + awarded_by = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL, related_name="awarded_by") + + purge_urls = ('/community/people/', '/community/badge/') + + def __str__(self): + label = f"{self.badge} {self.user.first_name} {self.user.last_name} ({self.user})" + if self.date_retired: + label += " (retired)" + return label + + class Meta: + ordering = ('badge__sortorder', 'badge', 'user__last_name', 'user__first_name') + constraints = [ + models.UniqueConstraint(fields=["user", "badge"], name="unique_user_badge") + ] diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..f439671c 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,12 @@ +import hashlib + +from django.shortcuts import get_object_or_404 +from django.http import HttpResponse, HttpResponseNotModified, Http404 + from pgweb.util.contexts import render_pgweb +from pgweb.util.image import get_image_contenttype_from_bytes -from .models import ContributorType +from .models import ContributorType, Contributor, Badge, Badgeholder def completelist(request): @@ -8,3 +14,46 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = Badgeholder.objects.filter(badge=badge, user__contributor__isnull=False). \ + prefetch_related('user__contributor'). \ + order_by('user__contributor__lastname', 'user__contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badgeholder.objects.filter(user=contributor.user, badge__approved=True) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) + + +def badge_image(request, badgeid): + badge = get_object_or_404(Badge.objects.only('id', 'imagedata'), id=badgeid, approved=True) + if not badge.imagedata: + raise Http404 + etag = '"' + hashlib.md5(bytes(badge.imagedata)).hexdigest() + '"' + if request.headers.get('If-None-Match') == etag: + return HttpResponseNotModified() + return HttpResponse( + bytes(badge.imagedata), + content_type=get_image_contenttype_from_bytes(badge.imagedata[:8]), + ) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..8bbdfdf6 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,13 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/badge/(\d+)/image/$', pgweb.contributors.views.badge_image), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..c6c49e52 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/base/form_contents.html b/templates/base/form_contents.html index 9a00c216..4f9b4263 100644 --- a/templates/base/form_contents.html +++ b/templates/base/form_contents.html @@ -1,5 +1,5 @@ {%load pgfilters%} -<form class="form-horizontal" method="post" action=".">{%if not nocsrf%}{% csrf_token %}{%endif%} +<form class="form-horizontal" method="post" action="."{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>{%if not nocsrf%}{% csrf_token %}{%endif%} {%if form.errors %} <div class="alert alert-danger"> Please correct the errors below, and re-submit the form. diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..0e2cee40 --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.imagedata %}/community/badge/{{badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%}</em>{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..ce192cd7 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..fc2eaabc --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.badge.id}}/"> + <img src="{%if b.badge.imagedata %}/community/badge/{{b.badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b.badge}}{%if b.date_retired%}<br><em>(retired)</em>{%endif%}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti-- ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v7 3/5] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures. These are currently stored
externally and will manually be added to the pgweb repo in media/badges/
(or be external URLs). We can move them into the database later if
manual management of them turns out to be too much work.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)
- The badge image is mailed to contributors@postgresql.org
- The contributors team adds the image to git and updates the filename
  stored in the Badge object

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            | 22 +++++
 pgweb/account/forms.py                        |  2 +-
 pgweb/account/urls.py                         |  2 +-
 pgweb/account/views.py                        | 16 +++-
 pgweb/contributors/admin.py                   | 18 +++-
 pgweb/contributors/forms.py                   | 92 +++++++++++++++++++
 pgweb/contributors/migrations/0001_initial.py |  2 +-
 pgweb/contributors/models.py                  | 50 +++++++++-
 pgweb/contributors/views.py                   | 34 ++++++-
 pgweb/core/forms.py                           |  2 +-
 pgweb/urls.py                                 |  5 +-
 pgweb/util/contexts.py                        |  2 +
 pgweb/util/moderation.py                      |  3 +-
 templates/account/index.html                  |  7 +-
 templates/account/userprofileform.html        | 22 ++++-
 templates/contributors/badge.html             | 49 ++++++++++
 templates/contributors/list.html              | 29 +++---
 templates/contributors/people.html            | 36 ++++++++
 templates/contributors/profile.html           | 57 ++++++++++++
 19 files changed, 417 insertions(+), 33 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 16 more (+417/-33 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..71024b36 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,20 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..54dbdd23 --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,92 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to remove") + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'image', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['remove_holder', 'add_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['remove_holder'].queryset = self.instance.holders + else: + del self.fields['remove_holder'] + del self.fields['add_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + model = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + model.holders.add(user) + ops.append('Added badge holder {}'.format(user.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + model.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, model), + "The following changes were made to {}:\n\n{}".format(model, "\n".join(ops)) + ) + + return model + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..4a0532ba 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,8 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel class ContributorType(models.Model): @@ -19,22 +22,59 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + image = models.CharField(max_length=100, verbose_name='Path to contribution image', null=True, blank=True, help_text="Badge images should be square (usually shown at 150x150 pixels). When left blank, the Slony logo will be used. External URLs work, but preferably the image should be hosted on postgresql.org. Mail the Contributors team to have your image added.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url', 'image'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..ee0124ac 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,8 @@ +from django.shortcuts import get_object_or_404 + from pgweb.util.contexts import render_pgweb -from .models import ContributorType +from .models import ContributorType, Contributor, Badge def completelist(request): @@ -8,3 +10,33 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = badge.holders.filter(contributor__isnull=False). \ + prefetch_related('contributor'). \ + order_by('contributor__lastname', 'contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badge.objects.filter(approved=True, holders=contributor.user) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..50eb4acc 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,12 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..4d6fc04a 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..16c995ca --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.image %}{{badge.image}}{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a> {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li><a href="/community/people/{{u}}/">{{u.first_name}} {{u.last_name}}</a></li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..20950de3 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..eca38dc2 --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.image %}{{b.image}}{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename=v7-0004-Add-dates-on-badgeholders-so-people-can-be-retire.patch ^ permalink raw reply [nested|flat] 45+ messages in thread

* [PATCH v8 3/3] Introduce contributor badges
@ 2026-04-24 16:16  Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:16 UTC (permalink / raw)

Previously only recognized contributors would be listed on the
contributor profiles page. In order to be able to recognize more people,
we introduce contributor badges. A badge is an award for a contribution
to PostgreSQL like "PostgreSQL 18 Contributor" (as per the contributor
list in the release notes), "PGConf.EU 2025 Speaker", "London PG Meetup
Organizer" or anything else that contributed to PostgreSQL in a positive
way. Ecosystem projects are invited to create badges, e.g. "Patroni
Contributor" or "Talking Postgres Guest".

Technically, we introduce a new "Badge" Django object in the
contributors namespace, to be administrated by the contributors team.
The existing "submit a new xxx" workflow is extended to include badges
which are tied to organisations like the existing other objects. New
badges are subject to moderation, but once approved, the submitting
organisation can edit the badge, most importantly to add more badge
holders.

Once an individual has been awarded a badge, they can create a profile
page from their account page, and optionally supply a bio. This extends
the existing "Contributor" object in Django, but the page is put under
the /community/people/ tree to separate it from the existing
/community/contributors/ page which will be kept as the curated list of
recognized Major and Significant Contributors. (contributor.ctype is now
NULLable, and NULL entries will not show up on the contributors page. If
a user later contributes more, we can simply set the field to the
desired recognized contributors status.)

Badges are represented by pictures, preferably square and 150x150,
stored in a ImageBinaryField.

The badges workflow can be summarized as follows:

- An individual can submit the form to make an Organization
- A pgweb moderator can approve the organization
- An Organization manager can submit the form to make a new Badge
  including contact info for requesting badge holder status, and a badge
  image
- A pgweb moderator can approve the new badge
- An Organization manager can add Badge holders (before or after
  approval of the Badge but the holders won't show anywhere until
  approved)

- A User can request a badge to become a Badge holder by emailing the
  badge contact info on the Badge page
- A User who is a Badge holder can check a box to get a profile page
  (makes a Contributor table entry, but we do not formally call them
  contributors in the pages)
- The user can fill in their contributors bio to have it show up in
  /community/people/<username>/.

New Pages introduced:
community/people/<username>/
  -- profile page

community/people/
  -- all badge holders and all badges

community/badge/<number>/
  -- badge info (image, description text, URL)
  -- badge holders
  -- badge request contact email address (hopefully if they added it)

community/badge/<number>/image/
  -- the badge image

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Christoph Berg <myon@debian.org>
---
 media/css/main.css                            |  22 +++
 pgweb/account/forms.py                        |   2 +-
 pgweb/account/urls.py                         |   2 +-
 pgweb/account/views.py                        |  16 +-
 pgweb/contributors/admin.py                   |  19 +-
 pgweb/contributors/forms.py                   | 106 ++++++++++
 pgweb/contributors/migrations/0001_initial.py |   2 +-
 ..._ctype_alter_contributor_email_and_more.py | 182 ++++++++++++++++++
 pgweb/contributors/models.py                  |  74 ++++++-
 pgweb/contributors/views.py                   |  51 ++++-
 pgweb/core/forms.py                           |   2 +-
 pgweb/urls.py                                 |   6 +-
 pgweb/util/contexts.py                        |   2 +
 pgweb/util/moderation.py                      |   3 +-
 templates/account/index.html                  |   7 +-
 templates/account/userprofileform.html        |  22 ++-
 templates/base/form_contents.html             |   2 +-
 templates/contributors/badge.html             |  49 +++++
 templates/contributors/list.html              |  29 +--
 templates/contributors/people.html            |  36 ++++
 templates/contributors/profile.html           |  57 ++++++
 21 files changed, 657 insertions(+), 34 deletions(-)
 create mode 100644 pgweb/contributors/forms.py
 create mode 100644 pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py
 create mode 100644 templates/contributors/badge.html
 create mode 100644 templates/contributors/people.html
 create mode 100644 templates/contributors/profile.html

inline patch 1: media/css/main.css, pgweb/account/forms.py, pgweb/account/urls.py and 18 more (+657/-34 lines) download inline-1.patchdiff --git a/media/css/main.css b/media/css/main.css index 7e9ebf18..2e823553 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1737,6 +1737,28 @@ table.contributor-table thead tr th { width: 50%; } +.badges-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 4px; +} +.badges-cell { + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} +.badges-cell img { + width: 100%; + aspect-ratio: 1 / 1; + object-fit: cover; + display: block; +} +.badges-cell figcaption { + text-align: center; + padding: 4px; +} + /* News archive */ #pgContentWrap span.newstag { white-space: nowrap; diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 1d0d8907..dba18aff 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -173,7 +173,7 @@ class UserForm(forms.ModelForm): class ContributorForm(forms.ModelForm): class Meta: model = Contributor - exclude = ('ctype', 'user', ) # these fields are not user-editable + exclude = ('ctype', 'user', ) # these fields are not user-editable class AddEmailForm(forms.Form): diff --git a/pgweb/account/urls.py b/pgweb/account/urls.py index 12ad5955..a5621d22 100644 --- a/pgweb/account/urls.py +++ b/pgweb/account/urls.py @@ -26,7 +26,7 @@ urlpatterns = [ # Submitted items re_path(r'^(?P<objtype>news)/(?P<item>\d+)/(?P<what>submit|withdraw)/$', pgweb.account.views.submitted_item_submitwithdraw), - re_path(r'^(?P<objtype>news|events|products|organisations|services)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), + re_path(r'^(?P<objtype>news|events|products|organisations|services|badges)/(?P<item>\d+|new)/$', pgweb.account.views.submitted_item_form), re_path(r'^organisations/confirm/([0-9a-f]+)/$', pgweb.account.views.confirm_org_email), # Markdown preview (silly to have in /account/, but that's where all the markdown forms are so meh) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index cbc0bbf9..936b2f23 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -35,7 +35,7 @@ from pgweb.news.models import NewsArticle, NewsPostingEmbargo from pgweb.events.models import Event from pgweb.core.models import Organisation, UserProfile, ModerationNotification from pgweb.core.models import OrganisationEmail -from pgweb.contributors.models import Contributor +from pgweb.contributors.models import Contributor, Badge from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService @@ -124,6 +124,11 @@ objtypes = { 'submit_header': '<h3>Submit organisation</h3>Before submitting a new Organisation, please verify on the list of <a href="/account/orglist/">current organisations</a> if the organisation already exists. If it does, please contact the manager of the organisation to gain permissions.', 'editapproved': True, }, + 'badges': { + 'title': 'contributor badge', + 'objects': lambda u: Badge.objects.filter(org__managers=u), + 'editapproved': True, + }, } @@ -141,11 +146,13 @@ def profile(request): can_change_email = (request.user.password != OAUTH_PASSWORD_STORE) # We may have a contributor record - and we only show that part of the - # form if we have it for this user. + # form if we have it for this user. If the user has any badges awarded, + # offer them to create the contributor record. try: contrib = Contributor.objects.get(user=request.user.pk) except Contributor.DoesNotExist: contrib = None + badges = Badge.objects.filter(approved=True, holders=request.user.pk) contribform = None @@ -177,7 +184,9 @@ def profile(request): log.info("User {} changed primary email from {} to {}".format(user.username, oldemail, user.email)) profileform.save() - if contrib: + if badges and 'create_contributor_profile' in request.POST and request.POST['create_contributor_profile']: + contrib = Contributor.objects.create(user=user, firstname=user.first_name, lastname=user.last_name, email=user.email) + elif contrib: contribform.save() if secondaryemailform.cleaned_data.get('email1', ''): sa = SecondaryEmail(user=request.user, email=secondaryemailform.cleaned_data['email1'], token=generate_random_token()) @@ -210,6 +219,7 @@ def profile(request): 'secondaryemailform': secondaryemailform, 'secondaryaddresses': secondaryaddresses, 'secondarypending': any(not a.confirmed for a in secondaryaddresses), + 'badges': badges, 'contribform': contribform, }) diff --git a/pgweb/contributors/admin.py b/pgweb/contributors/admin.py index 33d4d05f..9bedc4cd 100644 --- a/pgweb/contributors/admin.py +++ b/pgweb/contributors/admin.py @@ -1,7 +1,8 @@ from django import forms from django.contrib import admin +from django.db.models import Count -from .models import Contributor, ContributorType +from .models import Contributor, ContributorType, Badge, Badgeholder class ContributorAdminForm(forms.ModelForm): @@ -22,5 +23,21 @@ class ContributorAdmin(admin.ModelAdmin): search_fields = ('firstname', 'lastname', 'user__username',) +class BadgeAdmin(admin.ModelAdmin): + list_display = ('__str__', 'holders_count', 'approved', 'org',) + list_filter = ('approved', 'org',) + autocomplete_fields = ['holders', ] + + def holders_count(self, obj): + return obj.holders_count + + def get_queryset(self, request): + queryset = super().get_queryset(request) + queryset = queryset.annotate(holders_count=Count("holders")) + return queryset + + admin.site.register(ContributorType) admin.site.register(Contributor, ContributorAdmin) +admin.site.register(Badge, BadgeAdmin) +admin.site.register(Badgeholder) diff --git a/pgweb/contributors/forms.py b/pgweb/contributors/forms.py new file mode 100644 index 00000000..a2bc587f --- /dev/null +++ b/pgweb/contributors/forms.py @@ -0,0 +1,106 @@ +from django import forms +from django.forms import ValidationError +from django.conf import settings + +from pgweb.core.models import Organisation +from .models import Contributor, Badge, Badgeholder +from django.contrib.auth.models import User + +from pgweb.util.middleware import get_current_user +from pgweb.mailqueue.util import send_simple_mail + +from datetime import date + + +class UserModelMultipleChoiceField(forms.ModelMultipleChoiceField): + def label_from_instance(self, obj): + contributor = Contributor.objects.filter(user=obj.pk) + if contributor: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}>" + else: + return f"{obj.first_name} {obj.last_name} ({obj.username}) <{obj.email}> (not a contributor yet)" + + +class BadgeForm(forms.ModelForm): + form_intro = 'Contributor badges acknowledge people contributing time to the PostgreSQL project and the ecosystem around it. If you manage an organisation that gives people the opportunity to contribute (like volunteering or speaking at a conference, writing code for an extension, translating messages, helping others use PostgreSQL, organise the community, ...), you can issue a badge to acknowledge these contributions.' + + add_holder = forms.CharField(required=False, help_text="Enter email addresses of postgresql.org user accounts to award the badge to. Separate multiple addresses with whitespace.") + retire_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Current badge holders", help_text="Select one or more users to retire.") + remove_holder = UserModelMultipleChoiceField(required=False, queryset=None, label="Retired badge holders", help_text="Select one or more users to remove. To un-retire a user, add their email address again in the first field.") + + fieldsets = [ + { + 'id': 'general', + 'legend': 'Contributor Badge', + 'fields': ['org', 'badge', 'description', 'url', 'imagedata', 'contact', ], + }, + { + 'id': 'holders', + 'legend': 'Badge Holders', + 'fields': ['add_holder', 'retire_holder', 'remove_holder'], + }, + ] + + class Meta: + model = Badge + exclude = ('approved', 'sortorder', 'holders',) + + def __init__(self, *args, **kwargs): + super(BadgeForm, self).__init__(*args, **kwargs) + if self.instance and self.instance.pk: + self.fields['retire_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=True) + self.fields['remove_holder'].queryset = self.instance.holders.filter(badgeholder__date_retired__isnull=False) + else: + del self.fields['add_holder'] + del self.fields['retire_holder'] + del self.fields['remove_holder'] + # remove the holders fieldset + self.fieldsets = [fs for fs in self.fieldsets if fs['id'] != 'holders'] + + def clean_add_holder(self): + if self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + # something was added - let's make sure the user exists + try: + User.objects.get(email=u.lower()) + except User.DoesNotExist: + raise ValidationError("User with email %s not found" % u) + + return self.cleaned_data['add_holder'] + + def save(self, commit=True): + badge = super(BadgeForm, self).save(commit=False) + + ops = [] + + if 'add_holder' in self.cleaned_data and self.cleaned_data['add_holder']: + for u in self.cleaned_data['add_holder'].split(): + user = User.objects.get(email=u.lower()) + holder = Badgeholder.objects.get_or_create(user=user, badge=badge, awarded_by=get_current_user())[0] + if holder.date_retired: # un-retire them + holder.date_retired = None + holder.save() + ops.append('Un-retired badge holder {}'.format(user.username)) + else: + ops.append('Added badge holder {}'.format(user.username)) + if 'retire_holder' in self.cleaned_data and self.cleaned_data['retire_holder']: + for toretire in self.cleaned_data['retire_holder']: + Badgeholder.objects.filter(user=toretire).update(date_retired=date.today()) + ops.append('Retired badge holder {}'.format(toretire.username)) + if 'remove_holder' in self.cleaned_data and self.cleaned_data['remove_holder']: + for toremove in self.cleaned_data['remove_holder']: + badge.holders.remove(toremove) + ops.append('Removed badge holder {}'.format(toremove.username)) + + if ops: + send_simple_mail( + settings.NOTIFICATION_FROM, + settings.NOTIFICATION_EMAIL, + "{0} modified {1}".format(get_current_user().username, badge), + "The following changes were made to {}:\n\n{}".format(badge, "\n".join(ops)) + ) + + return badge + + def filter_by_user(self, user): + self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True) diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index c7d1bd17..244e2e49 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='This description is currently used for major contributors only')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py new file mode 100644 index 00000000..ed6734d5 --- /dev/null +++ b/pgweb/contributors/migrations/0004_alter_contributor_ctype_alter_contributor_email_and_more.py @@ -0,0 +1,182 @@ +# Generated by Django 5.2.16 on 2026-07-29 12:45 + +import django.db.models.deletion +import pgweb.util.fields +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("contributors", "0003_make_email_nullable"), + ("core", "0007_usersubmissions"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AlterField( + model_name="contributor", + name="ctype", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="contributors.contributortype", + verbose_name="Contributor Type", + ), + ), + migrations.AlterField( + model_name="contributor", + name="email", + field=models.EmailField(blank=True, max_length=254, null=True), + ), + migrations.AlterField( + model_name="contributor", + name="user", + field=models.OneToOneField( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.CreateModel( + name="Badge", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("approved", models.BooleanField(default=False)), + ( + "badge", + models.CharField( + help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".', + max_length=32, + unique=True, + ), + ), + ( + "description", + models.TextField( + blank=True, + help_text="What did the people do who contributed here?", + null=True, + ), + ), + ( + "url", + models.URLField( + blank=True, + help_text="URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)", + max_length=100, + null=True, + verbose_name="Contribution URL", + ), + ), + ( + "imagedata", + pgweb.util.fields.ImageBinaryField( + blank=True, + help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.", + max_length=1000000, + null=True, + verbose_name="Image", + ), + ), + ( + "contact", + models.CharField( + blank=True, + help_text="Contact address (email, URL, other) for people who want to be added as badge holder", + max_length=100, + null=True, + verbose_name="Contact address", + ), + ), + ("sortorder", models.IntegerField(blank=True, default=100, null=True)), + ( + "org", + models.ForeignKey( + help_text='If no organisations are listed here, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if no managers are listed. If your organisation is not listed, you can <a href="/account/edit/organisations/">create it</a>.', + on_delete=django.db.models.deletion.CASCADE, + to="core.organisation", + verbose_name="Organisation", + ), + ), + ], + options={ + "ordering": ("sortorder", "badge"), + }, + ), + migrations.CreateModel( + name="Badgeholder", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date_awarded", models.DateField(auto_now_add=True)), + ("date_retired", models.DateField(blank=True, null=True)), + ( + "awarded_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="awarded_by", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "badge", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="contributors.badge", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "ordering": ( + "badge__sortorder", + "badge", + "user__last_name", + "user__first_name", + ), + }, + ), + migrations.AddField( + model_name="badge", + name="holders", + field=models.ManyToManyField( + blank=True, + through="contributors.Badgeholder", + through_fields=("badge", "user"), + to=settings.AUTH_USER_MODEL, + ), + ), + migrations.AddConstraint( + model_name="badgeholder", + constraint=models.UniqueConstraint( + fields=("user", "badge"), name="unique_user_badge" + ), + ), + ] diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 8f521785..11589d36 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -1,5 +1,9 @@ from django.db import models from django.contrib.auth.models import User +from pgweb.core.models import Organisation +from pgweb.core.text import ORGANISATION_HINT_TEXT +from pgweb.util.moderation import TwostateModerateModel +from pgweb.util.fields import ImageBinaryField class ContributorType(models.Model): @@ -19,22 +23,82 @@ class ContributorType(models.Model): class Contributor(models.Model): - ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE, verbose_name='Contributor Type') + ctype = models.ForeignKey(ContributorType, + on_delete=models.CASCADE, + verbose_name='Contributor Type', null=True, blank=True) firstname = models.CharField(max_length=100, null=False, blank=False) lastname = models.CharField(max_length=100, null=False, blank=False) - email = models.EmailField(null=False, blank=True) + email = models.EmailField(null=True, blank=True) company = models.CharField(max_length=100, null=True, blank=True) companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') - user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) + help_text='Describe what you did in the PostgreSQL community') + user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True - purge_urls = ('/community/contributors/', ) + purge_urls = ('/community/contributors/', '/community/people/', '/community/badge/') def __str__(self): return "%s %s" % (self.firstname, self.lastname) class Meta: ordering = ('lastname', 'firstname',) + + +class Badge(TwostateModerateModel): + org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) + badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') + url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') + imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.") + contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') + holders = models.ManyToManyField(User, through="Badgeholder", through_fields=("badge", "user"), blank=True) + + sortorder = models.IntegerField(null=True, blank=True, default=100) + + account_edit_suburl = 'badges' + moderation_fields = ['badge', 'description', 'url'] + send_notification = True + purge_urls = ('/community/people/', '/community/badge/') + + def verify_submitter(self, user): + return (len(self.org.managers.filter(pk=user.pk)) == 1) + + def __str__(self): + return self.badge + + @property + def title(self): + return self.badge + + class Meta: + ordering = ('sortorder', 'badge') + + @classmethod + def get_formclass(self): + from pgweb.contributors.forms import BadgeForm + return BadgeForm + + +class Badgeholder(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + badge = models.ForeignKey(Badge, on_delete=models.CASCADE) + + date_awarded = models.DateField(auto_now_add=True) + date_retired = models.DateField(null=True, blank=True) + awarded_by = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL, related_name="awarded_by") + + purge_urls = ('/community/people/', '/community/badge/') + + def __str__(self): + label = f"{self.badge} {self.user.first_name} {self.user.last_name} ({self.user})" + if self.date_retired: + label += " (retired)" + return label + + class Meta: + ordering = ('badge__sortorder', 'badge', 'user__last_name', 'user__first_name') + constraints = [ + models.UniqueConstraint(fields=["user", "badge"], name="unique_user_badge") + ] diff --git a/pgweb/contributors/views.py b/pgweb/contributors/views.py index 45b8551e..f439671c 100644 --- a/pgweb/contributors/views.py +++ b/pgweb/contributors/views.py @@ -1,6 +1,12 @@ +import hashlib + +from django.shortcuts import get_object_or_404 +from django.http import HttpResponse, HttpResponseNotModified, Http404 + from pgweb.util.contexts import render_pgweb +from pgweb.util.image import get_image_contenttype_from_bytes -from .models import ContributorType +from .models import ContributorType, Contributor, Badge, Badgeholder def completelist(request): @@ -8,3 +14,46 @@ def completelist(request): return render_pgweb(request, 'community', 'contributors/list.html', { 'contributortypes': contributortypes, }) + + +def peoplelist(request): + people = Contributor.objects.prefetch_related('user') + badges = Badge.objects.filter(approved=True) + return render_pgweb(request, 'community', 'contributors/people.html', { + 'people': people, + 'badges': badges, + }) + + +def badge_view(request, badgeid): + badge = get_object_or_404(Badge, id=badgeid, approved=True) + # badge holders are users, but we want to show only users with a contributor object here + holders = Badgeholder.objects.filter(badge=badge, user__contributor__isnull=False). \ + prefetch_related('user__contributor'). \ + order_by('user__contributor__lastname', 'user__contributor__firstname') + return render_pgweb(request, 'community', 'contributors/badge.html', { + 'badge': badge, + 'holders': holders, + }) + + +def profile(request, username): + contributor = get_object_or_404(Contributor, user__username=username) + badges = Badgeholder.objects.filter(user=contributor.user, badge__approved=True) + return render_pgweb(request, 'community', 'contributors/profile.html', { + 'contributor': contributor, + 'badges': badges, + }) + + +def badge_image(request, badgeid): + badge = get_object_or_404(Badge.objects.only('id', 'imagedata'), id=badgeid, approved=True) + if not badge.imagedata: + raise Http404 + etag = '"' + hashlib.md5(bytes(badge.imagedata)).hexdigest() + '"' + if request.headers.get('If-None-Match') == etag: + return HttpResponseNotModified() + return HttpResponse( + bytes(badge.imagedata), + content_type=get_image_contenttype_from_bytes(badge.imagedata[:8]), + ) diff --git a/pgweb/core/forms.py b/pgweb/core/forms.py index 1609c780..7902e750 100644 --- a/pgweb/core/forms.py +++ b/pgweb/core/forms.py @@ -13,7 +13,7 @@ from pgweb.util.misc import send_template_mail, generate_random_token class OrganisationForm(forms.ModelForm): new_form_intro = """<em>Note!</em> An organisation record is only needed to post news, events, -products or professional services. In particular, it is <em>not</em> necessary to register an +products, professional services or contributor badges. In particular, it is <em>not</em> necessary to register an organisation in order to ask questions or otherwise participate on the PostgreSQL mailing lists, file a bug report, or otherwise interact with the community.""" diff --git a/pgweb/urls.py b/pgweb/urls.py index ce73c951..8bbdfdf6 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -73,9 +73,13 @@ urlpatterns = [ re_path(r'^community/$', pgweb.core.views.community), re_path(r'^community/contributors/$', pgweb.contributors.views.completelist), + re_path(r'^community/people/$', pgweb.contributors.views.peoplelist), + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), + re_path(r'^community/badge/(\d+)/$', pgweb.contributors.views.badge_view), + re_path(r'^community/badge/(\d+)/image/$', pgweb.contributors.views.badge_image), + re_path(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)), re_path(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/';, permanent=True)), - re_path(r'^community/lists/listinfo/$', pgweb.lists.views.listinfo), re_path(r'^community/recognition/$', RedirectView.as_view(url='/about/policies/', permanent=True)), re_path(r'^community/survey/vote/(\d+)/$', pgweb.survey.views.vote), diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA';}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/pgweb/util/moderation.py b/pgweb/util/moderation.py index 1d9a2e3c..2c054800 100644 --- a/pgweb/util/moderation.py +++ b/pgweb/util/moderation.py @@ -160,7 +160,8 @@ def _modclasses(): from pgweb.core.models import Organisation from pgweb.downloads.models import Product from pgweb.profserv.models import ProfessionalService - return [NewsArticle, Event, Organisation, Product, ProfessionalService] + from pgweb.contributors.models import Badge + return [NewsArticle, Event, Organisation, Product, ProfessionalService, Badge] def get_all_pending_moderations(): diff --git a/templates/account/index.html b/templates/account/index.html index 94761e00..4fb74a2e 100644 --- a/templates/account/index.html +++ b/templates/account/index.html @@ -5,8 +5,9 @@ <p> From this section, you can manage all information on this site connected to your PostgreSQL community account. Other than your basic profile -information, this includes news and events, professional services and -comments. Note that most of the data you submit to this site needs to be +information, this includes news and events, professional services, +comments and contributor badges. +Note that most of the data you submit to this site needs to be approved by a moderator before it's published. </p> <p> @@ -16,7 +17,7 @@ type of record in the menu on the left. <h2>Permissions model</h2> <p> -News, Events, Products and Professional Services are attached to an +News, Events, Products, Professional Services and Contributor Badges are attached to an Organisation. One or more persons can be given permissions to manage the data for an organisation. If you do not have permissions for an organisation and think you should have, you need to contact the current diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index 96ed2779..c6c49e52 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -94,9 +94,23 @@ </div> {%endfor%} + {% if badges %} + <h2>Contributor badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {% endif %} + {% if contribform %} <h2>Edit contributor information</h2> - <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately! + <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page. Leave fields blank that you do not wish to make public. Please be careful as your changes will take effect immediately! </p> {% for field in contribform %} <div class="form-group row"> @@ -116,6 +130,12 @@ </div> </div> {% endfor %} + {% elif badges %} + <h2>Create contributor profile</h2> + <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> + <div> + <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + </div> {% endif %} <div class="submit-row"> diff --git a/templates/base/form_contents.html b/templates/base/form_contents.html index 9a00c216..4f9b4263 100644 --- a/templates/base/form_contents.html +++ b/templates/base/form_contents.html @@ -1,5 +1,5 @@ {%load pgfilters%} -<form class="form-horizontal" method="post" action=".">{%if not nocsrf%}{% csrf_token %}{%endif%} +<form class="form-horizontal" method="post" action="."{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>{%if not nocsrf%}{% csrf_token %}{%endif%} {%if form.errors %} <div class="alert alert-danger"> Please correct the errors below, and re-submit the form. diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html new file mode 100644 index 00000000..0e2cee40 --- /dev/null +++ b/templates/contributors/badge.html @@ -0,0 +1,49 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{badge}} - Contribution{%endblock%} +{%block contents%} +<h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> +<p><img src="{%if badge.imagedata %}/community/badge/{{badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> + +{% if badge.description or badge.url %} +<h2>Contribution</h2> +{%endif%} +{% if badge.description %} +<p>{{badge.description}}</p> +{%endif%} +{% if badge.url %} +<p><a href="{{badge.url}}">{{badge.url}}</a></p> +{%endif%} + +{%if badge.holders%} +<h2>Badge Holders</h2> + {%if holders|length > 50%} + {%for u in holders.all %} + <nobr>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%}</em>{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} + {%else%} + <ul> + {%for u in holders.all%} + <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.first_name}} {{u.user.last_name}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li> + {%endfor%} + </ul> + {%endif%} +{%endif%} + +<h2>Getting added</h2> +{% if badge.org %} +<p>This badge is issued by <em>{{badge.org}}</em>.</p> +{%endif%} + +<p>If you think you should be listed + here, check your <a href="/account/profile/">account profile</a> page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.</p> + +{% if badge.contact %} +<p>Contact information: <em>{{badge.contact}}</em>.</p> +{%endif%} + +<p>People are listed in alphabetical order.</p> + +{%endblock%} diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. diff --git a/templates/contributors/people.html b/templates/contributors/people.html new file mode 100644 index 00000000..ce192cd7 --- /dev/null +++ b/templates/contributors/people.html @@ -0,0 +1,36 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}People in the PostgreSQL Community{%endblock%} +{%block contents%} +<h1>People in the PostgreSQL Community <i class="fa fa-users"></i></h1> +<p>These are the fine people who have made contributions to PostgreSQL over the years.</p> + +<p>Recognized Significant and Major Contributors are listed on the + <a href="/community/contributors/">Contributors page</a>. +</p> + +<p style="text-align: justify;"> + {%for c in people %} + <nobr>{%if c.user%}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{%else%}{{c.firstname}} {{c.lastname}}{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + {%endfor%} +</p> + +<p>People are listed in alphabetical order. + If you are listed and want to claim your profile page, write a mail including your community account name to + <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. +</p> + +<h1>Contribution Badges</h1> + +<div class="badges-grid"> +{%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.id}}/"> + <img src="{%if b.imagedata %}/community/badge/{{b.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b}}</figcaption> + </a> + </figure> +{%endfor%} +</div> + +{%endblock%} diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html new file mode 100644 index 00000000..fc2eaabc --- /dev/null +++ b/templates/contributors/profile.html @@ -0,0 +1,57 @@ +{%extends "base/page.html"%} +{%load pgfilters%} +{%block title%}{{contributor.firstname}} {{contributor.lastname}} - Contributor Profile{%endblock%} +{%block contents%} +<h1>{{contributor.firstname}} {{contributor.lastname}} <i class="fa fa-user"></i></h1> + +<div class="row"> + <div class="col-md-8"> + {%if badges%} + <h2>Contribution Badges</h2> + <div class="badges-grid"> + {%for b in badges %} + <figure class="badges-cell"> + <a href="/community/badge/{{b.badge.id}}/"> + <img src="{%if b.badge.imagedata %}/community/badge/{{b.badge.id}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <figcaption>{{b.badge}}{%if b.date_retired%}<br><em>(retired)</em>{%endif%}</figcaption> + </a> + </figure> + {%endfor%} + </div> + {%endif%} + + {%if contributor.contribution%} + <h2>Contribution</h2> + <p>{{contributor.contribution}}</p> + {%endif%} + + <h2>Information</h2> + <dl class="row"> + <dt class="col-sm-3">Contributor Type</dt> + <dd class="col-sm-9">{%if contributor.ctype%}{{contributor.ctype.typename}}{%else%}Basic contributor, not recognized{%endif%}</dd> + + {%if contributor.email%} + <dt class="col-sm-3">Email</dt> + <dd class="col-sm-9">{{contributor.email|hidemail}}</dd> + {%endif%} + + {%if contributor.location%} + <dt class="col-sm-3">Location</dt> + <dd class="col-sm-9">{{contributor.location}}</dd> + {%endif%} + + {%if contributor.company%} + <dt class="col-sm-3">Company</dt> + <dd class="col-sm-9"> + {%if contributor.companyurl%} + <a href="{{contributor.companyurl}}" target="_blank" rel="noopener">{{contributor.company}}</a> + {%else%} + {{contributor.company}} + {%endif%} + </dd> + {%endif%} + </dl> + </div> +</div> + +{%endblock%} -- 2.53.0
--KPM3iI1sUdlvA3ti-- ^ permalink raw reply [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-04-24 16:45  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 2 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:45 UTC (permalink / raw)
  To: pgsql-www@lists.postgresql.org; +Cc: Andrey Borodin <x4mmm@yandex-team.ru>; Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

New version attached. Not much change, the biggest one is perhaps that
lists of badges are no longer rendered as html table, but in a CSS
grid. Everything seems to work as it should now.

My plan is to commit this, minus the menu change in
pgweb/util/contexts.py. That way, we can create the first badges and
check if everything really works without things already being visible
to users (unless they know the URLs).

Christoph





^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-04-24 16:47  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 0 replies; 45+ messages in thread

From: Christoph Berg @ 2026-04-24 16:47 UTC (permalink / raw)
  To: pgsql-www@lists.postgresql.org; +Cc: Andrey Borodin <x4mmm@yandex-team.ru>; Magnus Hagander <magnus@hagander.net>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: To pgsql-www@lists.postgresql.org
> New version attached. Not much change, the biggest one is perhaps that
> lists of badges are no longer rendered as html table, but in a CSS
> grid. Everything seems to work as it should now.

Well, attached now.

Christoph

Attachments:

  v5-0001-Introduce-contributor-badges.patch.gz (application/gzip, 10.7K) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-04-27 11:46  Magnus Hagander <magnus@hagander.net>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 1 reply; 45+ messages in thread

From: Magnus Hagander @ 2026-04-27 11:46 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

On Fri, 24 Apr 2026 at 18:45, Christoph Berg <myon@debian.org> wrote:

> New version attached. Not much change, the biggest one is perhaps that
> lists of badges are no longer rendered as html table, but in a CSS
> grid. Everything seems to work as it should now.
>
> My plan is to commit this, minus the menu change in
> pgweb/util/contexts.py. That way, we can create the first badges and
> check if everything really works without things already being visible
> to users (unless they know the URLs).
>
>
Given the fairly substantial concerns raised ofer this during in-person
discussions at FOSDEM, please do *not* commit this until you have signoff
from those involved. (It might be that it's fine, but given the concerns
and discussions around it, let's make sure those are resolved).

//Magnus

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-04-28 13:06  Christoph Berg <myon@debian.org>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-04-28 13:06 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Magnus Hagander
> Given the fairly substantial concerns raised ofer this during in-person
> discussions at FOSDEM, please do *not* commit this until you have signoff
> from those involved. (It might be that it's fine, but given the concerns
> and discussions around it, let's make sure those are resolved).

I said in the other thread:

> The last result (from the lunch discussion in Brussels) was that we
> need handling of retired people from "permanent" badges like "Sysadmin
> Team". That's not included yet, but in the team, we concluded that
> instead of some complicated date range handling (perhaps that's what
> you remember as plenty?) we can just add a single boolean "retired"
> flag. We don't have that yet, but that's not a big blocker.

I've now implemented retiring from badges. Internally it's tracked by
filling in a date_retired field, but in order not to overcomplicate
the user interface, it's treated as a boolean. Retirees still show up
in badge listing, but are marked as retired.

Removing people from badges is now a two-stage process, retire them
and then remove them. To un-retire someone, add their email address
again (which NULLs the date_retired field).

I'm attaching that as a separate commit for better review. It would
get squashed before committing, of course.

I believe that addresses the concerns from Brussels, or was there
anything else?

Christoph

Attachments:

  v6-0001-Introduce-contributor-badges.patch.gz (application/gzip, 10.8K) download

  v6-0002-Add-dates-on-badgeholders-so-people-can-be-retire.patch.gz (application/gzip, 4.9K) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-07-29 12:51  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-07-29 12:51 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: To Magnus Hagander
> I'm attaching that as a separate commit for better review. It would
> get squashed before committing, of course.
> 
> I believe that addresses the concerns from Brussels, or was there
> anything else?

To finally pick this up again (my fault for slacking): We've talked in
Vancouver and the remaining concern was that the image URLs were
user-configurable free text.

I have now cherry-picked the ImageBinaryField feature from pgeu-system
and image upload is now fully self-contained in the pgweb database.

Attached is v7 of the patch, before squashing:

v7-0001-Cherry-pick-ImageBinaryField-and-related-from-pge.patch
v7-0002-Rewind-uploaded-file-before-reading-in-ImageBinar.patch
  ImageBinaryField and a follow-up fix in there that I'll submit to
  pgeu-system after review

v7-0003-Introduce-contributor-badges.patch
  The original patch
v7-0004-Add-dates-on-badgeholders-so-people-can-be-retire.patch
  The retirement feature
v7-0005-Use-ImageBinaryField-for-the-badges.patch
  The switch to ImageBinaryField

v8 is the same after squashing 0003..0005. (With a better commit
message.)

v7-0001-Cherry-pick-ImageBinaryField-and-related-from-pge.patch
v7-0002-Rewind-uploaded-file-before-reading-in-ImageBinar.patch
v8-0003-Introduce-contributor-badges.patch

Christoph

Attachments:

  v7-0001-Cherry-pick-ImageBinaryField-and-related-from-pge.patch (text/x-diff, 0B) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-09-25 15:46  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-09-25 15:46 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Hi,

thanks Magnus for the in-depth patch review during the Lowlands PGday.

I'm attaching v11.

> I also note that patch 2 doesn't have the changes that went into pgeu. We should probably merge patches 1 and 2 as a single "import frm pgeu-system" and just grab the current head there, since it has progressed since. I can do that when the time comes.

I merged the two patches into 0001, but I don't see any new pgeu
changes that would affect this. What am I missing?

> Is there a reason that OneToOne change to the User model can't be done as a separate thing before this? In the interest of keeping things into easily reviewable pieces?

This is 0002 now.

> nitpick is you can save a bunch of html padding by not adding badges-cell to each cell and instead just use a css rule anchored in badges-grid I think, similar to how you're already doing it for the img just one step higher.
> and since some of these pages can get large quickly...

Done. Please check if I understood that correctly and did the correct
change, though :)

> Patch also contains 73aab7456 which has already been applied... So needs some rebasing.

That should have resolved itself.

> Queries for badges should avoid reading the imagedata in every query that doesn't need it. Using defer — probably by defining a default defer.

Fixed.

> UserModelMultipleChoiceField seems to be a bad name for something that checks Contributors, not Users?

Changed.

> Purging definitely needs to be more specific, we don't want to purge everything including all the images when a contributor is edited.

Also done. Since purges can be limited to specific pages by '...$', I
did not move any URLs around.

> (sprite discussion, will do that one in person )

I took a mental note of the problem - we'll revisit that once we have
too many badges (or better a bit before that).

> For the "list all people" view if we don't want to do pagination at this time can we at least put a temporary ceiling on it so we don't generate an absolutely ginormous page. as in only show the first 500 or something. It'll take time to reach that point, but it will get increasingly painful on the way there.

There's limits now, but I went with 2000. There are 1700 distinct
names mentioned in the release notes since PG10 and I think we would
hit 500 rather quickly.

Christoph

Attachments:

  v11-0001-Cherry-pick-ImageBinaryField-and-related-from-pg.patch.gz (application/gzip, 3.6K) download

  v11-0002-Turn-Contributor.user-into-a-OneToOneField.patch.gz (application/gzip, 1.3K) download

  v11-0003-Introduce-contributor-badges.patch.gz (application/gzip, 11.9K) download

  v11-0004-Make-contributor-badges-discoverable.patch.gz (application/gzip, 1.8K) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-02 11:42  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-02 11:42 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: To Magnus Hagander
> Hi,
> 
> I'm attaching v11.

I am not aware of any open issues - I would like start merging this
next week so we still have some time before pgconf.eu to evaluate.

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-05 07:59  Daniel Gustafsson <daniel@yesql.se>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Daniel Gustafsson @ 2026-10-05 07:59 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

> On 2 Oct 2026, at 13:42, Christoph Berg <myon@debian.org> wrote:

> I would like start merging this next week so we still have some time before
> pgconf.eu to evaluate.

Having this in well before .eu sounds like a very good plan.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-05 14:54  Christoph Berg <myon@debian.org>
  parent: Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 2 replies; 45+ messages in thread

From: Christoph Berg @ 2026-10-05 14:54 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Daniel Gustafsson
> > I would like start merging this next week so we still have some time before
> > pgconf.eu to evaluate.
> 
> Having this in well before .eu sounds like a very good plan.

Thanks. :)

I pushed the first three patches now. Over the weekend I had done more
polishing and fixing of some minor details, as well as several AI
sessions walking through all workflows and confirming things worked.
(They did.) This made me confident to proceed (and Magnus review at
Lowlands sounded like he was ok with the general shape and I believe I
addressed all the points he raised).

The one non-trivial change still done was that badge URLs are now
readable slugs instead of boring IDs. That change was small and
targeted so it didn't feel like requiring another round of reviews.
The slug is fixed on badge creation, so even renaming the badge title
doesn't change it. (It is still admin-editable in the django
interface.)

So the badges infrastructure is in place now on postgresql.org. As
said in the original plan, there are no links to it yet, so we can
still check if everything really works as intended.

Magnus remarked that he wants more review of the patch before we start
adding actual badges, so please everyone check that everything is ok.
The contributors committee still wants to announce the feature at
pgconf.eu (which is 2 weeks from now), so it would be awesome if we
had an answer by the end of this week, and we could add the first
badges (PostgreSQL 19 Contributor?) next week.

The point he raised from a 30s look was that changing the slug doesn't
invalidate the URL from varnish. My stance on that is we don't really
need to cover that because slug changes are rare (admin-interface
only), and we can simply agree to not rename a badge slug after any
users have been added. Also, the new URL works immediately, and the
old one will eventually time out, and there should be nothing in there
that needs immediate deletion (or else we should just edit it and that
is properly purged). We could cover that, but that's more of an
infrastructure change in the pgweb system handling news/events/.../and
now badges.

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-08 00:02  Melanie Plageman <melanieplageman@gmail.com>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 0 replies; 45+ messages in thread

From: Melanie Plageman @ 2026-10-08 00:02 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; PostgreSQL Contributors <contributors@lists.postgresql.org>

On Mon, Oct 5, 2026 at 10:55 AM Christoph Berg <myon@debian.org> wrote:
>
> So the badges infrastructure is in place now on postgresql.org. As
> said in the original plan, there are no links to it yet, so we can
> still check if everything really works as intended.

Yes, I clicked on the links that do work now and looks good to me and
seems as we discussed.

> Magnus remarked that he wants more review of the patch before we start
> adding actual badges, so please everyone check that everything is ok.
> The contributors committee still wants to announce the feature at
> pgconf.eu (which is 2 weeks from now), so it would be awesome if we
> had an answer by the end of this week, and we could add the first
> badges (PostgreSQL 19 Contributor?) next week.

Yes, the Contributors Committee would love to be able to add a few
badges next week before EU. We think it will be fun for contributors
who attend the event to be able to get an initial badge and show them
off to each other at the event.

- Melanie






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-09 17:56  Daniel Gustafsson <daniel@yesql.se>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 2 replies; 45+ messages in thread

From: Daniel Gustafsson @ 2026-10-09 17:56 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

> On 5 Oct 2026, at 16:54, Christoph Berg <myon@debian.org> wrote:

> I pushed the first three patches now.

Thanks for working on this.  I did a first postcommit review and have a few small
comments.

	+    (
	+        "badge",
	+        models.CharField(
	+            help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".',
	+            max_length=32,

Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
Committee" badge as an example would require more than 32, and I can imagine
others like that.  It's good that submissions need to be creative to fit within
a constraint, but we also don't want to end up with needlessly abbreviated
badges.


	+        pgweb.util.fields.ImageBinaryField(
	+            blank=True,
	+            help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.",

While Slony was a great tool back i the day, I think you mean "Slonik logo"
here =) I wonder though, will everyone be familiar with "Slonik" or should we
just say "PostgreSQL logo"?  I also fear that allowing 1MB large image files
opens the risk for getting detailed and feature rich submissions which will
look terrible in 150x150.


	+        models.CharField(
	+            blank=True,
	+            help_text="Contact address (email, URL, other) for people who want to be added as badge holder",

Should we keep it simple and limit this to email for now?  If we encourage
people to visit third party sites we don't control in order to control behavior
on our site then we need to verify said sites.


	-        help_text='This description is currently used for major contributors only')
	+        help_text='Describe what you did in the PostgreSQL community')

This reads like focusing on the past like adding an Alumni entry, shouldn't
this be more like "Describe your involvement in the PostgreSQL community"?

	+      {%for u in holders.all%}
	+        <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li>
	+      {%endfor%}

Rather than wrapping the entry with a conditional <em> it seems like a cleaner
solution to use the condition to set a CSS class which controls the rendering.
This is more a nice-to-have of course.

	+<p>People are listed in alphabetical order.</p>

s/People/Contributors/ ?

	+  If you are listed and want to claim your profile page, write a mail including your community account name to
	+  <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>.

Shouldn't this (and a previous instance of webmaster@) use the hidemail filter
for consistency?

	     contribution = models.TextField(null=True, blank=True,
	-                                    help_text='This description is currently used for major contributors only')
	+                                    help_text='Describe what you did in the PostgreSQL community')

When opening this up to a lot more people than the major contributors, this
field should probably be sanitized when saved (and possibly when read as well)
to keep malicious content out.  Maybe that's already done today and I'm plain
missing that, but if not we need to do that IMO.

I'll revisit the remaining parts in a follow-up look.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-09 18:40  Christoph Berg <myon@debian.org>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-09 18:40 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Daniel Gustafsson
> 	+        "badge",
> 	+        models.CharField(
> 	+            help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".',
> 	+            max_length=32,
> 
> Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
> Committee" badge as an example would require more than 32, and I can imagine
> others like that.  It's good that submissions need to be creative to fit within
> a constraint, but we also don't want to end up with needlessly abbreviated
> badges.

Thanks for the example. One goal here is to have the titles not make
the grid of badges on the people page not explode, but it should of
course not be too restrictive. I guess we need to bump this. (I would
rather limit the length per moderation than technically.)

> 	+        pgweb.util.fields.ImageBinaryField(
> 	+            blank=True,
> 	+            help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.",
> 
> While Slony was a great tool back i the day, I think you mean "Slonik logo"
> here =) I wonder though, will everyone be familiar with "Slonik" or should we
> just say "PostgreSQL logo"?

PostgreSQL logo is better, yes.

> I also fear that allowing 1MB large image files
> opens the risk for getting detailed and feature rich submissions which will
> look terrible in 150x150.

Is that the problem of the limit? People could submit terrible things
even at smaller scales. (Again, perhaps a question for moderation.)

> 	+        models.CharField(
> 	+            blank=True,
> 	+            help_text="Contact address (email, URL, other) for people who want to be added as badge holder",
> 
> Should we keep it simple and limit this to email for now?  If we encourage
> people to visit third party sites we don't control in order to control behavior
> on our site then we need to verify said sites.

This would usually be something like https://2026.pgconf.eu/contact/,
so be in community control. It's also shown at moderation time and
part of the notification emails sent when edited post-moderation (I
think, I don't get moderation email yet). So I think we don't need to
be overly restrictive here. Allowing URLs also enables events without
a persistent email address.

> 	-        help_text='This description is currently used for major contributors only')
> 	+        help_text='Describe what you did in the PostgreSQL community')
> 
> This reads like focusing on the past like adding an Alumni entry, shouldn't
> this be more like "Describe your involvement in the PostgreSQL community"?

Sounds good.

> 	+      {%for u in holders.all%}
> 	+        <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li>
> 	+      {%endfor%}
> 
> Rather than wrapping the entry with a conditional <em> it seems like a cleaner
> solution to use the condition to set a CSS class which controls the rendering.
> This is more a nice-to-have of course.

Ack.

> 	+<p>People are listed in alphabetical order.</p>
> 
> s/People/Contributors/ ?

We deliberately don't say "Contributor" there to keep the perceived
distance to the original now-"recognized" contributors list greater.
Of course everyone in that list did contribute, so this is maybe
splitting hairs...

> 	+  If you are listed and want to claim your profile page, write a mail including your community account name to
> 	+  <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>.
> 
> Shouldn't this (and a previous instance of webmaster@) use the hidemail filter
> for consistency?

Ack.

> 	     contribution = models.TextField(null=True, blank=True,
> 	-                                    help_text='This description is currently used for major contributors only')
> 	+                                    help_text='Describe what you did in the PostgreSQL community')
> 
> When opening this up to a lot more people than the major contributors, this
> field should probably be sanitized when saved (and possibly when read as well)
> to keep malicious content out.  Maybe that's already done today and I'm plain
> missing that, but if not we need to do that IMO.

It's already html-escaped. I was thinking of allowing markdown in the
future (and render only the first paragraph in the recognized
contributors page), but then we'll have the question of links etc
again.

The answer we settled on when we discussed that with Magnus was that
post-moderation by reading the change emails is good enough. Anyone on
that list did something positive for the community, and they will not
want to get kicked out for doing something evil with their profile
page.

> I'll revisit the remaining parts in a follow-up look.

Thanks!

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-12 08:23  Daniel Gustafsson <daniel@yesql.se>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Daniel Gustafsson @ 2026-10-12 08:23 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

> On 9 Oct 2026, at 20:40, Christoph Berg <myon@debian.org> wrote:
> 
> Re: Daniel Gustafsson
>> +        "badge",
>> +        models.CharField(
>> +            help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".',
>> +            max_length=32,
>> 
>> Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
>> Committee" badge as an example would require more than 32, and I can imagine
>> others like that.  It's good that submissions need to be creative to fit within
>> a constraint, but we also don't want to end up with needlessly abbreviated
>> badges.
> 
> Thanks for the example. One goal here is to have the titles not make
> the grid of badges on the people page not explode, but it should of
> course not be too restrictive. I guess we need to bump this. (I would
> rather limit the length per moderation than technically.)

Sounds sensible, bumping the limit and making moderation stricter sounds like a
plan forwards.

>> I also fear that allowing 1MB large image files
>> opens the risk for getting detailed and feature rich submissions which will
>> look terrible in 150x150.
> 
> Is that the problem of the limit? People could submit terrible things
> even at smaller scales. (Again, perhaps a question for moderation.)

They can, but it's a lot easier to mess up when working with an intermediate
representation where the end result is a product of transformation.  I would
start with a more restrictive limit and possibly increase later rather than the
other way around.

>> +<p>People are listed in alphabetical order.</p>
>> 
>> s/People/Contributors/ ?
> 
> We deliberately don't say "Contributor" there to keep the perceived
> distance to the original now-"recognized" contributors list greater.
> Of course everyone in that list did contribute, so this is maybe
> splitting hairs...

That's a fair argument, but "people" sound very generic and more like a
decription of an unknown group.  Maybe "Community members" or something else?

>>     contribution = models.TextField(null=True, blank=True,
>> -                                    help_text='This description is currently used for major contributors only')
>> +                                    help_text='Describe what you did in the PostgreSQL community')
>> 
>> When opening this up to a lot more people than the major contributors, this
>> field should probably be sanitized when saved (and possibly when read as well)
>> to keep malicious content out.  Maybe that's already done today and I'm plain
>> missing that, but if not we need to do that IMO.
> 
> It's already html-escaped.

Good, I missed that when skimming the pgweb code.

> I was thinking of allowing markdown in the
> future (and render only the first paragraph in the recognized
> contributors page), but then we'll have the question of links etc
> again.

Markdown would be nice as a future improvement, if it can be restricted to not
include links.

> The answer we settled on when we discussed that with Magnus was that
> post-moderation by reading the change emails is good enough. Anyone on
> that list did something positive for the community, and they will not
> want to get kicked out for doing something evil with their profile
> page.

Agreed..

>> I'll revisit the remaining parts in a follow-up look.

A few further comments from a second read-through.  I am not particularly
Django-literate so I might well have missed something there.

	+    re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile),

Shouldn't this match the regexp for allowed characters in the username?

	-    <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. 
	+    <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page.

Maybe nitpicking, but this will still be published on the
community/contributors page for a subset of users.  Should the text reflect
that, possibly conditional on the the logged in users controbutor status?

	+    <div>
	+      <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page
	+    </div>

To be consistent with modern HTML (where we are going with pgweb) I think the
<input> should have an id attributed and a <label> for that attribute.

	+<h2>Getting added</h2>
	+{% if badge.org %}
	+<p>This badge is issued by <em>{{badge.org}}</em>.</p>
	+{%endif%}
	+
	+<p>If you think you should be listed
	+  here, check your <a href="/account/profile/">account profile</a> page if the
	+  badge is present there and activate your contribution profile page. If not,
	+  contact the badge issuing organisation and ask to be added.</p>
	+
	+{% if badge.contact %}
	+<p>Contact information: <em>{{badge.contact}}</em>.</p>
	+{%endif%}

A badge can be without both a contact and an org IIUC which, although highly
unlikely, should probably be reflected in the template.  Maybe the entire
"Getting added" section should be omitted if .org and .contact are both blank?

	+ <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}">

All <img> tags must have alt attributes to keep our accessibility score.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-12 13:28  Christoph Berg <myon@debian.org>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-12 13:28 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Daniel Gustafsson
> Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
> Committee" badge as an example would require more than 32, and I can imagine
> others like that.  It's good that submissions need to be creative to fit within
> a constraint, but we also don't want to end up with needlessly abbreviated
> badges.

I've staged a bump to 64 (to match the max slug length). To keep the
migrations churn down, we should bundle that with the next database
update (or when we actually run into the limit).

> While Slony was a great tool back i the day, I think you mean "Slonik logo"
> here =) I wonder though, will everyone be familiar with "Slonik" or should we
> just say "PostgreSQL logo"?  I also fear that allowing 1MB large image files
> opens the risk for getting detailed and feature rich submissions which will
> look terrible in 150x150.

Changed to "PostgreSQL logo" in the attached patch.

> This reads like focusing on the past like adding an Alumni entry, shouldn't
> this be more like "Describe your involvement in the PostgreSQL community"?

Same.

> Rather than wrapping the entry with a conditional <em> it seems like a cleaner
> solution to use the condition to set a CSS class which controls the rendering.
> This is more a nice-to-have of course.

... same.

> Shouldn't this (and a previous instance of webmaster@) use the
> hidemail filter for consistency?

None of the other static appearances of email addresses in the
codebase does that, the @postgresql.org strings are all there in
plain.


Re: Daniel Gustafsson
> >> I also fear that allowing 1MB large image files
> >> opens the risk for getting detailed and feature rich submissions which will
> >> look terrible in 150x150.
> > 
> > Is that the problem of the limit? People could submit terrible things
> > even at smaller scales. (Again, perhaps a question for moderation.)
> 
> They can, but it's a lot easier to mess up when working with an intermediate
> representation where the end result is a product of transformation.  I would
> start with a more restrictive limit and possibly increase later rather than the
> other way around.

I'm unsure here. Which size limit would you suggest?

(TBH I think we shouldn't micro-manage this. If the badge logo looks
terrible, the submitter can still swap it later.)

> That's a fair argument, but "people" sound very generic and more like a
> decription of an unknown group.  Maybe "Community members" or something else?

It currently looks like this:

  http://localhost:8000/community/people/

  People in the PostgreSQL Community

  These are the fine people who have made contributions to PostgreSQL over the years.

  Recognized Significant and Major Contributors are listed on the PostgreSQL Recognized Contributors page.

  Bob Badgeholder · Christoph Berg · Pat Holder


... so before we say "fine people" there the heading and the URL that
already have "people" and put that into context. The wording isn't
mine, it's taken from the existing /community/contributors/ page and
frankly, "the fine community members" isn't that snappy.

> > I was thinking of allowing markdown in the
> > future (and render only the first paragraph in the recognized
> > contributors page), but then we'll have the question of links etc
> > again.
> 
> Markdown would be nice as a future improvement, if it can be restricted to not
> include links.

Ack. I'll keep that for the next iteration.

> >> I'll revisit the remaining parts in a follow-up look.
> 
> A few further comments from a second read-through.  I am not particularly
> Django-literate so I might well have missed something there.
> 
> 	+    re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile),
> 
> Shouldn't this match the regexp for allowed characters in the username?

Most URL patterns in that file don't do that either, and if someone
tries a username that doesn't exist, they just get a 404 error.

> 	-    <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. 
> 	+    <p>You can edit the information that's shown on your <a href="/community/people/{{user.username}}/" target="_blank" rel="noopener">profile</a> page.
> 
> Maybe nitpicking, but this will still be published on the
> community/contributors page for a subset of users.  Should the text reflect
> that, possibly conditional on the the logged in users controbutor status?

The form and this text is only shown if the user already has a
contributor object in the database. Was that the question?

> To be consistent with modern HTML (where we are going with pgweb) I think the
> <input> should have an id attributed and a <label> for that attribute.

Done.

> 	+<h2>Getting added</h2>
> 	+{% if badge.org %}
> 	+<p>This badge is issued by <em>{{badge.org}}</em>.</p>
> 	+{%endif%}
> 	+
> 	+<p>If you think you should be listed
> 	+  here, check your <a href="/account/profile/">account profile</a> page if the
> 	+  badge is present there and activate your contribution profile page. If not,
> 	+  contact the badge issuing organisation and ask to be added.</p>
> 	+
> 	+{% if badge.contact %}
> 	+<p>Contact information: <em>{{badge.contact}}</em>.</p>
> 	+{%endif%}
> 
> A badge can be without both a contact and an org IIUC which, although highly
> unlikely, should probably be reflected in the template.  Maybe the entire
> "Getting added" section should be omitted if .org and .contact are both blank?

The contact information might still be obvious from the context (like
asking the conference organizers), so I'd tend to leave it like it is.
(This is probably a question that is better answered once we have the
first concrete badges in to see how it feels in practise.)

> 	+ <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}">
> 
> All <img> tags must have alt attributes to keep our accessibility score.

Done.

Thanks for the review!

What do you think about the open ends?

Attachments:
v12-0001-Contributor-copy-editing.patch - the stuff from this mail
v12-0001-Make-contributor-badges-discoverable.patch - what will
  actually put the badges live
v12-0001-Extend-badge-title-to-64-chars.patch - future database fix

Assuming v12-0001-Contributor-copy-editing.patch is ok, would you
think that we can proceed with adding some badges now? My hope would
be to have at least "PostgreSQL 18 Contributor" live for Valencia.

Timeline:
after ack: apply v12-0001-Contributor-copy-editing.patch
this week: create initial badges, add holders
           have badges approved in moderation (they are still not visible)
shortly before the conference: apply v12-0001-Make-contributor-badges-discoverable.patch
later: apply v12-0001-Extend-badge-title-to-64-chars.patch

Christoph

Attachments: download all (3 files, .tar.gz)

v12-0001-Contributor-copy-editing.patch (text/x-diff, 10.1K) download From fc08c159e2c0d570da307029cbc43660c86da1f5 Mon Sep 17 00:00:00 2001 From: Christoph Berg <myon@debian.org> Date: Mon, 12 Oct 2026 15:14:39 +0200 Subject: [PATCH v12] Contributor copy-editing Apply finding from Daniel's review: * retired badge holders have a CSS class * contribution field description is "Describe your involvement in the PostgreSQL community" * The logo is the PostgreSQL logo * Badge images have an alt title * "Create contributor profile" checkbox has a proper id and label --- media/css/main.css | 3 +++ pgweb/contributors/migrations/0001_initial.py | 2 +- ...er_contributor_ctype_alter_contributor_email_and_more.py | 2 +- pgweb/contributors/models.py | 4 ++-- templates/account/userprofileform.html | 4 ++-- templates/contributors/badge.html | 6 +++--- templates/contributors/people.html | 2 +- templates/contributors/profile.html | 4 ++-- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/media/css/main.css b/media/css/main.css index 9c4e24d8..a41632d2 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1758,6 +1758,9 @@ table.contributor-table thead tr th { text-align: center; padding: 4px; } +.badgeholder-retired { + font-style: italic; +} /* News archive */ #pgContentWrap span.newstag { diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index 244e2e49..e2121892 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe your involvement in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py b/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py index 75b002aa..87627ccb 100644 --- a/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py +++ b/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py @@ -82,7 +82,7 @@ class Migration(migrations.Migration): "imagedata", pgweb.util.fields.ImageBinaryField( blank=True, - help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.", + help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the PostgreSQL logo will be used.", max_length=1000000, null=True, verbose_name="Image", diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 7ffc0881..7d55a0dc 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -53,7 +53,7 @@ class Contributor(models.Model): companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='Describe what you did in the PostgreSQL community') + help_text='Describe your involvement in the PostgreSQL community') user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True @@ -102,7 +102,7 @@ class Badge(TwostateModerateModel): slug = models.SlugField(max_length=64, null=False, blank=False, unique=True, help_text='URL-friendly identifier for the badge page. Generated from the title when the badge is created, and kept fixed after that.') description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') - imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.") + imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the PostgreSQL logo will be used.") contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') holders = models.ManyToManyField(User, through="Badgeholder", through_fields=("badge", "user"), blank=True) diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index bac04651..01fba575 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -100,7 +100,7 @@ {%for b in badges %} <figure> <a href="/community/badge/{{b.slug}}/"> - <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" alt="{{b}}"> <figcaption>{{b}}</figcaption> </a> </figure> @@ -134,7 +134,7 @@ <h2>Create contributor profile</h2> <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> <div> - <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + <input type="checkbox" name="create_contributor_profile" id="create_contributor_profile"> <label for="create_contributor_profile">Create publicly visible profile page</label> </div> {% endif %} diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html index 1da8f84b..7ea0f1fd 100644 --- a/templates/contributors/badge.html +++ b/templates/contributors/badge.html @@ -3,7 +3,7 @@ {%block title%}{{badge}} - Contribution{%endblock%} {%block contents%} <h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> -<p><img src="{%if badge.has_image %}/community/badge/{{badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> +<p><img src="{%if badge.has_image %}/community/badge/{{badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150" alt="{{badge}}"></p> {% if badge.description or badge.url %} <h2>Contribution</h2> @@ -19,12 +19,12 @@ <h2>Badge Holders</h2> {%if holders|length > 50%} {%for u in holders.all %} - <nobr>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%}</em>{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + <nobr{%if u.date_retired%} class="badgeholder-retired"{%endif%}><a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a> {%if not forloop.last%}&middot;{%endif%}</nobr> {%endfor%} {%else%} <ul> {%for u in holders.all%} - <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li> + <li{%if u.date_retired%} class="badgeholder-retired"{%endif%}><a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%} (retired from this activity){%endif%}</li> {%endfor%} </ul> {%endif%} diff --git a/templates/contributors/people.html b/templates/contributors/people.html index 67de9b9d..37211902 100644 --- a/templates/contributors/people.html +++ b/templates/contributors/people.html @@ -26,7 +26,7 @@ {%for b in badges %} <figure> <a href="/community/badge/{{b.slug}}/"> - <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" alt="{{b}}"> <figcaption>{{b}}</figcaption> </a> </figure> diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html index f4d1afdc..e47bf455 100644 --- a/templates/contributors/profile.html +++ b/templates/contributors/profile.html @@ -12,8 +12,8 @@ {%for b in badges %} <figure> <a href="/community/badge/{{b.badge.slug}}/"> - <img src="{%if b.badge.has_image %}/community/badge/{{b.badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> - <figcaption>{{b.badge}}{%if b.date_retired%}<br><em>(retired)</em>{%endif%}</figcaption> + <img src="{%if b.badge.has_image %}/community/badge/{{b.badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" alt="{{b.badge}}"> + <figcaption{%if b.date_retired%} class="badgeholder-retired"{%endif%}>{{b.badge}}{%if b.date_retired%}<br>(retired){%endif%}</figcaption> </a> </figure> {%endfor%} -- 2.53.0
v12-0001-Extend-badge-title-to-64-chars.patch (text/x-diff, 2.8K) download From abd2ffaed0ecd2a3ec40b255c822d5c9da9dd286 Mon Sep 17 00:00:00 2001 From: Christoph Berg <myon@debian.org> Date: Mon, 12 Oct 2026 14:17:58 +0200 Subject: [PATCH v12] Extend badge title to 64 chars Daniel pointed out that a reasonable badge title like "Nordic PGDay 2026 Program Committee" is already longer than the 32 chars (it's 35) we catered for. Extend it to 64 to match the max slug length. --- .../migrations/0006_alter_badge_badge.py | 25 +++++++++++++++++++ pgweb/contributors/models.py | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 pgweb/contributors/migrations/0006_alter_badge_badge.py diff --git a/pgweb/contributors/migrations/0006_alter_badge_badge.py b/pgweb/contributors/migrations/0006_alter_badge_badge.py new file mode 100644 index 00000000..3f709417 --- /dev/null +++ b/pgweb/contributors/migrations/0006_alter_badge_badge.py @@ -0,0 +1,25 @@ +# Generated by Django 5.2.17 on 2026-10-12 12:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "contributors", + "0005_alter_contributor_ctype_alter_contributor_email_and_more", + ), + ] + + operations = [ + migrations.AlterField( + model_name="badge", + name="badge", + field=models.CharField( + help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".', + max_length=64, + unique=True, + ), + ), + ] diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 7ffc0881..58616da4 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -98,7 +98,7 @@ class BadgeManager(models.Manager): class Badge(TwostateModerateModel): org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) - badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + badge = models.CharField(max_length=64, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') slug = models.SlugField(max_length=64, null=False, blank=False, unique=True, help_text='URL-friendly identifier for the badge page. Generated from the title when the badge is created, and kept fixed after that.') description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') -- 2.53.0
v12-0001-Make-contributor-badges-discoverable.patch (text/x-diff, 5.2K) download From db10a0cc66aa518f4e53139552819659e33b1d1f Mon Sep 17 00:00:00 2001 From: Christoph Berg <myon@debian.org> Date: Fri, 25 Sep 2026 17:29:36 +0200 Subject: [PATCH v12 1/2] Make contributor badges discoverable Add the People entry to the community menu and the Contributor Badges entry to the account's submitted-data menu, and link the recognized contributors list to the new people and profile pages. These are the incoming links from existing pages; the badges system is fully functional without them, so this can be pushed separately after testing. Author: Melanie Plageman <melanieplageman@gmail.com> Author: Christoph Berg <myon@debian.org> --- pgweb/util/contexts.py | 2 ++ templates/contributors/list.html | 29 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..dc60740d 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -47,6 +47,7 @@ sitenav = { 'community': [ {'title': 'Community', 'link': '/community/'}, {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA'}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. -- 2.53.0
^ permalink raw reply [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-14 02:05  Jonathan S. Katz <jkatz@postgresql.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Jonathan S. Katz @ 2026-10-14 02:05 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; Daniel Gustafsson <daniel@yesql.se>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Hi,

Thanks for working on this. I can provide some review on the current 
patches.

On 10/12/26 9:28 AM, Christoph Berg wrote:

> What do you think about the open ends?
> 
> Attachments:
> v12-0001-Contributor-copy-editing.patch - the stuff from this mail

While looking at the text edits, I saw that we're storing the badge 
binary in the database. This would be a first for .org; typically we 
store these in the repo, so we can leverage whatever cache/CDN 
mechanisms we have. While the code is pretty neat, IMV it'd be better to 
store it in our standard image directory.

If there's a reason for this to be in the database, please let me know. 
I also know this is one of those things that we can ultimately change.

The rest of this looks OK.

> v12-0001-Make-contributor-badges-discoverable.patch - what will
>    actually put the badges live

I guess I missed why we're separating out Contributors + People, but if 
it's agreed upon I don't have too strong of an opinion. Otherwise just 
looking at it, I'm confused at the difference :) Maybe we have to also 
retitle "Contributors" to "Recognized Contributors", i.e.

-         {'title': 'Contributors', 'link': '/community/contributors/'},
+         {'title': 'Recognized Contributors', 'link': 
'/community/contributors/'},

(which also matches the new title of the page)

The rest LGTM.

> v12-0001-Extend-badge-title-to-64-chars.patch - future database fix

I don't think we need to be stingy on the characters here; I think the 
"default" we've used is 255; let's just be safe. (I'm also OK if we 
don't use TextField given these will typically be short).


> Assuming v12-0001-Contributor-copy-editing.patch is ok, would you
> think that we can proceed with adding some badges now? My hope would
> be to have at least "PostgreSQL 18 Contributor" live for Valencia.
> 
> Timeline:
> after ack: apply v12-0001-Contributor-copy-editing.patch
> this week: create initial badges, add holders
>             have badges approved in moderation (they are still not visible)
> shortly before the conference: apply v12-0001-Make-contributor-badges-discoverable.patch
> later: apply v12-0001-Extend-badge-title-to-64-chars.patch
Thanks,

Jonathan


Attachments:

  OpenPGP_signature.asc (application/pgp-signature, 839B) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-14 18:26  Christoph Berg <myon@debian.org>
  parent: Jonathan S. Katz <jkatz@postgresql.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-14 18:26 UTC (permalink / raw)
  To: Jonathan S. Katz <jkatz@postgresql.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Jonathan S. Katz
> Thanks for working on this. I can provide some review on the current
> patches.

Thanks!

> While looking at the text edits, I saw that we're storing the badge binary
> in the database. This would be a first for .org; typically we store these in
> the repo, so we can leverage whatever cache/CDN mechanisms we have. While
> the code is pretty neat, IMV it'd be better to store it in our standard
> image directory.
> 
> If there's a reason for this to be in the database, please let me know. I
> also know this is one of those things that we can ultimately change.

I've had file/repo storage in the first version because it was
simpler, but Magnus said we should use the pgeu image-in-database
code. I tend to agree that database is better, this is content that is
added frequently ("PGconf Wherever 20xx Speaker"), so automating the
process as much as possible makes sense.

The images themselves don't change (much), so varnish caching should
just work. One point that Magnus raised is if there are many images on
a page, some web browsers will open 80 concurrent connections and run
into some rate limit. If we reach that point, we need to create
sprites and serve the badges grid as one big image. (This is a UX
issue, not a bandwidth one.) But there is still time until that
happens, and for that, we can take the images from the database as
well.

> The rest of this looks OK.
> 
> > v12-0001-Make-contributor-badges-discoverable.patch - what will
> >    actually put the badges live
> 
> I guess I missed why we're separating out Contributors + People, but if it's
> agreed upon I don't have too strong of an opinion. Otherwise just looking at
> it, I'm confused at the difference :)

We can definitely revisit the split after some time.

> Maybe we have to also retitle
> "Contributors" to "Recognized Contributors", i.e.
> 
> -         {'title': 'Contributors', 'link': '/community/contributors/'},
> +         {'title': 'Recognized Contributors', 'link':
> '/community/contributors/'},

I had tried that, but rejected it because it got wrapped over two
lines in the sidebar, and none of the other menus have multi-line
entries. But maybe that's not a problem and we should just do it.
Done in the attached v13-0002.

> The rest LGTM.
> 
> > v12-0001-Extend-badge-title-to-64-chars.patch - future database fix
> 
> I don't think we need to be stingy on the characters here; I think the
> "default" we've used is 255; let's just be safe. (I'm also OK if we don't
> use TextField given these will typically be short).

Ack, will bump it in the staged DB commit v13-0003.

> > Assuming v12-0001-Contributor-copy-editing.patch is ok, would you
> > think that we can proceed with adding some badges now? My hope would
> > be to have at least "PostgreSQL 18 Contributor" live for Valencia.
> > 
> > Timeline:
> > after ack: apply v12-0001-Contributor-copy-editing.patch
> > this week: create initial badges, add holders
> >             have badges approved in moderation (they are still not visible)
> > shortly before the conference: apply v12-0001-Make-contributor-badges-discoverable.patch
> > later: apply v12-0001-Extend-badge-title-to-64-chars.patch
> Thanks,
> 
> Jonathan

Given that we now have the review from Daniel and this what I read as
review-and-ack from Jonathan, I think we can proceed to add actual
badges. Tomorrow is 19rc1 release day, so I'd say Friday.

Christoph

Attachments: download all (3 files, .tar.gz)

v13-0001-Contributor-copy-editing.patch (text/x-diff, 10.1K) download From fc08c159e2c0d570da307029cbc43660c86da1f5 Mon Sep 17 00:00:00 2001 From: Christoph Berg <myon@debian.org> Date: Mon, 12 Oct 2026 15:14:39 +0200 Subject: [PATCH v13 1/3] Contributor copy-editing Apply finding from Daniel's review: * retired badge holders have a CSS class * contribution field description is "Describe your involvement in the PostgreSQL community" * The logo is the PostgreSQL logo * Badge images have an alt title * "Create contributor profile" checkbox has a proper id and label --- media/css/main.css | 3 +++ pgweb/contributors/migrations/0001_initial.py | 2 +- ...er_contributor_ctype_alter_contributor_email_and_more.py | 2 +- pgweb/contributors/models.py | 4 ++-- templates/account/userprofileform.html | 4 ++-- templates/contributors/badge.html | 6 +++--- templates/contributors/people.html | 2 +- templates/contributors/profile.html | 4 ++-- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/media/css/main.css b/media/css/main.css index 9c4e24d8..a41632d2 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1758,6 +1758,9 @@ table.contributor-table thead tr th { text-align: center; padding: 4px; } +.badgeholder-retired { + font-style: italic; +} /* News archive */ #pgContentWrap span.newstag { diff --git a/pgweb/contributors/migrations/0001_initial.py b/pgweb/contributors/migrations/0001_initial.py index 244e2e49..e2121892 100644 --- a/pgweb/contributors/migrations/0001_initial.py +++ b/pgweb/contributors/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('company', models.CharField(max_length=100, null=True, blank=True)), ('companyurl', models.URLField(max_length=100, null=True, verbose_name='Company URL', blank=True)), ('location', models.CharField(max_length=100, null=True, blank=True)), - ('contribution', models.TextField(null=True, blank=True, help_text='Describe what you did in the PostgreSQL community')), + ('contribution', models.TextField(null=True, blank=True, help_text='Describe your involvement in the PostgreSQL community')), ], options={ 'ordering': ('lastname', 'firstname'), diff --git a/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py b/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py index 75b002aa..87627ccb 100644 --- a/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py +++ b/pgweb/contributors/migrations/0005_alter_contributor_ctype_alter_contributor_email_and_more.py @@ -82,7 +82,7 @@ class Migration(migrations.Migration): "imagedata", pgweb.util.fields.ImageBinaryField( blank=True, - help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.", + help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the PostgreSQL logo will be used.", max_length=1000000, null=True, verbose_name="Image", diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 7ffc0881..7d55a0dc 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -53,7 +53,7 @@ class Contributor(models.Model): companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL') location = models.CharField(max_length=100, null=True, blank=True) contribution = models.TextField(null=True, blank=True, - help_text='Describe what you did in the PostgreSQL community') + help_text='Describe your involvement in the PostgreSQL community') user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE) send_notification = True @@ -102,7 +102,7 @@ class Badge(TwostateModerateModel): slug = models.SlugField(max_length=64, null=False, blank=False, unique=True, help_text='URL-friendly identifier for the badge page. Generated from the title when the badge is created, and kept fixed after that.') description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') - imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.") + imagedata = ImageBinaryField(max_length=1000000, resolution=(150, 150), auto_scale=True, blank=True, null=True, verbose_name="Image", help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the PostgreSQL logo will be used.") contact = models.CharField(max_length=100, null=True, blank=True, verbose_name='Contact address', help_text='Contact address (email, URL, other) for people who want to be added as badge holder') holders = models.ManyToManyField(User, through="Badgeholder", through_fields=("badge", "user"), blank=True) diff --git a/templates/account/userprofileform.html b/templates/account/userprofileform.html index bac04651..01fba575 100644 --- a/templates/account/userprofileform.html +++ b/templates/account/userprofileform.html @@ -100,7 +100,7 @@ {%for b in badges %} <figure> <a href="/community/badge/{{b.slug}}/"> - <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" alt="{{b}}"> <figcaption>{{b}}</figcaption> </a> </figure> @@ -134,7 +134,7 @@ <h2>Create contributor profile</h2> <p>You have been awarded contributor badges. To have your name included in the public people and badge holder lists, you can create a publicly visible profile page.</p> <div> - <input type="checkbox" name="create_contributor_profile"> Create publicly visible profile page + <input type="checkbox" name="create_contributor_profile" id="create_contributor_profile"> <label for="create_contributor_profile">Create publicly visible profile page</label> </div> {% endif %} diff --git a/templates/contributors/badge.html b/templates/contributors/badge.html index 1da8f84b..7ea0f1fd 100644 --- a/templates/contributors/badge.html +++ b/templates/contributors/badge.html @@ -3,7 +3,7 @@ {%block title%}{{badge}} - Contribution{%endblock%} {%block contents%} <h1>Badge: {{badge}} <i class="fa fa-star"></i></h1> -<p><img src="{%if badge.has_image %}/community/badge/{{badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150"></p> +<p><img src="{%if badge.has_image %}/community/badge/{{badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" width="150" alt="{{badge}}"></p> {% if badge.description or badge.url %} <h2>Contribution</h2> @@ -19,12 +19,12 @@ <h2>Badge Holders</h2> {%if holders|length > 50%} {%for u in holders.all %} - <nobr>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%}</em>{%endif%} {%if not forloop.last%}&middot;{%endif%}</nobr> + <nobr{%if u.date_retired%} class="badgeholder-retired"{%endif%}><a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a> {%if not forloop.last%}&middot;{%endif%}</nobr> {%endfor%} {%else%} <ul> {%for u in holders.all%} - <li>{%if u.date_retired%}<em>{%endif%}<a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%} (retired from this activity)</em>{%endif%}</li> + <li{%if u.date_retired%} class="badgeholder-retired"{%endif%}><a href="/community/people/{{u.user}}/">{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}</a>{%if u.date_retired%} (retired from this activity){%endif%}</li> {%endfor%} </ul> {%endif%} diff --git a/templates/contributors/people.html b/templates/contributors/people.html index 67de9b9d..37211902 100644 --- a/templates/contributors/people.html +++ b/templates/contributors/people.html @@ -26,7 +26,7 @@ {%for b in badges %} <figure> <a href="/community/badge/{{b.slug}}/"> - <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> + <img src="{%if b.has_image %}/community/badge/{{b.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" alt="{{b}}"> <figcaption>{{b}}</figcaption> </a> </figure> diff --git a/templates/contributors/profile.html b/templates/contributors/profile.html index f4d1afdc..e47bf455 100644 --- a/templates/contributors/profile.html +++ b/templates/contributors/profile.html @@ -12,8 +12,8 @@ {%for b in badges %} <figure> <a href="/community/badge/{{b.badge.slug}}/"> - <img src="{%if b.badge.has_image %}/community/badge/{{b.badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}"> - <figcaption>{{b.badge}}{%if b.date_retired%}<br><em>(retired)</em>{%endif%}</figcaption> + <img src="{%if b.badge.has_image %}/community/badge/{{b.badge.slug}}/image/{%else%}/media/img/about/press/elephant.png{%endif%}" alt="{{b.badge}}"> + <figcaption{%if b.date_retired%} class="badgeholder-retired"{%endif%}>{{b.badge}}{%if b.date_retired%}<br>(retired){%endif%}</figcaption> </a> </figure> {%endfor%} -- 2.53.0
v13-0002-Make-contributor-badges-discoverable.patch (text/x-diff, 5.3K) download From 80251b121dbabef84fdc6c753c87c9b3ab8759af Mon Sep 17 00:00:00 2001 From: Christoph Berg <myon@debian.org> Date: Fri, 25 Sep 2026 17:29:36 +0200 Subject: [PATCH v13 2/3] Make contributor badges discoverable Add the People entry to the community menu and the Contributor Badges entry to the account's submitted-data menu, and link the recognized contributors list to the new people and profile pages. These are the incoming links from existing pages; the badges system is fully functional without them, so this can be pushed separately after testing. Author: Melanie Plageman <melanieplageman@gmail.com> Author: Christoph Berg <myon@debian.org> --- pgweb/util/contexts.py | 4 +++- templates/contributors/list.html | 29 ++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index ca493714..6fdd3969 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -46,7 +46,8 @@ sitenav = { ], 'community': [ {'title': 'Community', 'link': '/community/'}, - {'title': 'Contributors', 'link': '/community/contributors/'}, + {'title': 'Recognized Contributors', 'link': '/community/contributors/'}, + {'title': 'People', 'link': '/community/people/'}, {'title': 'Mailing Lists', 'link': '/list/'}, {'title': 'IRC', 'link': '/community/irc/'}, # {'title': 'Slack', 'link': 'https://join.slack.com/t/postgresteam/shared_invite/zt-1qj14i9sj-E9WqIFlvcOiHsEk2yFEMjA'}, @@ -86,6 +87,7 @@ sitenav = { {'title': 'Events', 'link': '/account/edit/events/'}, {'title': 'Products', 'link': '/account/edit/products/'}, {'title': 'Professional Services', 'link': '/account/edit/services/'}, + {'title': 'Contributor Badges', 'link': '/account/edit/badges/'}, {'title': 'Organisations', 'link': '/account/edit/organisations/'}, ]}, {'title': 'Change password', 'link': '/account/changepwd/'}, diff --git a/templates/contributors/list.html b/templates/contributors/list.html index 068fc949..8377a8e7 100644 --- a/templates/contributors/list.html +++ b/templates/contributors/list.html @@ -1,18 +1,18 @@ {%extends "base/page.html"%} {%load pgfilters%} -{%block title%}Contributor Profiles{%endblock%} +{%block title%}Recognized Contributors{%endblock%} {%block contents%} -<h1>PostgreSQL Contributor Profiles <i class="fa fa-users"></i></h1> - -<p>These are the fine people that make PostgreSQL what it is today!</p> +<h1>PostgreSQL Recognized Contributors <i class="fa fa-users"></i></h1> <p> - For a list of all code contributions to a specific release, see the - <a href="/docs/release/">Release Notes</a> for released versions of PostgreSQL. + These are the fine people who make PostgreSQL what it is today! + Contributors listed here have provided a sustained stream of notable contributions in recent years. </p> + <p> - Existing contributors can update their information in their - <a href="/account/profile/">user profile</a>. + A separate page lists all + <a href="/community/people/">people who have made contributions to PostgreSQL</a> + over the years. </p> {%for t in contributortypes%} @@ -32,7 +32,7 @@ {%for c in t.contributor_set.all %} {%if t.detailed%} <tr> - <td>{{c.firstname}} {{c.lastname}} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %} {%if t.showemail and c.email%}({{c.email|hidemail}}){%endif%} {%if c.company %} <br/> {% if c.companyurl %} @@ -41,21 +41,23 @@ {{c.company}} {% endif %} {% endif %} - <br/> - {{c.location}} + {%if c.location %} + <br/> + {{c.location}} + {% endif %} </td> <td>{{c.contribution}}</td> </tr> {%else%} {%if forloop.counter0|divisibleby:"2" %} <tr> - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> {%if forloop.last%} <td></td> </tr> {%endif%} {%else%} - <td>{{c.firstname}} {{c.lastname}}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> + <td>{% if c.user %}<a href="/community/people/{{c.user.username}}/">{{c.firstname}} {{c.lastname}}</a>{% else %}{{c.firstname}} {{c.lastname}}{% endif %}{%if t.showemail and c.email%} ({{c.email|hidemail}}){%endif%}</td> </tr> {%endif%} {%endif%} @@ -65,6 +67,7 @@ {%endfor%} <p>All contributors are listed in alphabetical order. + Existing contributors can update their information in their <a href="/account/profile/">user profile</a>. To suggest additions or corrections to this list, please email the <a href="/about/governance/contributors/">Contributors Committee</a> at <a href="mailto:contributors@postgresql.org">contributors@postgresql.org</a>. -- 2.53.0
v13-0003-Extend-badge-title-to-255-chars.patch (text/x-diff, 2.8K) download From 6c3d38ff0ac743008830c4cf5d3cc98de868fd7d Mon Sep 17 00:00:00 2001 From: Christoph Berg <myon@debian.org> Date: Mon, 12 Oct 2026 14:17:58 +0200 Subject: [PATCH v13 3/3] Extend badge title to 255 chars Daniel pointed out that a reasonable badge title like "Nordic PGDay 2026 Program Committee" is already longer than the 32 chars we catered for (it's 35). Extend it, we still have moderation to reject overly long names. --- .../migrations/0006_alter_badge_badge.py | 25 +++++++++++++++++++ pgweb/contributors/models.py | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 pgweb/contributors/migrations/0006_alter_badge_badge.py diff --git a/pgweb/contributors/migrations/0006_alter_badge_badge.py b/pgweb/contributors/migrations/0006_alter_badge_badge.py new file mode 100644 index 00000000..f69c47f3 --- /dev/null +++ b/pgweb/contributors/migrations/0006_alter_badge_badge.py @@ -0,0 +1,25 @@ +# Generated by Django 5.2.17 on 2026-10-12 12:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "contributors", + "0005_alter_contributor_ctype_alter_contributor_email_and_more", + ), + ] + + operations = [ + migrations.AlterField( + model_name="badge", + name="badge", + field=models.CharField( + help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".', + max_length=255, + unique=True, + ), + ), + ] diff --git a/pgweb/contributors/models.py b/pgweb/contributors/models.py index 7d55a0dc..e5efab79 100644 --- a/pgweb/contributors/models.py +++ b/pgweb/contributors/models.py @@ -98,7 +98,7 @@ class BadgeManager(models.Manager): class Badge(TwostateModerateModel): org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE) - badge = models.CharField(max_length=32, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') + badge = models.CharField(max_length=255, null=False, blank=False, unique=True, help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".') slug = models.SlugField(max_length=64, null=False, blank=False, unique=True, help_text='URL-friendly identifier for the badge page. Generated from the title when the badge is created, and kept fixed after that.') description = models.TextField(null=True, blank=True, help_text='What did the people do who contributed here?') url = models.URLField(max_length=100, null=True, blank=True, verbose_name='Contribution URL', help_text='URL for this contribution, e.g. the conference homepage. (Leave blank when there is no URL.)') -- 2.53.0
^ permalink raw reply [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-14 18:45  Daniel Gustafsson <daniel@yesql.se>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Daniel Gustafsson @ 2026-10-14 18:45 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Jonathan S. Katz <jkatz@postgresql.org>; Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

> On 14 Oct 2026, at 20:26, Christoph Berg <myon@debian.org> wrote:

> Given that we now have the review from Daniel and this what I read as
> review-and-ack from Jonathan, I think we can proceed to add actual
> badges. Tomorrow is 19rc1 release day, so I'd say Friday.

I don't have any insight into this other than agreeing that we shouldn't do
anything until 19rc1 is out.

One small comment on 0001:

	-         help_text="Square image, will be auto-scaled to 150◊150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.",
	+         help_text="Square image, will be auto-scaled to 150◊150. JPEG or PNG, up to 1 MB. When left blank, the PostgreSQL logo will be used.",

This seems to be using a special character for "x" in "150x150", if so that
should probably use an html entity instead.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-15 01:34  Jonathan S. Katz <jkatz@postgresql.org>
  parent: Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 45+ messages in thread

From: Jonathan S. Katz @ 2026-10-15 01:34 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

On 10/14/26 2:45 PM, Daniel Gustafsson wrote:
>> On 14 Oct 2026, at 20:26, Christoph Berg <myon@debian.org> wrote:
> 
>> Given that we now have the review from Daniel and this what I read as
>> review-and-ack from Jonathan, I think we can proceed to add actual
>> badges. Tomorrow is 19rc1 release day, so I'd say Friday.
> 
> I don't have any insight into this other than agreeing that we shouldn't do
> anything until 19rc1 is out.
I wholeheartedly agree and thank you for waiting until after the 
release, having, in the past, to do emergency rebasing in the middle of 
a release due to pgweb changes having been pushed the night before :)

Jonathan


Attachments:

  OpenPGP_signature.asc (application/pgp-signature, 839B) download

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 07:36  Magnus Hagander <magnus@hagander.net>
  parent: Jonathan S. Katz <jkatz@postgresql.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Magnus Hagander @ 2026-10-16 07:36 UTC (permalink / raw)
  To: Jonathan S. Katz <jkatz@postgresql.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Christoph Berg <myon@debian.org>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

On Thu, 15 Oct 2026 at 03:34, Jonathan S. Katz <jkatz@postgresql.org> wrote:

> On 10/14/26 2:45 PM, Daniel Gustafsson wrote:
> >> On 14 Oct 2026, at 20:26, Christoph Berg <myon@debian.org> wrote:
> >
> >> Given that we now have the review from Daniel and this what I read as
> >> review-and-ack from Jonathan, I think we can proceed to add actual
> >> badges. Tomorrow is 19rc1 release day, so I'd say Friday.
> >
> > I don't have any insight into this other than agreeing that we shouldn't
> do
> > anything until 19rc1 is out.
> I wholeheartedly agree and thank you for waiting until after the
> release, having, in the past, to do emergency rebasing in the middle of
> a release due to pgweb changes having been pushed the night before :)
>
>
I will point out that I *explicitly* asked that this system not be used
fully until I had completed my review. I have *not* withdrawn this
requirement. AFAIK nobody has done the full review ont he impact this will
have on our caching setups and the production systems. If that is wrong,
then please point me to that. But if not, then my objection still stands,
and I am *not* happy that my *explicit* request to review production impact
was not honored.

//Magnus

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 07:56  Christoph Berg <myon@debian.org>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-16 07:56 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Magnus Hagander
> I will point out that I *explicitly* asked that this system not be used
> fully

Fwiw, it is not fully in use yet. There are no links to badges or to
the people page. There is not going to be a huge spike of requests
because no one has these URLs yet.

We are doing this precisely to allow looking at how it works in
practise before the world runs over it.

> until I had completed my review. I have *not* withdrawn this
> requirement. AFAIK nobody has done the full review ont he impact this will
> have on our caching setups and the production systems.

Afaict the proper purge rules are in place, and the images have Etag
headers. We can check all that once a badge is approved. (I had
already submitted "PostgreSQL 18 Contributor" before your mail.)

> If that is wrong,
> then please point me to that. But if not, then my objection still stands,
> and I am *not* happy that my *explicit* request to review production impact
> was not honored.

I still believe that we addressed all concerns. I was aware that you
wanted more review, that's why we did that here. If that review was
not enough going into that direction, I'm sorry - that's why we did it
here openly on the list. Yes I know it's conference preparation time
for you, but it should have been obvious that we were moving to
putting this live, so just a "please do more review of X" line would
have helped.

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 08:08  Dave Page <dpage@pgadmin.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 2 replies; 45+ messages in thread

From: Dave Page @ 2026-10-16 08:08 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

On Fri, 16 Oct 2026 at 08:56, Christoph Berg <myon@debian.org> wrote:

> Re: Magnus Hagander
> > I will point out that I *explicitly* asked that this system not be used
> > fully
>
> Fwiw, it is not fully in use yet. There are no links to badges or to
> the people page. There is not going to be a huge spike of requests
> because no one has these URLs yet.
>
> We are doing this precisely to allow looking at how it works in
> practise before the world runs over it.
>
> > until I had completed my review. I have *not* withdrawn this
> > requirement. AFAIK nobody has done the full review ont he impact this
> will
> > have on our caching setups and the production systems.
>
> Afaict the proper purge rules are in place, and the images have Etag
> headers. We can check all that once a badge is approved. (I had
> already submitted "PostgreSQL 18 Contributor" before your mail.)
>
> > If that is wrong,
> > then please point me to that. But if not, then my objection still stands,
> > and I am *not* happy that my *explicit* request to review production
> impact
> > was not honored.
>
> I still believe that we addressed all concerns. I was aware that you
> wanted more review, that's why we did that here. If that review was
> not enough going into that direction, I'm sorry - that's why we did it
> here openly on the list. Yes I know it's conference preparation time
> for you, but it should have been obvious that we were moving to
> putting this live, so just a "please do more review of X" line would
> have helped.
>

I haven't had time to review it properly yet, but I just had Claude Opus
review it, and it seems to think there are a few issues that need fixing. I
told it to pay particular attention to performance:

Commits reviewed: `bfbb841`, `1993c00`, `8eb38fb`, `5cdc3ed`, `7257af2`,
`c93898e`, `73aab74`.

The only ones with performance or caching implications are `bfbb841` (image
field) and `8eb38fb` (contributor badges). The download-page edits, the
pycodestyle fix, the OneToOneField migration and the copy-editing commit
are all fine. `manage.py check` reports no issues.

## Varnish cache invalidation

The site relies on Varnish holding pages for a long time and on purges to
clear them (`docs/frontend.rst`). Several changes in the badges feature
never send a purge, so stale pages stay up until the default time-to-live
(TTL) runs out, and longer in grace mode.

1. **Removing a holder purges nothing for that person.** `BadgeForm.save`
calls `badge.holders.remove()` (`pgweb/contributors/forms.py`). That
deletes the through-table rows without any `post_save`, and pgweb only
hooks `post_save` (`pgweb/util/signals.py:169`). The badge page still gets
purged, because `simple_form` saves the badge afterwards. The removed
person's `/community/people/<username>/` page keeps showing the badge.
2. **Deletes never purge.** This applies to deleting a `Badge`,
`Badgeholder` or `Contributor` in the admin. The rest of pgweb has the same
gap, but it matters more here: a deleted contributor's public profile page,
which can include their email, stays cached. If someone asks for their
profile to be removed, it isn't really gone.
3. **Approving or editing a badge doesn't purge its holders' profile
pages.** `Badge.purge_urls` says profiles "get refreshed when their holder
rows are edited", but approval, unapproval, a title change and an image
added or removed all leave the profiles stale. After unapproval, profiles
keep linking to `/community/badge/<slug>/image/`, which now returns a 404
that Varnish may also cache. The fix is xkeys, which the docs already
describe as the better option: tag the badge, people and profile responses
with something like `pgbadge_<id>` and give `Badge` a `purge_xkeys`. That
also replaces the per-holder URL loops.
4. **The image URL never changes when the image does.**
`/community/badge/<slug>/image/` has no file extension and no version in
it. The docs say Varnish applies a longer policy to images "because they
are considered never to change". Varnish itself is purged, but if the
Varnish configuration (VCL) also sends long browser cache headers for
images, browsers will keep showing the old image. The VCL isn't in this
repo, so I can't check which behaviour applies. Adding a short hash of the
image to the URL, as `?v=` or in the path, avoids the question.

## Database and app server

5. **The `has_image` annotation reads every image out of TOAST**,
PostgreSQL's out-of-line storage for large values
(`BadgeManager.with_has_image`). The comment says the value is "never
transferred", which is true for the network, but `imagedata > ''` compares
the full bytea, so PostgreSQL has to fetch and reassemble the whole value.
A test of 200 rows of about 96 KB each on the local database showed the
comparison reading about 3,000 buffers in 31 ms, whilst `octet_length(img)
> 0` read 2 buffers in 0.04 ms, because it only reads the TOAST header.
Switching to `Length('imagedata') > 0` is a one-line fix. It runs on every
cache miss of the people page (up to 200 badges) and on every account
profile page load, which is never cached.
6. **Oversized images are decoded in full (a "decompression bomb").**
`ImageBinaryField.to_python` decodes the entire image with Pillow before
rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow
refuses it, which is several hundred MB of RAM plus a bicubic resize on the
app server. `ModelForm` full-clean also re-parses the stored image on every
badge edit, even when the image hasn't changed. Only managers of an
approved organisation can upload, so the risk is moderate, but checking
`img.size` before decoding would be cheap.
7. **Minor, and only on cache misses:**
   - `badge.html` uses `holders|length` and then `holders.all`, which runs
the holder query and its two prefetches a second time.
   - `select_related` would do better than `prefetch_related` for the
foreign-key lookups in `peoplelist` and `badge_view`.
   - `badge_image` fetches the image and computes its MD5 before it checks
`If-None-Match`; storing the hash would avoid both.
   - Every account profile save that has a contributor record purges
`/community/contributors/`, `/community/people/` and all of that user's
badge pages, even when nothing changed.

## Suggested order of fixes

Start with the xkey purging (items 1 to 3) and the `Length()` change (item
5).

-- 
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
pgEdge: https://www.pgedge.com

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 08:59  Christoph Berg <myon@debian.org>
  parent: Dave Page <dpage@pgadmin.org>
  1 sibling, 2 replies; 45+ messages in thread

From: Christoph Berg @ 2026-10-16 08:59 UTC (permalink / raw)
  To: Dave Page <dpage@pgadmin.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Dave Page
> I haven't had time to review it properly yet, but I just had Claude Opus
> review it, and it seems to think there are a few issues that need fixing. I
> told it to pay particular attention to performance:

Thanks!

> ## Varnish cache invalidation

Fwiw some of these gaps were intentional because we deemed them either
minor, or out-of-scope-ish because they need fixes in the "items"
management infra in pgweb and aren't specific to badges. We should
have documented that, sorry. Anyway, this is probably the time to fix
all of them, thanks for pointing them out.

> 4. **The image URL never changes when the image does.**
> `/community/badge/<slug>/image/` has no file extension and no version in
> it. The docs say Varnish applies a longer policy to images "because they
> are considered never to change". Varnish itself is purged, but if the
> Varnish configuration (VCL) also sends long browser cache headers for
> images, browsers will keep showing the old image.

I think purging Varnish is enough here. Badge image changes aren't
critical, if a user sees the image somewhat longer, that doesn't cause
trouble.

> ## Database and app server
> 
> 5. **The `has_image` annotation reads every image out of TOAST**,
> PostgreSQL's out-of-line storage for large values
> (`BadgeManager.with_has_image`). The comment says the value is "never
> transferred", which is true for the network, but `imagedata > ''` compares
> the full bytea, so PostgreSQL has to fetch and reassemble the whole value.
> A test of 200 rows of about 96 KB each on the local database showed the
> comparison reading about 3,000 buffers in 31 ms, whilst `octet_length(img)
> > 0` read 2 buffers in 0.04 ms, because it only reads the TOAST header.
> Switching to `Length('imagedata') > 0` is a one-line fix. It runs on every
> cache miss of the people page (up to 200 badges) and on every account
> profile page load, which is never cached.

Ack.

> 6. **Oversized images are decoded in full (a "decompression bomb").**
> `ImageBinaryField.to_python` decodes the entire image with Pillow before
> rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow
> refuses it, which is several hundred MB of RAM plus a bicubic resize on the
> app server. `ModelForm` full-clean also re-parses the stored image on every
> badge edit, even when the image hasn't changed. Only managers of an
> approved organisation can upload, so the risk is moderate, but checking
> `img.size` before decoding would be cheap.

What max input size would we accept? 2000x2000 (4 megapixels) should
be pretty much enough for everyone?

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 09:09  Christoph Berg <myon@debian.org>
  parent: Dave Page <dpage@pgadmin.org>
  1 sibling, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-16 09:09 UTC (permalink / raw)
  To: Dave Page <dpage@pgadmin.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Dave Page
> The fix is xkeys, which the docs already
> describe as the better option: tag the badge, people and profile responses
> with something like `pgbadge_<id>` and give `Badge` a `purge_xkeys`. That
> also replaces the per-holder URL loops.

I don't think we'd want that. The people URLs have to be stable so
people can link to them. if /contributors/people/myon/ gets replaced
by /contributors/people/myon_123/, that's much less personal. The same
applies to badges. (Or did I misunderstand the fix?)

I remember rejecting some of the invalidations for "too much looping",
I guess we should just implement it and then hopefully be done.

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 12:39  Dave Page <dpage@pgadmin.org>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 1 reply; 45+ messages in thread

From: Dave Page @ 2026-10-16 12:39 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Hi

On Fri, 16 Oct 2026 at 09:59, Christoph Berg <myon@debian.org> wrote:

>
> > 6. **Oversized images are decoded in full (a "decompression bomb").**
> > `ImageBinaryField.to_python` decodes the entire image with Pillow before
> > rescaling. A PNG under 1 MB can still be about 170 megapixels before
> Pillow
> > refuses it, which is several hundred MB of RAM plus a bicubic resize on
> the
> > app server. `ModelForm` full-clean also re-parses the stored image on
> every
> > badge edit, even when the image hasn't changed. Only managers of an
> > approved organisation can upload, so the risk is moderate, but checking
> > `img.size` before decoding would be cheap.
>
> What max input size would we accept? 2000x2000 (4 megapixels) should
> be pretty much enough for everyone?
>

These are images for badges - why on earth do they have to be that big? You
pad them and then display them at 150x150 from what I can see. All of that
seems like work that needn't be done by our servers - I would have the user
upload at <= 256x256 or something (and adjust max_length to something more
reasonable), and then pad and resize them in CSS. Which looks like it might
be broken anyway - .badges-grid uses minmax(150px, 1fr) with img { width:
100% }, so on wide layouts a 150px image likely gets stretched beyond its
real size.

-- 
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
pgEdge: https://www.pgedge.com

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 12:44  Dave Page <dpage@pgadmin.org>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Dave Page @ 2026-10-16 12:44 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Hi

On Fri, 16 Oct 2026 at 10:09, Christoph Berg <myon@debian.org> wrote:

> Re: Dave Page
> > The fix is xkeys, which the docs already
> > describe as the better option: tag the badge, people and profile
> responses
> > with something like `pgbadge_<id>` and give `Badge` a `purge_xkeys`. That
> > also replaces the per-holder URL loops.
>
> I don't think we'd want that. The people URLs have to be stable so
> people can link to them. if /contributors/people/myon/ gets replaced
> by /contributors/people/myon_123/, that's much less personal. The same
> applies to badges. (Or did I misunderstand the fix?)
>

You did :-)

Xkeys don't change any URL. An xkey is a tag that Django adds as a response
header (xkey: pgbadge_42). Varnish's xkey module indexes cached objects by
that tag, and pgweb can then say "purge everything tagged pgbadge_42"
without knowing which URLs those are. /community/people/myon/ stays exactly
as it is.

pgweb already does this. PgMiddleware tags every page with the templates it
used (pgweb/util/middleware.py:44), there's an @xkey decorator in
pgweb/util/decorators.py, and the post-save handler calls purge_xkeys on
any model that defines it (pgweb/util/signals.py:160). For badges it would
look like this:

- badge_view, profile and peoplelist add pgbadge_<id> to the response's
xkey header for every badge the page shows.
- Badge gets purge_xkeys returning pgbadge_<id>.

Saving or approving a badge would then purge every page that shows it,
including all holders' profile pages, which is item 3. It covers item 1 as
well: the removed holder's profile was tagged with that badge, and
simple_form saves the badge after the removal. Deletes (item 2) would still
need a post_delete hook, since that's a separate gap.

-- 
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
pgEdge: https://www.pgedge.com

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 12:49  Christoph Berg <myon@debian.org>
  parent: Dave Page <dpage@pgadmin.org>
  0 siblings, 1 reply; 45+ messages in thread

From: Christoph Berg @ 2026-10-16 12:49 UTC (permalink / raw)
  To: Dave Page <dpage@pgadmin.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: Dave Page
> > What max input size would we accept? 2000x2000 (4 megapixels) should
> > be pretty much enough for everyone?
> 
> These are images for badges - why on earth do they have to be that big? You
> pad them and then display them at 150x150 from what I can see. All of that
> seems like work that needn't be done by our servers - I would have the user
> upload at <= 256x256 or something (and adjust max_length to something more
> reasonable), and then pad and resize them in CSS. Which looks like it might
> be broken anyway - .badges-grid uses minmax(150px, 1fr) with img { width:
> 100% }, so on wide layouts a 150px image likely gets stretched beyond its
> real size.

That would be the max acceptable input size before server-side
rescaling. I proposed something insanely large that shouldn't get in
the way of anyone uploading while still limiting server memory.
What you are saying is that we shouldn't do server-side rescaling but
just take the user image-as is. That works for me.

I'll work on a patch to make that switch.

(The question might come back if we want to build a sprite image.)

Christoph





^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 12:53  Daniel Gustafsson <daniel@yesql.se>
  parent: Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 45+ messages in thread

From: Daniel Gustafsson @ 2026-10-16 12:53 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Dave Page <dpage@pgadmin.org>; Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

> On 16 Oct 2026, at 14:49, Christoph Berg <myon@debian.org> wrote:

> What you are saying is that we shouldn't do server-side rescaling but
> just take the user image-as is. That works for me.

+1 on restricting the upload to 150x150 and make the user responsible for the
badge image looking good rather than rescaling.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 14:18  Christoph Berg <myon@debian.org>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 2 replies; 45+ messages in thread

From: Christoph Berg @ 2026-10-16 14:18 UTC (permalink / raw)
  To: Dave Page <dpage@pgadmin.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Re: To Dave Page
> > ## Varnish cache invalidation
> 
> > 4. **The image URL never changes when the image does.**
> > `/community/badge/<slug>/image/` has no file extension and no version in
> > it. The docs say Varnish applies a longer policy to images "because they
> > are considered never to change". Varnish itself is purged, but if the
> > Varnish configuration (VCL) also sends long browser cache headers for
> > images, browsers will keep showing the old image.
> 
> I think purging Varnish is enough here. Badge image changes aren't
> critical, if a user sees the image somewhat longer, that doesn't cause
> trouble.

I did more research on this point, and that's the result (poking
around and by Deepseek):

     Key finding: the cache policy is s-maxage, i.e. shared-cache only

     docs/frontend.rst:39-46:

     │ There is a longer default policy set for images, because they are considered never to change. Any view …
     │ can override this default, by specifying the Cache-control: s-maxage=xxx http header … using the @cache()
     │ decorator.

     And that's exactly what the decorator emits (pgweb/util/decorators.py):

     resp['Cache-Control'] = 's-maxage=%s' % (...)

     s-maxage is honoured only by shared caches (Varnish); browsers ignore it and fall back to no explicit
     freshness. badge_image itself sets no Cache-Control at all (only ETag), so:

     - the "longer policy for images" is a Varnish TTL (how long Varnish holds it) — and that's the copy our
       purge_urls already invalidates on save;
     - browsers are never asked to cache the image long, so a changed image can't go stale in a browser under the
       documented design (they'll revalidate via ETag, or not cache).

     So the risk in comment #4 only materialises if the out-of-repo VCL re-adds a browser max-age for images —
     which would contradict the app's own header. That's a hypothetical, not something the repo does.

     Recommendation

     No URL versioning. It requires a schema change, and the repository's own contract (s-maxage) is
     that only Varnish caches. Adding ?v=<hash> "to avoid the question" pays a real cost to guard against a
     configuration the app already argues against.

On the related "minor" comment:

> - `badge_image` fetches the image and computes its MD5 before it checks
> `If-None-Match`; storing the hash would avoid both.

badge_image is only reached on a Varnish miss, and on a miss we're
almost always about to serve the image anyway. Storing the hash only
helps the narrow (?) "Django itself receives a conditional request"
case.

So, I would say everything already works like it should.

(If we wanted, We could add explicit Cache-Control headers on
badge_image.)

Christoph






^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 15:18  Dave Page <dpage@pgadmin.org>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 0 replies; 45+ messages in thread

From: Dave Page @ 2026-10-16 15:18 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Magnus Hagander <magnus@hagander.net>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

Hi

On Fri, 16 Oct 2026 at 15:18, Christoph Berg <myon@debian.org> wrote:

> Re: To Dave Page
> > > ## Varnish cache invalidation
> >
> > > 4. **The image URL never changes when the image does.**
> > > `/community/badge/<slug>/image/` has no file extension and no version
> in
> > > it. The docs say Varnish applies a longer policy to images "because
> they
> > > are considered never to change". Varnish itself is purged, but if the
> > > Varnish configuration (VCL) also sends long browser cache headers for
> > > images, browsers will keep showing the old image.
> >
> > I think purging Varnish is enough here. Badge image changes aren't
> > critical, if a user sees the image somewhat longer, that doesn't cause
> > trouble.
>
> I did more research on this point, and that's the result (poking
> around and by Deepseek):
>
>      Key finding: the cache policy is s-maxage, i.e. shared-cache only
>
>      docs/frontend.rst:39-46:
>
>      │ There is a longer default policy set for images, because they are
> considered never to change. Any view …
>      │ can override this default, by specifying the Cache-control:
> s-maxage=xxx http header … using the @cache()
>      │ decorator.
>
>      And that's exactly what the decorator emits
> (pgweb/util/decorators.py):
>
>      resp['Cache-Control'] = 's-maxage=%s' % (...)
>
>      s-maxage is honoured only by shared caches (Varnish); browsers ignore
> it and fall back to no explicit
>      freshness. badge_image itself sets no Cache-Control at all (only
> ETag), so:
>
>      - the "longer policy for images" is a Varnish TTL (how long Varnish
> holds it) — and that's the copy our
>        purge_urls already invalidates on save;
>      - browsers are never asked to cache the image long, so a changed
> image can't go stale in a browser under the
>        documented design (they'll revalidate via ETag, or not cache).
>
>      So the risk in comment #4 only materialises if the out-of-repo VCL
> re-adds a browser max-age for images —
>      which would contradict the app's own header. That's a hypothetical,
> not something the repo does.
>
>      Recommendation
>
>      No URL versioning. It requires a schema change, and the repository's
> own contract (s-maxage) is
>      that only Varnish caches. Adding ?v=<hash> "to avoid the question"
> pays a real cost to guard against a
>      configuration the app already argues against.
>
> On the related "minor" comment:
>
> > - `badge_image` fetches the image and computes its MD5 before it checks
> > `If-None-Match`; storing the hash would avoid both.
>
> badge_image is only reached on a Varnish miss, and on a miss we're
> almost always about to serve the image anyway. Storing the hash only
> helps the narrow (?) "Django itself receives a conditional request"
> case.
>
> So, I would say everything already works like it should.
>
> (If we wanted, We could add explicit Cache-Control headers on
> badge_image.)
>

That's fair, but items 1 to 3 still stand; the VCL limits how long the
stale pages last, though:

- Pages without s-maxage are kept for 8 hours, and 404s on www are kept for
8 hours too (only the archives get the 1-minute 404).
- After the 8 hours, grace mode serves the stale copy whilst Varnish
fetches a fresh one in the background, which is normally a sub-second
window; if the backend is unhealthy or the fetch fails, it can keep serving
the stale copy for up to the full 24 hours of grace.
- Purges are hard bans or hard xkey purges (pgweb never sends soft purges),
so grace doesn't bring a purged page back.

-- 
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
pgEdge: https://www.pgedge.com

^ permalink  raw  reply  [nested|flat] 45+ messages in thread

* Re: Introduce contributor badges
@ 2026-10-16 15:22  Magnus Hagander <magnus@hagander.net>
  parent: Christoph Berg <myon@debian.org>
  1 sibling, 0 replies; 45+ messages in thread

From: Magnus Hagander @ 2026-10-16 15:22 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Dave Page <dpage@pgadmin.org>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; pgsql-www@lists.postgresql.org, Andrey Borodin <x4mmm@yandex-team.ru>; Melanie Plageman <melanieplageman@gmail.com>; PostgreSQL Contributors <contributors@lists.postgresql.org>

On Fri, 16 Oct 2026 at 16:18, Christoph Berg <myon@debian.org> wrote:

> Re: To Dave Page
> > > ## Varnish cache invalidation
> >
> > > 4. **The image URL never changes when the image does.**
> > > `/community/badge/<slug>/image/` has no file extension and no version
> in
> > > it. The docs say Varnish applies a longer policy to images "because
> they
> > > are considered never to change". Varnish itself is purged, but if the
> > > Varnish configuration (VCL) also sends long browser cache headers for
> > > images, browsers will keep showing the old image.
> >
> > I think purging Varnish is enough here. Badge image changes aren't
> > critical, if a user sees the image somewhat longer, that doesn't cause
> > trouble.
>
> I did more research on this point, and that's the result (poking
> around and by Deepseek):
>

<cut some AI bleh>


>      No URL versioning. It requires a schema change, and the repository's
> own contract (s-maxage) is
>      that only Varnish caches. Adding ?v=<hash> "to avoid the question"
> pays a real cost to guard against a
>      configuration the app already argues against.
>

Agreed, no need for URL versioning.


On the related "minor" comment:
>
> > - `badge_image` fetches the image and computes its MD5 before it checks
> > `If-None-Match`; storing the hash would avoid both.
>
> badge_image is only reached on a Varnish miss, and on a miss we're
> almost always about to serve the image anyway. Storing the hash only
> helps the narrow (?) "Django itself receives a conditional request"
> case.
>

No, on the vast majority of misses we'd be serving a 304 Found with no
content. Every time an image expires in any of the caches it would send a
conditional request.

(I have not looked at the rest, so I reserve the right to further review)

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;

^ permalink  raw  reply  [nested|flat] 45+ messages in thread


end of thread, other threads:[~2026-10-16 15:22 UTC | newest]

Thread overview: 45+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 22:03 [PATCH v2] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-01-05 22:03 [PATCH v2] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-01-19 16:28 Introduce contributor badges Christoph Berg <myon@debian.org>
2026-01-20 11:56 ` Andrey Borodin <x4mmm@yandex-team.ru>
2026-01-20 12:11   ` Christoph Berg <myon@debian.org>
2026-01-20 12:52     ` Christoph Berg <myon@debian.org>
2026-01-23 10:14       ` Christoph Berg <myon@debian.org>
2026-01-23 19:03         ` Christoph Berg <myon@debian.org>
2026-04-24 16:45           ` Christoph Berg <myon@debian.org>
2026-04-24 16:47             ` Christoph Berg <myon@debian.org>
2026-04-27 11:46             ` Magnus Hagander <magnus@hagander.net>
2026-04-28 13:06               ` Christoph Berg <myon@debian.org>
2026-07-29 12:51                 ` Christoph Berg <myon@debian.org>
2026-09-25 15:46                   ` Christoph Berg <myon@debian.org>
2026-10-02 11:42                     ` Christoph Berg <myon@debian.org>
2026-10-05 07:59                       ` Daniel Gustafsson <daniel@yesql.se>
2026-10-05 14:54                         ` Christoph Berg <myon@debian.org>
2026-10-08 00:02                           ` Melanie Plageman <melanieplageman@gmail.com>
2026-10-09 17:56                           ` Daniel Gustafsson <daniel@yesql.se>
2026-10-09 18:40                             ` Christoph Berg <myon@debian.org>
2026-10-12 08:23                               ` Daniel Gustafsson <daniel@yesql.se>
2026-10-12 13:28                             ` Christoph Berg <myon@debian.org>
2026-10-14 02:05                               ` Jonathan S. Katz <jkatz@postgresql.org>
2026-10-14 18:26                                 ` Christoph Berg <myon@debian.org>
2026-10-14 18:45                                   ` Daniel Gustafsson <daniel@yesql.se>
2026-10-15 01:34                                     ` Jonathan S. Katz <jkatz@postgresql.org>
2026-10-16 07:36                                       ` Magnus Hagander <magnus@hagander.net>
2026-10-16 07:56                                         ` Christoph Berg <myon@debian.org>
2026-10-16 08:08                                           ` Dave Page <dpage@pgadmin.org>
2026-10-16 08:59                                             ` Christoph Berg <myon@debian.org>
2026-10-16 12:39                                               ` Dave Page <dpage@pgadmin.org>
2026-10-16 12:49                                                 ` Christoph Berg <myon@debian.org>
2026-10-16 12:53                                                   ` Daniel Gustafsson <daniel@yesql.se>
2026-10-16 14:18                                               ` Christoph Berg <myon@debian.org>
2026-10-16 15:18                                                 ` Dave Page <dpage@pgadmin.org>
2026-10-16 15:22                                                 ` Magnus Hagander <magnus@hagander.net>
2026-10-16 09:09                                             ` Christoph Berg <myon@debian.org>
2026-10-16 12:44                                               ` Dave Page <dpage@pgadmin.org>
2026-04-24 16:16 [PATCH v7 3/5] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-04-24 16:16 [PATCH v7 3/5] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-04-24 16:16 [PATCH v7 3/5] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-04-24 16:16 [PATCH v8 3/3] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-04-24 16:16 [PATCH v8 3/3] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-04-24 16:16 [PATCH v8 3/3] Introduce contributor badges Christoph Berg <myon@debian.org>
2026-04-24 16:16 [PATCH v8 3/3] Introduce contributor badges Christoph Berg <myon@debian.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox