From 02ad431fb060c977b20d1f87bc17dd91f09f1dc0 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 3 Sep 2016 21:50:21 +0200 Subject: [PATCH] Fix conversations message overflow when posting code Related issue: https://github.com/twbs/bootstrap/issues/15958 closes #7055 --- Changelog.md | 1 + app/views/conversations/_message.html.haml | 10 ++++++++++ .../{_message.haml => _message.mobile.haml} | 8 ++------ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 app/views/conversations/_message.html.haml rename app/views/conversations/{_message.haml => _message.mobile.haml} (55%) diff --git a/Changelog.md b/Changelog.md index 56b8a17ed..4ea3f51e7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ ## Bug fixes * Post comments no longer get collapsed when interacting with a post [#7040](https://github.com/diaspora/diaspora/pull/7040) * Closed accounts will no longer show up in the account search [#7042](https://github.com/diaspora/diaspora/pull/7042) +* Code blocks in conversations no longer overflow the content [#7055](https://github.com/diaspora/diaspora/pull/7055) ## Features * Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045) diff --git a/app/views/conversations/_message.html.haml b/app/views/conversations/_message.html.haml new file mode 100644 index 000000000..1834e5920 --- /dev/null +++ b/app/views/conversations/_message.html.haml @@ -0,0 +1,10 @@ +.stream_element.message{data: {guid: message.id}, id: ("first_unread" if @first_unread_message_id == message.id)} + .media + = person_image_link(message.author, size: :thumb_small, class: "img") + .bd + = person_link(message.author, class: "author from") + = timeago(message.created_at) + + %div{class: direction_for(message.text)} + .message-content + = message.message.markdownified diff --git a/app/views/conversations/_message.haml b/app/views/conversations/_message.mobile.haml similarity index 55% rename from app/views/conversations/_message.haml rename to app/views/conversations/_message.mobile.haml index 996ae3bc5..d40a3b15e 100644 --- a/app/views/conversations/_message.haml +++ b/app/views/conversations/_message.mobile.haml @@ -1,15 +1,11 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - .stream_element.message{data: {guid: message.id}, id: ("first_unread" if @first_unread_message_id == message.id)} .media .media-left = person_image_link(message.author, size: :thumb_small, class: "media-object") .media-body - = person_link(message.author, :class => 'author from') + = person_link(message.author, class: "author from") = timeago(message.created_at) - %div{ :class => direction_for(message.text) } + %div{class: direction_for(message.text)} .message-content = message.message.markdownified