Source: site.view [edit]
Function name: renderIssues
Arguments: issues
Description:
Page type: webl
Render function:  
Module: siteutil

Page source:

var bold = fun(html, a, b)
   if (a == b) then
      "<b>" + html + "</b>"
   else
      html
   end
end;

var labels = [. issueOpen="OPEN", issueInProgress="IN PROGRESS", issueFixed="FIXED",
                issueWontFix="WON'T FIX", issueDuplicate="DUPLICATE", issueCannotReproduce="CANNOT REPRODUCE",
                issueVerified="VERIFIED", issueClosed="CLOSED" .];

var f = issues.filter;

var html = "<h1>Issues for module '" + issues.module + "'</h1>\n";

html = html + Wub_ALinkCmd2("createIssue:" + issues.module, "[NEW ISSUE/FEATURE]") + "  |  " +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",all)", "[ALL]"), f,"all") + "&nbsp; &nbsp;" + 
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueOpen)", "[OPEN]"), f,"issueOpen") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueInProgress)", "[IN PROGRESS]"), f,"issueInProgress") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueFixed)", "[FIXED]"), f,"issueFixed") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueWontFix)", "[WON'T FIX]"), f,"issueWontFix") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueDuplicate)", "[DUPLICATE]"), f,"issueDuplicate") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueCannotReproduce)", "[CANNOT REPRODUCE]"), f,"issueCannotReproduce") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueVerified)", "[VERIFIED]"), f,"issueVerified") + "&nbsp; &nbsp;" +
   bold(Wub_ALinkCmd2("issues(" + issues.module + ",issueClosed)", "[CLOSED]"), f,"issueClosed") + "\n";


every typ in issues do
  if Str_StartsWith(typ, "issue") and (Size(issues[typ]) > 0) then
     html = html + "<hr><h3>" + (labels[typ] ? typ) + "</h3>\n";
     html = html + "<table>\n";
     every info in issues[typ] do
       html = html + "<tr><td>" + info.tags + "&nbsp;&nbsp;</td><td>" +
         Wub_ALinkCmd2(issues.module + "." + info.name, info.name +": " + info.desc) + "&nbsp;&nbsp;</td><td>" +
         "Assigned To: " + info.assigned + "</td></tr>\n";
     end;
     html = html + "</table>\n";
  end
end;
  
NewPiece(html, "text/html");