diff --git a/src/internal/migrations/0027_historicalmember_previous_roles_and_more.py b/src/internal/migrations/0027_historicalmember_previous_roles_and_more.py new file mode 100644 index 000000000..c0b2b0300 --- /dev/null +++ b/src/internal/migrations/0027_historicalmember_previous_roles_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.2 on 2024-10-17 16:48 + +import web.modelfields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('internal', '0026_add_secret_permissions'), + ] + + operations = [ + migrations.AddField( + model_name='historicalmember', + name='previous_roles', + field=web.modelfields.UnlimitedCharField(blank=True, verbose_name='previous roles'), + ), + migrations.AddField( + model_name='member', + name='previous_roles', + field=web.modelfields.UnlimitedCharField(blank=True, verbose_name='previous roles'), + ), + ] diff --git a/src/internal/models.py b/src/internal/models.py index c01bbed0b..a1c3cd3d0 100644 --- a/src/internal/models.py +++ b/src/internal/models.py @@ -37,6 +37,7 @@ class Member(models.Model): verbose_name=_("committees"), ) role = UnlimitedCharField(blank=True, verbose_name=_("role")) + previous_roles = UnlimitedCharField(blank=True, verbose_name=_("previous roles")) contact_email = models.EmailField(blank=True, verbose_name=_("contact email")) # The email address of a Google user can potentially belong to any host, not just "gmail.com" google_email = models.EmailField(blank=True, verbose_name=_("Google email")) diff --git a/src/internal/static/internal/js/member_list.js b/src/internal/static/internal/js/member_list.js index 605857d43..b9c8fd32d 100644 --- a/src/internal/static/internal/js/member_list.js +++ b/src/internal/static/internal/js/member_list.js @@ -89,6 +89,7 @@ function showDetailedMemberInformation(member) { dateQuitOrRetired: `${member.data.semesterQuitOrRetired} (${member.data.dateQuitOrRetired})`, reasonQuit: member.data.reasonQuit, role: member.data.role, + previous_roles: member.data.previous_roles, guidanceExemption: member.data.guidanceExemption, comment: member.data.comment, }; @@ -311,7 +312,7 @@ function setup() { state.searchValue = $searchInput.val(); // Package member information - $("#member-table tbody tr").each((index, row) => { + $("#member-table tbody tr").each((_index, row) => { const $row = $(row); const searchableData = { @@ -332,6 +333,7 @@ function setup() { semesterJoined: $row.data("semester-joined"), reasonQuit: $.trim($row.data("reason-quit")), role: $.trim($row.data("role")), + previous_roles: $.trim($row.data("previous_roles")), comment: $.trim($row.data("comment")), }; @@ -391,7 +393,7 @@ function setup() { state.allMembers.push(member); }); - for (const sortAttribute of ["name", "committees", "status", "dateJoinedSortable", "contactEmail", "role", "phone"]) { + for (const sortAttribute of ["name", "committees", "status", "dateJoinedSortable", "contactEmail", "role", "previous_roles", "phone"]) { $(`#member-sort-${sortAttribute}`).closest("th").click((e) => setSort( sortAttribute, $(e.target).find(".icon"), )); diff --git a/src/internal/templates/internal/member_list.html b/src/internal/templates/internal/member_list.html index 4627b60dd..9821bcdfb 100644 --- a/src/internal/templates/internal/member_list.html +++ b/src/internal/templates/internal/member_list.html @@ -137,6 +137,9 @@

{% translate "role"|capfirst %} + + Previous roles + {% translate "status"|capfirst %} @@ -216,6 +219,7 @@

{% endfor %} {{ member.role }} + {{ member.previous_roles }} {% for status_name, color in membership_status %}
{{ status_name }}