SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit b8877892 authored by Geert Kapteijns's avatar Geert Kapteijns
Browse files

move more html from Contributor to partial templates

parent da6cb1c5
No related branches found
No related tags found
No related merge requests found
......@@ -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])
......
{% load scipost_extras %}
<ul>
{% for expertise in contributor.expertises %}
<li>
{{ expertise|get_specialization_display }}
</li>
{% endfor %}
</ul>
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment