Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
13fec18a
Commit
13fec18a
authored
Sep 11, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Truncate some text from dashboard events
parent
c9f741bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+7
-0
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+3
-1
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+1
-1
No files found.
app/helpers/application_helper.rb
View file @
13fec18a
...
...
@@ -235,4 +235,11 @@ module ApplicationHelper
"Search"
end
end
def
first_line
(
str
)
lines
=
str
.
split
(
"
\n
"
)
line
=
lines
.
first
line
+=
"..."
if
lines
.
size
>
1
line
end
end
app/helpers/events_helper.rb
View file @
13fec18a
...
...
@@ -123,6 +123,8 @@ module EventsHelper
end
def
event_note
(
text
)
sanitize
(
markdown
(
truncate
(
text
,
length:
150
)),
tags:
%w(a img b pre p)
)
text
=
first_line
(
text
)
text
=
truncate
(
text
,
length:
150
)
sanitize
(
markdown
(
text
),
tags:
%w(a img b pre p)
)
end
end
app/views/events/event/_push.html.haml
View file @
13fec18a
...
...
@@ -5,7 +5,7 @@
%strong
=
event
.
ref_name
-
else
=
link_to
project_commits_path
(
event
.
project
,
event
.
ref_name
)
do
%strong
=
event
.
ref_name
%strong
=
truncate
(
event
.
ref_name
,
length:
30
)
at
%strong
=
link_to_project
event
.
project
...
...
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