Source: site.view [edit]
Function name: personProfile
Arguments: person
Description: Format person profile
Page type: webl
Render function:  
Module: collabExt

Page source:

var checkField = fun(person, fname, intro)
   if person[fname] != "" then
      return intro + person[fname] + "<p>\n"
   else
      return ""
   end
end;

 var res = "";
  
 var pic = person["picture-url"] ? "";

 if (pic == "") then
    pic = "http://www.talkingpointsmemo.com/assets_c/2009/12/AnonymousHead-cropped-proto-custom_5.jpg";
 end;
 
 
 res = res + `<table><tr><td><img src="` + pic + `"/></td><td>`;
 res = res + "<h1>" + person["name"] + "</h1>\n";
 res = res + checkField(person, "headline", "") + "</td></tr></table>\n";
 
 res = res + checkField(person, "summary", "");
 res = res + checkField(person, "location", "Location: ");

 /*
 var edus = WubEval(person["positions"]) ? [];
 every edu in edus do
    res = res + "<li>" + (edu["school-name"] ? "") + (", " + edu["degree"] ? "") + (" in " + edu["field-of-study"] ? "") + "</li>\n";
 end;
 res = res + "<p>\n";
 */
 
 var edus = WubEval(person["educations"]) ? [];
 every edu in edus do
    res = res + "<li>" + (edu["school-name"] ? "") + (", " + edu["degree"] ? "") + (" in " + edu["field-of-study"] ? "") + "</li>\n";
 end;
 res = res + "<p>\n";

 res = res + "Education Score: " + person.eduScore + "<p>\n";
 res = res + "School Score: " + person.schoolScore + "<p>\n";
 res = res + `<a target="_blank" href="` + person["site-standard-profile-request"] + `">LinkedIn Profile` +
                      `</a><p>`;
  
var piece = NewPiece(res, "text/html");
WubCall("searchRender", [piece]);