in site/js/projects.js [154:373]
function renderProjectPage(project, projectId) {
var obj = document.getElementById('contents');
if ((!project || !project.name) && projects[projectId]) {
// no DOAP file but known project: podling (loaded from podlings.json)
project = projects[projectId];
}
if (!project || !project.name) {
obj.innerHTML = "<h2>Sorry, I don't have any information available about this project</h2>";
return;
}
fixProjectName(project);
var isIncubating = project && (project.podling || (project.pmc == 'incubator'));
var unixgroup = projectIdToUnixGroup(projectId, project && project.pmc);
var committeeId = isIncubating ? 'incubator' : unixgroup;
if (!committees[unixgroup]) {
// at least one committee has a unix group that is different from committee id: webservices (group=ws), see parsecommittees.py#group_ids
// search instead of hard-coding the currently known case
for (p in committees) {
if (committees[p].group == unixgroup) {
committeeId = p;
break;
}
}
}
var committee = committees[committeeId];
if (!committee) {
obj.innerHTML = "<h2>Cannot find the PMC '" + committeeId + "' for this project. Check the DOAP is correct.</h2>";
return;
}
// Start by splitting the name, thus fetching the root name of the project, and not the sub-project.
var description = "";
if (project) {
if (!_.isEmpty(project.description)) {
description = project.description;
} else if (!_.isEmpty(project.shortdesc)) {
description = project.shortdesc;
} else if (!_.isEmpty(committee.shortdesc)) {
description = committee.shortdesc;
} else {
description = "No description available";
}
}
// Title + description
obj.innerHTML = "<h1>" + project.name + " <font size='-1'>(a project managed by the <a href='committee.html?" + committeeId + "'>" + committee.name + " Committee</a>)</font></h1>";
// project description
appendElementWithInnerHTML(obj,'p',description.replace(/([^\r\n]+)\r?\n\r?\n/g,function(a) { return "<p>"+a+"</p>"}));
var ul = document.createElement('ul');
// Base data
appendElementWithInnerHTML(obj,'h4',"Project base data:");
if (project.description && project.shortdesc) {
appendLiInnerHTML(ul, "<b>Short description:</b> " + project.shortdesc);
}
// Categories
if (project.category) {
var arr = project.category.split(/,\s*/);
var pls = "";
for (i in arr) {
var cat = arr[i];
// categories are downcased so fix up the anchor
pls += "<a href='projects.html?category#" + cat.toLowerCase() + "'>" + cat + "</a> ";
}
appendLiInnerHTML(ul, "<b>Category:</b> " + pls);
}
// Website
if (project.homepage) {
appendLiInnerHTML(ul, "<b>Website:</b> <a href='" + project.homepage + "' target='_blank'>" + project.homepage + "</a>");
}
if (isIncubating) {
appendLiInnerHTML(ul, "<b>Project status:</b> <span class='ppodling'>Incubating</span>");
} else if (committeeId != 'attic') {
appendLiInnerHTML(ul, "<b>Project status:</b> <span class='pactive'>Active</span>");
} else {
appendLiInnerHTML(ul, "<b>Project status:</b> <span class='pretired'>Retired</span>");
}
// Committers
if (isIncubating && unixgroups[unixgroup]) {
var commitl = [];
var commitgroup = unixgroups[unixgroup];
for (i in commitgroup) {
commitl.push(linkCommitterIndex(commitgroup[i]));
}
appendLiInnerHTML(ul, "<b>Committers (" + commitgroup.length + "):</b> <blockquote>" + commitl.join(", ") + "</blockquote>");
}
if (project.implements) {
var stds = document.createElement('ul');
var impl;
for (impl in project.implements) {
impl = project.implements[impl];
var std = "";
if (impl.body) {
std += impl.body + ' ';
}
if (impl.id) {
std += "<a href='" + impl.url + "'>" + impl.id + "</a>: " + impl.title;
} else {
std += "<a href='" + impl.url + "'>" + impl.title + "</a>";
}
appendLiInnerHTML(stds, std);
}
appendLiInnerHTML(ul, "<b>Implemented standards</b>").appendChild(stds);
}
// doap/rdf
if (project.doap) {
appendLiInnerHTML(ul, "<b>Project data file:</b> <a href='" + project.doap + "' target='_blank'>DOAP RDF Source</a> (<a href='json/projects/" + projectId + ".json'>generated json</a>)");
} else {
appendLiInnerHTML(ul, "<b>Project data file:</b> no <a href='https://projects.apache.org/create.html'>DOAP file</a> available");
}
// maintainer
if (project.maintainer) {
var mt;
var maintainers = "";
for (mt in project.maintainer) {
mt = project.maintainer[mt];
if (mt.mbox) {
var id = mt.mbox;
id = id.substr(id.indexOf(':') + 1);
id = id.substr(0, id.indexOf('@'));
if (people[id]) {
maintainers += linkCommitterIndex(id) + " ";
} else {
maintainers += "<a href='" + mt.mbox + "'>" + mt.name + "</a> ";
}
} else {
maintainers += mt.name + " ";
}
}
appendLiInnerHTML(ul, "<b>Project data maintainer(s):</b> " + maintainers);
}
obj.appendChild(ul);
// Code data
appendElementWithInnerHTML(obj,'h4',"Development:");
ul = document.createElement('ul');
if (project['programming-language']) {
var pl = project['programming-language'];
var arr = pl.split(/,\s*/);
var pls = "";
for (i in arr) {
pls += "<a href='projects.html?language#" + arr[i] + "'>" + arr[i] + "</a> ";
}
appendLiInnerHTML(ul, "<b>Programming language:</b> " + pls);
}
if (project['bug-database']) {
var bd = project['bug-database'];
var arr = bd.split(/,\s*/);
var bds = "";
for (i in arr) {
bds += "<a href='" + arr[i] + "'>" + arr[i] + "</a> ";
}
appendLiInnerHTML(ul, "<b>Bug-tracking:</b> " + bds);
}
if (project['mailing-list']) {
var ml = project['mailing-list'];
var xml = ml;
// email instead of link?
if (ml.match(/@/)) {
xml = "mailto:" + ml;
}
appendLiInnerHTML(ul, "<b>Mailing list(s):</b> <a href='" + xml + "'>" + ml + "</a>");
}
// repositories
if (project.repository) {
var r;
for (r in project.repository) {
r = project.repository[r];
if (r.indexOf("svn") > 0) {
appendLiInnerHTML(ul, "<b>Subversion repository:</b> <a target=*_blank' href='" + r + "'>" + r + "</a>");
} else if (r.indexOf("git") > 0) {
appendLiInnerHTML(ul, "<b>Git repository:</b> <a target=*_blank' href='" + r + "'>" + r + "</a>");
} else {
appendLiInnerHTML(ul, "<b>Repository:</b> <a target=*_blank' href='" + r + "'>" + r + "</a>");
}
}
}
obj.appendChild(ul);
// releases
appendElementWithInnerHTML(obj,'h4',"Releases <font size='-2'>(from DOAP)</font>:");
ul = document.createElement('ul');
if (project['download-page']) {
appendLiInnerHTML(ul, "<b>Download:</b> <a href='" + project['download-page'] + "' target='_blank'>" + project['download-page'] + "</a>");
}
if (project.release) {
project.release.sort(function(a,b){// reverse date order (most recent first)
var ac = a.created ? a.created : '1970-01-01';
var bc = b.created ? b.created : '1970-01-01';
if(ac < bc) return 1;
if(ac > bc) return -1;
return 0;});
var r;
for (r in project.release) {
r = project.release[r];
var html = "<b>" + (r.revision ? r.revision : r.version) + "</b>";
html += " (" + (r.created ? r.created : 'unknown') + ")";
appendLiInnerHTML(ul, html + ": " + r.name);
}
}
obj.appendChild(ul);
}