BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3d99ffc8
Commit
3d99ffc8
authored
Mar 02, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edited timeago text on comments
Unified the 'edited text' to be the same in descriptions and comments Closes #5538
parent
491ac7ce
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
24 deletions
+35
-24
notes.js.coffee
app/assets/javascripts/notes.js.coffee
+1
-0
issuable.scss
app/assets/stylesheets/pages/issuable.scss
+8
-0
application_helper.rb
app/helpers/application_helper.rb
+23
-7
show.html.haml
app/views/projects/issues/show.html.haml
+1
-4
_mr_box.html.haml
app/views/projects/merge_requests/show/_mr_box.html.haml
+1
-4
_note.html.haml
app/views/projects/notes/_note.html.haml
+1
-9
No files found.
app/assets/javascripts/notes.js.coffee
View file @
3d99ffc8
...
...
@@ -328,6 +328,7 @@ class @Notes
updateNote
:
(
_xhr
,
note
,
_status
)
=>
# Convert returned HTML to a jQuery object so we can modify it further
$html
=
$
(
note
.
html
)
$
(
'.js-timeago'
,
$html
).
timeago
()
$html
.
syntaxHighlight
()
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
3d99ffc8
...
...
@@ -262,3 +262,11 @@
color
:
$gray-darkest
;
}
}
.edited-text
{
color
:
$gray-darkest
;
.author_link
{
color
:
$gray-darkest
;
}
}
app/helpers/application_helper.rb
View file @
3d99ffc8
...
...
@@ -182,20 +182,36 @@ module ApplicationHelper
# Returns an HTML-safe String
def
time_ago_with_tooltip
(
time
,
placement:
'top'
,
html_class:
'time_ago'
,
skip_js:
false
)
element
=
content_tag
:time
,
time
.
to_s
,
class:
"
#{
html_class
}
js-timeago
js-timeago-pending
"
,
class:
"
#{
html_class
}
js-timeago"
,
datetime:
time
.
to_time
.
getutc
.
iso8601
,
title:
time
.
in_time_zone
.
to_s
(
:medium
),
data:
{
toggle:
'tooltip'
,
placement:
placement
,
container:
'body'
}
unless
skip_js
element
<<
javascript_tag
(
"$('.js-timeago-pending').removeClass('js-timeago-pending').timeago()"
)
end
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
content_tag
:small
,
class:
"edited-text"
do
output
=
content_tag
:span
do
"Edited "
end
output
+=
time_ago_with_tooltip
(
object
.
updated_at
)
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
)
end
end
output
end
end
def
render_markup
(
file_name
,
file_content
)
if
gitlab_markdown?
(
file_name
)
Haml
::
Helpers
.
preserve
(
markdown
(
file_content
))
...
...
app/views/projects/issues/show.html.haml
View file @
3d99ffc8
...
...
@@ -63,10 +63,7 @@
=
markdown
(
@issue
.
description
,
cache_key:
[
@issue
,
"description"
])
%textarea
.hidden.js-task-list-field
=
@issue
.
description
-
if
@issue
.
updated_at
!=
@issue
.
created_at
%small
Edited
=
time_ago_with_tooltip
(
@issue
.
updated_at
,
placement:
'bottom'
,
html_class:
'issue_edited_ago'
)
=
edited_time_ago_with_tooltip
(
@issue
,
placement:
'bottom'
,
html_class:
'issue_edited_ago'
)
.merge-requests
=
render
'merge_requests'
...
...
app/views/projects/merge_requests/show/_mr_box.html.haml
View file @
3d99ffc8
...
...
@@ -11,7 +11,4 @@
%textarea
.hidden.js-task-list-field
=
@merge_request
.
description
-
if
@merge_request
.
updated_at
!=
@merge_request
.
created_at
%small
Edited
=
time_ago_with_tooltip
(
@merge_request
.
updated_at
,
placement:
'bottom'
)
=
edited_time_ago_with_tooltip
(
@merge_request
,
placement:
'bottom'
)
app/views/projects/notes/_note.html.haml
View file @
3d99ffc8
...
...
@@ -27,20 +27,13 @@
%span
.note-last-update
%a
{
name:
dom_id
(
note
),
href:
"##{dom_id(note)}"
,
title:
'Link here'
}
=
time_ago_with_tooltip
(
note
.
created_at
,
placement:
'bottom'
,
html_class:
'note_created_ago'
)
-
if
note
.
updated_at
!=
note
.
created_at
%span
.note-updated-at
·
=
icon
(
'edit'
,
title:
'edited'
)
=
time_ago_with_tooltip
(
note
.
updated_at
,
placement:
'bottom'
,
html_class:
'note_edited_ago'
)
-
if
note
.
updated_by
&&
note
.
updated_by
!=
note
.
author
by
#{
link_to_member
(
note
.
project
,
note
.
updated_by
,
avatar:
false
,
author_class:
nil
)
}
.note-body
{
class:
note_editable?
(
note
)
?
'js-task-list-container'
:
''
}
.note-text
=
preserve
do
=
markdown
(
note
.
note
,
pipeline: :note
,
cache_key:
[
note
,
"note"
])
-
if
note_editable?
(
note
)
=
render
'projects/notes/edit_form'
,
note:
note
=
edited_time_ago_with_tooltip
(
note
,
placement:
'bottom'
,
html_class:
'note_edited_ago'
,
include_author:
true
)
-
if
note
.
attachment
.
url
.note-attachment
...
...
@@ -54,4 +47,3 @@
=
link_to
delete_attachment_namespace_project_note_path
(
note
.
project
.
namespace
,
note
.
project
,
note
),
title:
'Delete this attachment'
,
method: :delete
,
remote:
true
,
data:
{
confirm:
'Are you sure you want to remove the attachment?'
},
class:
'danger js-note-attachment-delete'
do
=
icon
(
'trash-o'
,
class:
'cred'
)
.clear
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment