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
02eca79e
Commit
02eca79e
authored
Sep 12, 2014
by
uran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed activity notes to display first MEANINGFUL line.
parent
a034a466
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
application_helper.rb
app/helpers/application_helper.rb
+0
-7
events_helper.rb
app/helpers/events_helper.rb
+1
-1
gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+8
-0
No files found.
app/helpers/application_helper.rb
View file @
02eca79e
...
...
@@ -187,13 +187,6 @@ module ApplicationHelper
end
end
def
first_line
(
str
)
lines
=
str
.
split
(
"
\n
"
)
line
=
lines
.
first
line
+=
"..."
if
lines
.
size
>
1
line
end
def
broadcast_message
BroadcastMessage
.
current
end
...
...
app/helpers/events_helper.rb
View file @
02eca79e
...
...
@@ -136,7 +136,7 @@ module EventsHelper
end
def
event_note
(
text
)
text
=
first_line
(
text
)
text
=
first_line
_in_markdown
(
text
)
text
=
truncate
(
text
,
length:
150
)
sanitize
(
markdown
(
text
),
tags:
%w(a img b pre p)
)
end
...
...
app/helpers/gitlab_markdown_helper.rb
View file @
02eca79e
...
...
@@ -51,6 +51,14 @@ module GitlabMarkdownHelper
@markdown
.
render
(
text
).
html_safe
end
def
first_line_in_markdown
(
text
)
line
=
text
.
split
(
"
\n
"
).
detect
do
|
i
|
i
.
present?
&&
markdown
(
i
).
present?
end
line
+=
'...'
unless
line
.
nil?
line
end
def
render_wiki_content
(
wiki_page
)
if
wiki_page
.
format
==
:markdown
markdown
(
wiki_page
.
content
)
...
...
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