diff --git a/scipost/models.py b/scipost/models.py index 9b9314b7ebad34f0093dd934bb6e4289535e4018..de7a46a6bb231ca3f5c51ec2d037524fb3b37631 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -112,14 +112,6 @@ class Contributor(models.Model): # Redundant, to be removed in future return self.get_discipline_display() - def expertises_as_ul(self): - output = '<ul>' - if self.expertises: - for exp in self.expertises: - output += '<li>%s</li>' % subject_areas_dict[exp] - output += '</ul>' - return mark_safe(output) - def expertises_as_string(self): if self.expertises: return ', '.join([subject_areas_dict[exp].lower() for exp in self.expertises]) diff --git a/scipost/templates/scipost/_assignments_summary_as_td.html b/scipost/templates/scipost/_assignments_summary_as_td.html new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scipost/templates/scipost/_expertises_as_ul.html b/scipost/templates/scipost/_expertises_as_ul.html new file mode 100644 index 0000000000000000000000000000000000000000..16150eeff9de2f19d6ce3483837ec9dd6ee6c861 --- /dev/null +++ b/scipost/templates/scipost/_expertises_as_ul.html @@ -0,0 +1,9 @@ +{% load scipost_extras %} + +<ul> + {% for expertise in contributor.expertises %} + <li> + {{ expertise|get_specialization_display }} + </li> + {% endfor %} +</ul> diff --git a/scipost/templates/scipost/personal_page.html b/scipost/templates/scipost/personal_page.html index b1121e1b56bb4d4d5c2951bc6e7f53275d62b143..6f3c572d5f36abdf5f2296792252f41fb2af432a 100644 --- a/scipost/templates/scipost/personal_page.html +++ b/scipost/templates/scipost/personal_page.html @@ -88,7 +88,7 @@ <h3 class="mt-3">Your expertises:</h3> {% if contributor.expertises %} - {{ contributor.expertises_as_ul }} + {% include "scipost/_expertises_as_ul.html" with contributor=contributor %} {% else %} <p>You haven't listed your expertise(s).<br/> Do so by <a href="{% url 'scipost:update_personal_data' %}">updating your personal data</a>