Commit 7b3377b8 authored by Thijs de Jong's avatar Thijs de Jong
Browse files

Added Clickable links to Achievements and Societies

parent 69cc4512
...@@ -122,6 +122,17 @@ class MemberGroup(models.Model, metaclass=ModelTranslateMeta): ...@@ -122,6 +122,17 @@ class MemberGroup(models.Model, metaclass=ModelTranslateMeta):
def __str__(self): def __str__(self):
return self.name return self.name
def get_absolute_url(self):
try:
return self.board.get_absolute_url()
except self.DoesNotExist:
try:
return self.committee.get_absolute_url()
except self.DoesNotExist:
return self.society.get_absolute_url()
except self.DoesNotExist:
pass
class Meta: class Meta:
verbose_name = _('member group') verbose_name = _('member group')
verbose_name_plural = _('member groups') verbose_name_plural = _('member groups')
......
...@@ -39,6 +39,7 @@ def _member_group_memberships(member, skip_condition): ...@@ -39,6 +39,7 @@ def _member_group_memberships(member, skip_condition):
data[name] = { data[name] = {
'name': name, 'name': name,
'periods': [period], 'periods': [period],
'url': membership.group.get_absolute_url(),
'earliest': membership.since, 'earliest': membership.since,
} }
return data return data
......
...@@ -69,7 +69,11 @@ ...@@ -69,7 +69,11 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
{% for achievement in achievements %} {% for achievement in achievements %}
<li class="mb-1"> <li class="mb-1">
<strong>{{ achievement.name }}</strong> <strong>
<a href="{{ achievement.url }}">
{{ achievement.name }}
</a>
</strong>
<br> <br>
{% for period in achievement.periods %} {% for period in achievement.periods %}
{% if period.role %} {% if period.role %}
...@@ -94,7 +98,11 @@ ...@@ -94,7 +98,11 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
{% for society in societies %} {% for society in societies %}
<li class="mb-1"> <li class="mb-1">
<strong>{{ society.name }}</strong> <strong>
<a href="{{ society.url }}">
{{ society.name }}
</a>
</strong>
<br> <br>
{% for period in society.periods %} {% for period in society.periods %}
{% if period.role %} {% if period.role %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment