Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-03 18:07:45 +0300
committerPhil Hughes <me@iamphill.com>2016-03-10 11:39:47 +0300
commit538f3e0d716d0f8c107af030fb318808f9e284ac (patch)
treeef542707611931613bc4764e32ba09f2f80b185e /app/helpers/application_helper.rb
parent3d99ffc862b76c4dcc560aa8d8f4f9c1b7dd3f81 (diff)
Fixed ruby issues from feedback
Fixed failing tests
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index cc4d2a8877d..f99a14c0e01 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -168,7 +168,6 @@ module ApplicationHelper
# time - Time object
# placement - Tooltip placement String (default: "top")
# html_class - Custom class for `time` element (default: "time_ago")
- # skip_js - When true, exclude the `script` tag (default: false)
#
# By default also includes a `script` element with Javascript necessary to
# initialize the `timeago` jQuery extension. If this method is called many
@@ -180,7 +179,7 @@ module ApplicationHelper
# `html_class` argument is provided.
#
# Returns an HTML-safe String
- def time_ago_with_tooltip(time, placement: 'top', html_class: 'time_ago', skip_js: false)
+ def time_ago_with_tooltip(time, placement: 'top', html_class: 'time_ago')
element = content_tag :time, time.to_s,
class: "#{html_class} js-timeago",
datetime: time.to_time.getutc.iso8601,
@@ -190,21 +189,17 @@ module ApplicationHelper
element
end
- def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', skip_js: false, include_author: false)
- return nil if object.updated_at == object.created_at
+ def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', include_author: false)
+ return if object.updated_at == object.created_at
content_tag :small, class: "edited-text" do
- output = content_tag :span do
- "Edited "
- end
- output += time_ago_with_tooltip(object.updated_at)
+ output = content_tag(:span, "Edited ")
+ output << time_ago_with_tooltip(object.updated_at, placement: placement, html_class: html_class)
if include_author
if object.updated_by && object.updated_by != object.author
- output += content_tag :span do
- " by "
- end
- output += link_to_member(object.project, object.updated_by, avatar: false, author_class: nil)
+ output << content_tag(:span, " by ")
+ output << link_to_member(object.project, object.updated_by, avatar: false, author_class: nil)
end
end