/// <summary> /// Creates an instance of the IssuePriority based on a remote entity. /// </summary> public IssuePriority(RemotePriority remoteEntity) : base(remoteEntity) { }
private XDoc BuildBugListHTMLTable(RemoteIssue[] issues) { XDoc ret = new XDoc("div").Attr("class", "DW-table Jira-table table"); ret.Start("table").Attr("border", 0).Attr("cellspacing", 0).Attr("cellpadding", 0).Attr("class", "table feedtable sortable"); // header ret.Start("tr") .Elem("th", "Bug#") .Elem("th", "Summary") .Elem("th", "Status") .Elem("th", "Priority") .Elem("th", "Opened By") .Elem("th", "Assigned To") .End(); int count = 0; foreach (RemoteIssue bug in issues) { count++; RemoteStatus status = null; if (!string.IsNullOrEmpty(bug.status)) { _statuses.TryGetValue(bug.status, out status); } RemotePriority priority = null; if (!string.IsNullOrEmpty(bug.priority)) { _priorities.TryGetValue(bug.priority, out priority); } string trClass = string.Format("{0} {1}", (count % 2 == 0) ? "even" : "odd", status == null ? string.Empty : status.name); ret.Start("tr").Attr("class", trClass); ret.Start("td"); ret = BuildBugLink(bug, ret); ret.End(); //td; ret.Elem("td", bug.summary); if (status == null) { ret.Elem("td", ""); } else { ret.Start("td").Start("img").Attr("src", status.icon).Attr("alt", status.name).Attr("title", status.description).End().Value(status.name).End(); } if (priority == null) { ret.Elem("td"); } else { ret.Start("td").Start("img").Attr("src", priority.icon).Attr("alt", priority.name).Attr("title", priority.description).End().Value(priority.name).End(); } ret.Elem("td", bug.reporter ?? string.Empty); ret.Elem("td", bug.assignee ?? string.Empty); ret.End(); //tr } ret.End(); // table return(ret); }