From b4aaced71a65faffd49ffa2c705fb574ed532701 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 21 Aug 2017 17:27:06 +0200 Subject: Fix display of push events for removed refs This changes the style of push events that remove tags or branches so they don't display the commit details. This prevents displaying commit details such as: 000000 . --broken encoding Instead we now simply display the header such as: Administrator deleted branch example-branch This is displayed in the same style as events for newly created branches/tags. This commit also ensures that if no commit message is present we simply don't display anything, instead of "--broken encoding". Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36685 Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36722 --- app/views/events/_event_push.atom.haml | 13 +++++++------ app/views/events/event/_push.html.haml | 4 ---- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'app/views/events') diff --git a/app/views/events/_event_push.atom.haml b/app/views/events/_event_push.atom.haml index bf655f9d21a..e3c5fd55f08 100644 --- a/app/views/events/_event_push.atom.haml +++ b/app/views/events/_event_push.atom.haml @@ -5,9 +5,10 @@ %i at = event.created_at.to_s(:short) - %blockquote= markdown(escape_once(event.commit_title), pipeline: :atom, project: event.project, author: event.author) - - if event.commits_count > 1 - %p - %i - \... and - = pluralize(event.commits_count - 1, "more commit") + - unless event.rm_ref? + %blockquote= markdown(escape_once(event.commit_title), pipeline: :atom, project: event.project, author: event.author) + - if event.commits_count > 1 + %p + %i + \... and + = pluralize(event.commits_count - 1, "more commit") diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml index 973c652ad88..53ebdd6d2ff 100644 --- a/app/views/events/event/_push.html.haml +++ b/app/views/events/event/_push.html.haml @@ -41,7 +41,3 @@ %li.commits-stat = link_to create_mr_path(project.default_branch, event.ref_name, project) do Create Merge Request -- elsif event.rm_ref? - .event-body - %ul.well-list.event_commits - = render "events/commit", project: project, event: event -- cgit v1.2.3