Skip to content

Commit

Permalink
Add release date to downloads (gocd#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
varshavaradarajan committed Aug 14, 2019
1 parent 9ab197f commit d19bca2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 10 additions & 1 deletion source/assets/javascripts/app/_download.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ var showDownloadLinks = (function ($) {
);
});

var addReleaseDate = R.curry(function (release) {
return R.assoc(
"release_date",
new Date(release["release_time_readable"]).toDateString(),
release
);
});

var compareVersions = function (propertyToCompareOn) {
return function (a, b) {
var i, diff;
Expand Down Expand Up @@ -135,7 +143,8 @@ var showDownloadLinks = (function ($) {
releasesLessThanAYearOld,
R.sort(compareVersions("go_full_version")),
R.map(addURLToFiles),
R.map(addDisplayVersion)
R.map(addDisplayVersion),
R.map(addReleaseDate)
)(releaseData[0]);
var cloudReleases = R.compose(
releasesLessThanAYearOld,
Expand Down
10 changes: 8 additions & 2 deletions source/download.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ meta_keywords: "GoCD download, go agent download, go cd download, install gocd"
<div class="latest">
{{#with latest_release}}
<div class="go-release {{display_version}} row">
<div class="col-xs-12">
<div class="col-xs-7">
<span class="version">Version: {{display_version}}</span>
</div>
<div class="col-xs-5">
<span class="version">Released: {{release_date}}</span>
</div>
{{#with (lookup . ../installer_type)}}
<div class="col-xs-12">
<div class="files">
Expand Down Expand Up @@ -191,9 +194,12 @@ meta_keywords: "GoCD download, go agent download, go cd download, install gocd"
<div class="old-release">
{{#each all_other_releases}}
<div class="row go-release {{display_version}}">
<div class="col-xs-12">
<div class="col-xs-7">
<span class="version">Version: {{display_version}}</span>
</div>
<div class="col-xs-5">
<span class="version">Released: {{release_date}}</span>
</div>
{{#if (lookup . ../installer_type)}}
{{#with (lookup . ../installer_type)}}
<div class="col-xs-12">
Expand Down

0 comments on commit d19bca2

Please sign in to comment.