diff --git a/journals/templates/journals/publication_detail.html b/journals/templates/journals/publication_detail.html index a52c4ad13e6a3e9619424be519690c28de45bb3b..8c03853e661a4aa85ac6021b587ac5bdaa3b77e7 100644 --- a/journals/templates/journals/publication_detail.html +++ b/journals/templates/journals/publication_detail.html @@ -116,7 +116,7 @@ <ul class="list list-unstyled m-2"> {% for aff in affiliations_list %} - <li><sup>{{ forloop.counter }}</sup> <a href="{{ aff.get_absolute_url }}">{{ aff.name_full }}</a></li> + <li><sup>{{ forloop.counter }}</sup> <a href="{{ aff.get_absolute_url }}">{{ aff.full_name_with_acronym }}</a></li> {% endfor %} </ul> </div> @@ -132,9 +132,9 @@ {% for funder in publication.get_all_funders %} {% if funder.organization %} {% if funder.name != funder.organization.name and funder.name != funder.organization.name_original %} - <li>{{ funder }} (through Organization: <a href="{{ funder.organization.get_absolute_url }}">{{ funder.organization.name_and_acronym }}</a>)</li> + <li>{{ funder }} (through Organization: <a href="{{ funder.organization.get_absolute_url }}">{{ funder.organization.full_name_with_acronym }}</a>)</li> {% else %} - <li><a href="{{ funder.organization.get_absolute_url }}">{{ funder.organization.name_and_acronym }}</a></li> + <li><a href="{{ funder.organization.get_absolute_url }}">{{ funder.organization.full_name_with_acronym }}</a></li> {% endif %} {% else %} <li><a href="{{ funder.get_absolute_url }}">{{ funder }}</a></li> diff --git a/organizations/models.py b/organizations/models.py index 5a1f335dc563b2d17a1f638eb3620f38f1bff9c7..8297e3da99b0fe3cefd7fd1f8068c8064228352c 100644 --- a/organizations/models.py +++ b/organizations/models.py @@ -67,34 +67,20 @@ class Organization(models.Model): def __str__(self): return self.name - def name_and_acronym(self): - if self.acronym: - return '%s (%s)' % (self.name, self.acronym) - return self.name - - def name_full(self): - text = '' - if self.name_original: - text += self.name_original + ' / ' - text += self.name - if self.acronym: - text += ' (' + self.acronym + ')' - return text - @property def full_name(self): full_name_str = "" if self.name_original: full_name_str += "%s / " % self.name_original - full_name_str += "%s" % self + full_name_str += "%s" % self.name return full_name_str @property def full_name_with_acronym(self): - full_name_str = "" + full_name_str = self.full_name if self.acronym: - full_name_str += "[%s] " % self.acronym - return full_name_str + self.full_name + full_name_str += " [%s]" % self.acronym + return full_name_str def get_absolute_url(self): return reverse('organizations:organization_details', kwargs = {'pk': self.id})