FIX Showing the stable and outdated version number correctly.

This commit is contained in:
Cam Findlay 2014-12-10 14:35:05 +13:00
parent def89a2894
commit 272b7ae660
3 changed files with 6 additions and 6 deletions

View File

@ -30,17 +30,17 @@ class DocumentationViewerVersionWarning extends Extension {
$stable = $this->owner->getManifest()->getStableVersion($entity);
$compare = $entity->compare($stable);
if($entity->getVersion() == "master" || $compare > 0) {
return $this->owner->customise(new ArrayData(array(
'FutureRelease' => true,
'StableVersion' => DBField::create_field('HTMLText', $stable)
'StableVersion' => DBField::create_field('HTMLText', $stable->getVersion())
)));
}
else {
return $this->owner->customise(new ArrayData(array(
'OutdatedRelease' => true,
'StableVersion' => DBField::create_field('HTMLText', $stable)
'StableVersion' => DBField::create_field('HTMLText', $stable->getVersion())
)));
}

View File

@ -2,9 +2,9 @@
<div class="warningBoxTop">
<% loop VersionWarning %>
<% if OutdatedRelease %>
<p>This document contains information for an <strong>outdated</strong> version <% if Top.Version %>(<strong>$Top.Version</strong>)<% end_if %> and may not be maintained any more. If some of your projects still use this version, consider upgrading as soon as possible.</p>
<p>This document contains information for an <strong>outdated</strong> version <% if $Version %>(<strong>$Version</strong>)<% end_if %> and may not be maintained any more. If some of your projects still use this version, consider upgrading as soon as possible.</p>
<% else_if FutureRelease %>
<p>This document contains information about a <strong>future</strong> release <% if StableVersion %>and not the current stable version (<strong>$StableVersion</strong>)<% end_if %>. Be aware that information on this page may change and API's may not be stable for production use.</p>
<p>This document contains information about a <strong>future</strong> release <% if $VersionWarning.StableVersion %>and not the current stable version (<strong>$VersionWarning.StableVersion</strong>)<% end_if %>. Be aware that information on this page may change and API's may not be stable for production use.</p>
<% end_if %>
<% end_loop %>
</div>

View File

@ -1,6 +1,6 @@
<div id="documentation-page" class="box">
<% if VersionWarning %>
<% include DocumentationVersion_warning %>
<% include DocumentationVersion_warning Version=$Entity.Version %>
<% end_if %>
<% include DocumentationTableContents %>