Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release date to downloads (#963) #1041

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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