Skip to content

Commit f0e20e2

Browse files
committed
Tweak the admin interface for WGs and Chairs, adding some useful links to the tabular displays.
- Legacy-Id: 2910
1 parent 55a2854 commit f0e20e2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

ietf/idtracker/admin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,15 @@ class IESGLoginAdmin(admin.ModelAdmin):
8888
admin.site.register(IESGLogin, IESGLoginAdmin)
8989

9090
class IETFWGAdmin(admin.ModelAdmin):
91-
list_display=('group_acronym', 'group_type', 'status', 'area_acronym', 'start_date', 'concluded_date')
91+
list_display=('group_acronym', 'group_type', 'status', 'area_acronym', 'start_date', 'concluded_date', 'chairs_link')
9292
search_fields=['group_acronym__acronym', 'group_acronym__name']
9393
list_filter=['status', 'group_type']
9494
admin.site.register(IETFWG, IETFWGAdmin)
9595

96+
class WGChairAdmin(admin.ModelAdmin):
97+
list_display = ('person_link', 'group_link')
98+
admin.site.register(WGChair, WGChairAdmin)
99+
96100
class IRTFAdmin(admin.ModelAdmin):
97101
pass
98102
admin.site.register(IRTF, IRTFAdmin)

ietf/idtracker/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,14 +926,14 @@ def charter_text(self): # return string containing WG description read from file
926926
except BaseException:
927927
desc = 'Error Loading Work Group Description'
928928
return desc
929-
930929
def additional_urls(self):
931930
return AreaWGURL.objects.filter(name=self.group_acronym.acronym)
932931
def clean_email_archive(self):
933932
x = self.email_archive
934933
# remove "current/" and "maillist.html"
935934
x = re.sub("^(http://www\.ietf\.org/mail-archive/web/)([^/]+/)(current/)?([a-z]+\.html)?$", "\\1\\2", x)
936935
return x
936+
chairs_link = admin_link('chairs')
937937
class Meta:
938938
db_table = 'groups_ietf'
939939
ordering = ['?'] # workaround django wanting to sort by acronym but not joining with it
@@ -946,6 +946,8 @@ def __str__(self):
946946
return "%s (%s)" % ( self.person, self.role() )
947947
def role(self):
948948
return "%s %s Chair" % ( self.group_acronym, self.group_acronym.group_type )
949+
person_link = admin_link('person')
950+
group_link = admin_link('group_acronym')
949951
class Meta:
950952
db_table = 'g_chairs'
951953
verbose_name = "WG Chair"

0 commit comments

Comments
 (0)