Skip to content

Commit

Permalink
Merge pull request #3504 from stsewd/consistent-version-format
Browse files Browse the repository at this point in the history
Consistent version format
  • Loading branch information
humitos authored May 24, 2018
2 parents 24a9a0c + 3250b32 commit 15972f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function init(data) {
warning
.find('a')
.attr('href', currentURL)
.text(data.version);
.text(data.slug);

var body = $("div.body");
if (!body.length) {
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/restapi/views/footer_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_version_compare_data(project, base_version=None):
}
if highest_version_obj:
ret_val['url'] = highest_version_obj.get_absolute_url()
ret_val['slug'] = (highest_version_obj.slug,)
ret_val['slug'] = highest_version_obj.slug
if base_version and base_version.slug != LATEST:
try:
base_version_comparable = parse_version_failsafe(
Expand Down
14 changes: 7 additions & 7 deletions readthedocs/rtd_tests/tests/test_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_highest_version_from_stable(self):
valid_data = {
'project': 'Version 0.8.1 of Pip (19)',
'url': '/dashboard/pip/version/0.8.1/',
'slug': ('0.8.1',),
'slug': '0.8.1',
'version': '0.8.1',
'is_highest': True,
}
Expand All @@ -123,7 +123,7 @@ def test_highest_version_from_lower(self):
valid_data = {
'project': 'Version 0.8.1 of Pip (19)',
'url': '/dashboard/pip/version/0.8.1/',
'slug': ('0.8.1',),
'slug': '0.8.1',
'version': '0.8.1',
'is_highest': False,
}
Expand All @@ -136,7 +136,7 @@ def test_highest_version_from_latest(self):
valid_data = {
'project': 'Version 0.8.1 of Pip (19)',
'url': '/dashboard/pip/version/0.8.1/',
'slug': ('0.8.1',),
'slug': '0.8.1',
'version': '0.8.1',
'is_highest': True,
}
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_highest_version_over_branches(self):
valid_data = {
'project': 'Version 1.0.0 of Pip ({})'.format(version.pk),
'url': '/dashboard/pip/version/1.0.0/',
'slug': ('1.0.0',),
'slug': '1.0.0',
'version': '1.0.0',
'is_highest': False,
}
Expand All @@ -178,7 +178,7 @@ def test_highest_version_without_tags(self):
valid_data = {
'project': 'Version 0.8.1 of Pip (19)',
'url': '/dashboard/pip/version/0.8.1/',
'slug': ('0.8.1',),
'slug': '0.8.1',
'version': '0.8.1',
'is_highest': True,
}
Expand All @@ -189,7 +189,7 @@ def test_highest_version_without_tags(self):
valid_data = {
'project': 'Version 0.8.1 of Pip (19)',
'url': '/dashboard/pip/version/0.8.1/',
'slug': ('0.8.1',),
'slug': '0.8.1',
'version': '0.8.1',
'is_highest': False,
}
Expand All @@ -206,7 +206,7 @@ def test_highest_version_without_tags(self):
valid_data = {
'project': 'Version 2.0.0 of Pip ({})'.format(version.pk),
'url': '/dashboard/pip/version/2.0.0/',
'slug': ('2.0.0',),
'slug': '2.0.0',
'version': '2.0.0',
'is_highest': False,
}
Expand Down

0 comments on commit 15972f1

Please sign in to comment.