Now that there is no separate about page for the person, refactored folder...

Now that there is no separate about page for the person, refactored folder structure to simplify it.
parent 0093271d
......@@ -323,10 +323,7 @@ app.get '/', require('./routes/public/public.coffee')(app)
app.get '/person/:accountHandle/post/:messageID', require('./routes/public/post.coffee')(app)
# A person’s feed
app.get '/person/:accountHandle', require('./routes/public/person/index.coffee')(app)
# A person’s about page
app.get '/person/:accountHandle/about', require('./routes/public/person/about.coffee')(app)
app.get '/person/:accountHandle', require('./routes/public/person.coffee')(app)
# The profile image for a person
app.get '/person/:accountHandle/about/me.jpg', (request, response) =>
......
......@@ -2,8 +2,8 @@ fs = require 'fs-extra-as-promised'
moment = require 'moment'
path = require 'path-extra'
TeleportationAPI = require '../../../TeleportationAPI'
PublicTimelineWeaver = require '../../../PublicTimelineWeaver'
TeleportationAPI = require '../../TeleportationAPI'
PublicTimelineWeaver = require '../../PublicTimelineWeaver'
module.exports = (app) ->
......@@ -171,5 +171,4 @@ module.exports = (app) ->
(new PublicTimelineWeaver).getTimeline("#{accountHandle}-messages").then (messages) ->
# Reverse the message order to match that of the Cocoa client.
# messages.reverse()
response.render 'person/index', {indieFriendURL: indieFriendURL, profileImageURL: profileImageURL, profile: profile, messages: messages, __set: { formatters: {messageBodyIDFormatter: messageBodyIDFormatter, messageStatusIDFormatter: messageStatusIDFormatter, profileImagePathFormatter: profileImagePathFormatter, personFormatter:personFormatter, addFriendLinkFormatter: addFriendLinkFormatter, addFriendTextFormatter:addFriendTextFormatter, postDateFormatter:postDateFormatter, timestampFormatter: timestampFormatter, permanentLinkFormatter: permanentLinkFormatter}}}
response.render 'person', {indieFriendURL: indieFriendURL, profileImageURL: profileImageURL, profile: profile, messages: messages, __set: { formatters: {messageBodyIDFormatter: messageBodyIDFormatter, messageStatusIDFormatter: messageStatusIDFormatter, profileImagePathFormatter: profileImagePathFormatter, personFormatter:personFormatter, addFriendLinkFormatter: addFriendLinkFormatter, addFriendTextFormatter:addFriendTextFormatter, postDateFormatter:postDateFormatter, timestampFormatter: timestampFormatter, permanentLinkFormatter: permanentLinkFormatter}}}
\ No newline at end of file
Promise = require 'thrush'
superagent = require 'superagent'
path = require 'path-extra'
fs = require 'fs-extra-as-promised'
TeleportationAPI = require '../../../TeleportationAPI'
module.exports = (app) ->
route = (request, response) ->
# Read the details
accountHandle = request.param 'accountHandle'
console.log "Account handle: #{accountHandle}"
mainFolderForPerson = (new TeleportationAPI).folderForHandle(accountHandle)
aboutPersonFolder = path.join mainFolderForPerson, 'public', 'from', 'about'
console.log "About person folder: #{aboutPersonFolder}"
profileDataPath = path.join(aboutPersonFolder, "me.json")
friendRequestLinkFormatter = (accountHandle) ->
return "indie://friend/#{accountHandle}"
fs.readFileAsync(profileDataPath)
.then (profileData) ->
profile = JSON.parse(profileData)
response.render 'person/about', {profile: profile, __set: {formatters: {friendRequestLinkFormatter: friendRequestLinkFormatter}}}
......@@ -41,7 +41,7 @@ function getOlderMessages(){
superagent
// .get('https://waystone.ind.ie/posts-before/'+oldestPostID)
.get('http://192.168.59.103:3000/posts-before/'+oldestPostID+'/for/aral1619-messages')
.get('http://192.168.59.103:3000/posts-before/'+oldestPostID+'/for/aral-messages')
// .get('//' + set.meta.waystoneURL +'/posts-before/'+oldestPostID)
.end(function(error, posts) {
......@@ -283,7 +283,7 @@ window.addEventListener('load', function(){
// TODO: Fix Set injectData so we don’t have to use this metadata injection workaround.
superagent
// .get('https://waystone.ind.ie/posts-after/'+newestPostID)
.get('http://192.168.59.103:3000/posts-after/'+newestPostID+'/for/aral1619-messages')
.get('http://192.168.59.103:3000/posts-after/'+newestPostID+'/for/aral-messages')
// .get('//' + set.meta.waystoneURL +'/posts-after/'+newestPostID)
.end(function(error, posts) {
//
......
<!doctype html>
<html lang='en'>
<head>
<title>About Me</title>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width'>
<link rel='stylesheet' href='./css/styles.css'>
</head>
<body>
<img id='profile-image' src='/about/me.jpg'>
<h1 id='name' data-set-text='profile.displayName'></h1>
<nav>
<ul>
<li><a href='./'>Home</li>
<li><a href='./about'>About</a></li>
</ul>
</nav>
<p id='bio' data-set-text='html profile.bio'></p>
<p><a data-set-attribute='href profile.accountHandle friendRequestLinkFormatter'>Send me a friend request.</a></p>
</body>
</html>
\ No newline at end of file
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