Skip to content

Commit

Permalink
Address suggestions from code review in readthedocs#8237
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jun 30, 2021
1 parent 65ddf48 commit 967776a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion readthedocs/api/v2/templates/restapi/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dt>{% trans "Versions" %}</dt>
{% for version in versions %}
<dd {% if version == current_version %} class="rtd-current-item" {% endif %}>
<a href="{{ version.get_subdomain_url }}{{ path|default_if_none:"" }}">{{ version.explicit_name }}</a>
<a href="{{ version.get_subdomain_url }}{{ path|default_if_none:"" }}">{{ version.verbose_name }}</a>
</dd>
{% endfor %}
</dl>
Expand Down
7 changes: 3 additions & 4 deletions readthedocs/builds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,16 @@ def explicit_name(self):
For example, if a version originates from GitHub pull request #4, then
``version.explicit_name == "#4 (PR)"``.
On the other hand, Versions associated with regular ReadTheDocs builds
On the other hand, Versions associated with regular RTD builds
(e.g. new tags or branches), simply return :obj:`~.verbose_name`.
This means that a regular git tag named **v4** will correspond to
``version.explicit_name == "v4"``.
"""
external_origin = external_version_name(self)

if not external_origin:
if not self.is_external:
return self.verbose_name

template = '#{name} ({abbrev})'
external_origin = external_version_name(self)
abbrev = ''.join(word[0].upper() for word in external_origin.split())
return template.format(name=self.verbose_name, abbrev=abbrev)

Expand Down

0 comments on commit 967776a

Please sign in to comment.