From 304979f89777f4aca52b382fdbe3a593dc7e50f3 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 10 Jun 2016 15:11:53 +0200 Subject: [PATCH] Allow to show the time in the future --- app/assets/javascripts/application.js.coffee | 2 ++ app/helpers/time_helper.rb | 1 - app/views/projects/builds/_sidebar.html.haml | 11 +++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 69d4c4f5dd3..33e593f4376 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -254,6 +254,8 @@ $ -> .on "resize.app", (e) -> fitSidebarForSize() + jQuery.timeago.settings.allowFuture = true; + gl.awardsHandler = new AwardsHandler() checkInitialSidebarSize() new Aside() diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb index 8142f733e76..b04b0a5114c 100644 --- a/app/helpers/time_helper.rb +++ b/app/helpers/time_helper.rb @@ -20,7 +20,6 @@ module TimeHelper end end - def date_from_to(from, to) "#{from.to_s(:short)} - #{to.to_s(:short)}" end diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index 0741426b5af..14571145313 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -16,11 +16,14 @@ .title Build artifacts - if @build.artifacts_expired? - .artifacts-expired.alert.alert-warning - The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} + %p + The artifacts were removed + #{time_ago_with_tooltip(@build.artifacts_expire_at)} - elsif @build.artifacts_expire_at - .artifacts-expired.alert.alert-warning - The artifacts will be removed in #{time_interval_in_words(@build.artifacts_expire_in)} + %p + The artifacts will be removed in + #{time_ago_with_tooltip(@build.artifacts_expire_at)} + - if @build.artifacts? .btn-group.btn-group-justified{ role: :group } - if @build.artifacts_expire_at