Commit aef2122f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'css-truncation' into 'master'

CSS truncation

Use css truncation for event titles on dashboard. Fix vertical align of timestamps
parents 7ad5fb53 c4562316
...@@ -71,12 +71,7 @@ pre { ...@@ -71,12 +71,7 @@ pre {
} }
.str-truncated { .str-truncated {
display: inline-block; @include str-truncated;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
max-width: 82%;
} }
/** FLASH message **/ /** FLASH message **/
......
...@@ -123,3 +123,12 @@ ...@@ -123,3 +123,12 @@
margin-top: 0px; margin-top: 0px;
margin-bottom: 15px; margin-bottom: 15px;
} }
@mixin str-truncated($max_width: "82%") {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
max-width: $max_width;
}
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
padding: 12px 0px; padding: 12px 0px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
.event-title { .event-title {
@include str-truncated(72%);
color: #333; color: #333;
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
...@@ -135,6 +136,12 @@ ...@@ -135,6 +136,12 @@
} }
} }
} }
.event-item-timestamp {
float: right;
color: #999;
line-height: 22px;
}
} }
/** /**
...@@ -166,3 +173,13 @@ ...@@ -166,3 +173,13 @@
} }
} }
} }
/*
* Last push widget
*/
.event-last-push {
.event-last-push-text {
@include str-truncated(75%);
line-height: 24px;
}
}
- if event.proper? - if event.proper?
.event-item{class: "#{event.body? ? "event-block" : "event-inline" }"} .event-item{class: "#{event.body? ? "event-block" : "event-inline" }"}
%span.cgray.pull-right .event-item-timestamp
#{time_ago_with_tooltip(event.created_at)} #{time_ago_with_tooltip(event.created_at)}
= cache event do = cache event do
......
- if show_last_push_widget?(event) - if show_last_push_widget?(event)
.event-last-push .event-last-push
%span You pushed to .event-last-push-text
= link_to project_commits_path(event.project, event.ref_name) do %span You pushed to
%strong= truncate(event.ref_name, length: 28) = link_to project_commits_path(event.project, event.ref_name) do
at %strong= event.ref_name
%strong= link_to_project event.project at
#{time_ago_with_tooltip(event.created_at)} %strong= link_to_project event.project
#{time_ago_with_tooltip(event.created_at)}
.pull-right .pull-right
= link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-small" do = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-small" do
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%strong= event.ref_name %strong= event.ref_name
- else - else
= link_to project_commits_path(event.project, event.ref_name) do = link_to project_commits_path(event.project, event.ref_name) do
%strong= truncate(event.ref_name, length: 30) %strong= event.ref_name
at at
= link_to_project event.project = link_to_project event.project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment