From 3951eb62705046fb2de6c836a82c1cad043d3036 Mon Sep 17 00:00:00 2001 From: Takuya Noguchi Date: Mon, 17 Jul 2017 00:11:32 +0900 Subject: [PATCH] Use only CSS to truncate commit message in blame --- app/assets/stylesheets/framework/files.scss | 10 ++++++++++ app/views/projects/blame/show.html.haml | 4 ++-- ...63-url-in-commit-message-can-be-broken-in-blame.yml | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/35163-url-in-commit-message-can-be-broken-in-blame.yml diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss index c7c2684d548..8ad082f7a65 100644 --- a/app/assets/stylesheets/framework/files.scss +++ b/app/assets/stylesheets/framework/files.scss @@ -163,8 +163,18 @@ td.blame-commit { padding: 5px 10px; min-width: 400px; + max-width: 400px; background: $gray-light; border-left: 3px solid; + + .commit-row-title { + display: flex; + } + + .item-title { + flex: 1; + margin-right: 0.5em; + } } @for $i from 0 through 5 { diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index f11afe8fc22..c7359d873d9 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -21,8 +21,8 @@ .commit = author_avatar(commit, size: 36) .commit-row-title - %strong - = link_to_gfm truncate(commit.title, length: 35), project_commit_path(@project, commit.id), class: "cdark" + %span.item-title.str-truncated-100 + = link_to_gfm commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title .pull-right = link_to commit.short_id, project_commit_path(@project, commit), class: "commit-sha"   diff --git a/changelogs/unreleased/35163-url-in-commit-message-can-be-broken-in-blame.yml b/changelogs/unreleased/35163-url-in-commit-message-can-be-broken-in-blame.yml new file mode 100644 index 00000000000..4fd60a79782 --- /dev/null +++ b/changelogs/unreleased/35163-url-in-commit-message-can-be-broken-in-blame.yml @@ -0,0 +1,4 @@ +--- +title: Use only CSS to truncate commit message in blame +merge_request: 12900 +author: Takuya Noguchi