From 7df8eaf29aa59467236c1b434bc09ccc33cd011f Mon Sep 17 00:00:00 2001
From: Carlos Tadeu Panato Junior <ctadeu@gmail.com>
Date: Mon, 14 Nov 2016 13:40:37 +0100
Subject: Update introduction message at top of channel/private groups (#4508)

* Update introduction message at top of channel/private groups

* fix grammar
---
 webapp/utils/channel_intro_messages.jsx | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

(limited to 'webapp/utils/channel_intro_messages.jsx')

diff --git a/webapp/utils/channel_intro_messages.jsx b/webapp/utils/channel_intro_messages.jsx
index 899e4e5a4..36d8cdb2a 100644
--- a/webapp/utils/channel_intro_messages.jsx
+++ b/webapp/utils/channel_intro_messages.jsx
@@ -147,10 +147,10 @@ export function createDefaultIntroMessage(channel, centeredIntro) {
 
 export function createStandardIntroMessage(channel, centeredIntro) {
     var uiName = channel.display_name;
-    var creatorName = '';
-
+    var creatorName = Utils.displayUsername(channel.creator_id);
     var uiType;
     var memberMessage;
+
     if (channel.type === 'P') {
         uiType = (
             <FormattedMessage
@@ -204,14 +204,30 @@ export function createStandardIntroMessage(channel, centeredIntro) {
     } else {
         createMessage = (
             <span>
-                <FormattedHTMLMessage
+                <FormattedMessage
                     id='intro_messages.creator'
-                    defaultMessage='This is the start of the <strong>{name}</strong> {type}, created by <strong>{creator}</strong> on <strong>{date}</strong>'
+                    defaultMessage='This is the start of the {name} {type}, created by {creator} on {date}.'
                     values={{
                         name: (uiName),
                         type: (uiType),
-                        date,
-                        creator: creatorName
+                        creator: (creatorName),
+                        date
+                    }}
+                />
+            </span>
+        );
+    }
+
+    var purposeMessage = '';
+    if (channel.purpose && channel.purpose !== '') {
+        purposeMessage = (
+            <span>
+                <FormattedMessage
+                    id='intro_messages.purpose'
+                    defaultMessage=" This {type}'s purpose is: {purpose}"
+                    values={{
+                        purpose: channel.purpose,
+                        type: (uiType)
                     }}
                 />
             </span>
@@ -232,6 +248,7 @@ export function createStandardIntroMessage(channel, centeredIntro) {
             <p className='channel-intro__content'>
                 {createMessage}
                 {memberMessage}
+                {purposeMessage}
                 <br/>
             </p>
             {createInviteChannelMemberButton(channel, uiType)}
-- 
cgit v1.2.3-1-g7c22

