Made the person’s name and profile image on a post link back to their page....

Made the person’s name and profile image on a post link back to their page. Also put in more descriptive links to personal pages and the everyone timeline in the footers of posts.
parent f3772721
......@@ -83,55 +83,10 @@ module.exports = (app) ->
# This should never happen and probably shows that some sort of corrupted ID got through somehow.
return (new Date())
# Format the person’s name
personFormatter = (messageID) ->
personHandleDelimeter = messageID.lastIndexOf('Z-')
profileImagePath = ''
if personHandleDelimeter != -1
# From someone else
personHandle = messageID.substr(personHandleDelimeter+2)
# TODO: Once public profile pages are implemented, link to them.
return "#{personHandle}"
else
# This is the person themselves.
# TODO: Once the timestamps are in there, just return that.
return ''
addFriendLinkFormatter = (messageID) ->
personHandleDelimeter = messageID.lastIndexOf('Z-')
profileImagePath = ''
if personHandleDelimeter != -1
# From someone else
personHandle = messageID.substr(personHandleDelimeter+2)
addFriendLink = "indie://friend/#{personHandle}"
return addFriendLink
else
# This is the person themselves, no need to display a friend link.
return ''
addFriendTextFormatter = (messageID) ->
personHandleDelimeter = messageID.lastIndexOf('Z-')
profileImagePath = ''
if personHandleDelimeter != -1
return "<img class='add-friend-icon' src='/images/person_add@2x.png' alt='Send friend request'>"
else
# This is the person themselves, no need to display a friend link.
return ''
# Custom formatter for the profile image
profileImagePathFormatter = (messageID) ->
personHandle = messageID.substr(messageID.lastIndexOf('Z-')+2)
# console.log "Person handle for message: #{personHandle}"
profileImagePath = "/public/#{personHandle}/about/me.jpg"
return profileImagePath
# Format the person’s name
personLinkFormatter = (accountHandle) ->
return "/person/#{accountHandle}"
#
# Read the person details
......@@ -164,4 +119,4 @@ module.exports = (app) ->
# TODO: Add the formatters to the messages themselves so we don’t have to duplicate them on the client.
# Reverse the message order to match that of the Cocoa client.
response.render 'post', {accountHandle, accountHandle, indieFriendURL: indieFriendURL, profileImageURL: profileImageURL, profile: profile, message: message, __set: { formatters: {messageBodyIDFormatter: messageBodyIDFormatter, messageStatusIDFormatter: messageStatusIDFormatter, profileImagePathFormatter: profileImagePathFormatter, personFormatter:personFormatter, addFriendLinkFormatter: addFriendLinkFormatter, addFriendTextFormatter:addFriendTextFormatter, postDateFormatter:postDateFormatter, timestampFormatter: timestampFormatter}}}
response.render 'post', {accountHandle, accountHandle, indieFriendURL: indieFriendURL, profileImageURL: profileImageURL, profile: profile, message: message, __set: { formatters: {messageBodyIDFormatter: messageBodyIDFormatter, messageStatusIDFormatter: messageStatusIDFormatter, personLinkFormatter:personLinkFormatter, postDateFormatter:postDateFormatter, timestampFormatter: timestampFormatter}}}
......@@ -24,6 +24,11 @@ h1
border-bottom: 0;
}
h1 a
{
text-decoration: none;
}
h2
{
font-weight: 400;
......
......@@ -28,10 +28,9 @@
</style>
</head>
<body>
<header>
<img id="profile-image" data-set-attribute='src profileImageURL'>
<h1 id='name'><span data-set-text='profile.displayName'></span><a href='/'><img id='indieHopeBalloonLogo' src='/images/indie-hope-balloon-logo.png'></a></h1>
<a data-set-attribute='href accountHandle personLinkFormatter'><img id="profile-image" data-set-attribute='src profileImageURL'></a>
<h1 id='name'><a data-set-attribute='href accountHandle personLinkFormatter'><span data-set-text='profile.displayName'></span></a><a href='/'><img id='indieHopeBalloonLogo' src='/images/indie-hope-balloon-logo.png'></a></h1>
<p id='bio' data-set-text='html profile.bio'></p>
<p><a data-set-attribute='href indieFriendURL'><img class='add-friend-icon' src='/images/person_add@2x.png' alt='Send friend request'></a></p>
</header>
......@@ -52,7 +51,7 @@
</div>
</div>
<p>Return to <a href='/'>Everyone</a>.</p>
<p>See <a data-set-attribute='href accountHandle personLinkFormatter'>all my public posts</a>. See <a href='/'>everyone’s public posts</a>.</p>
<p><small>Sent from <a href='https://forum.ind.ie/t/heartbeat-pre-alpha-release/740'>Heartbeat</a>. Aggregated by <a href='https://forum.ind.ie/t/pre-alpha-conceptual-design/25'>Waystone</a>.</small></p>
......
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