Skip to content

Commit

Permalink
display link in html
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 19, 2024
1 parent d98c0e1 commit cacd4af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public interface ModelDescriptor {
+ "<h3>%s</h3>"
+ "<p><strong>Nickname:</strong> %s</p>"
+ "<p><strong>Description:</strong> %s</p>"
+ "<p><strong>Author(s):</strong></p>"
+ "%s"
+ "<p><strong>Citation:</strong></p>"
+ "%s"
+ "</body></html>";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,17 +790,20 @@ public boolean canRunOnBioengine() {

@Override
public String buildInfo() {
String authorNames = "";
String authorNames = "<ul>";
for (Author auth : this.authors) {
authorNames += " - " + auth.getName() + System.lineSeparator();
authorNames += "<li>" + auth.getName() + "</li>";
}
String citation = "";
authorNames += "</ul>";
String citation = "<ul>";
for (Cite ci : this.cite) {
citation += " - " + ci.getText() + System.lineSeparator();
if (ci.getUrl() != null)
citation += " " + ci.getUrl() + System.lineSeparator();
if (ci.getUrl() != null && ci.getText() != null)
citation += "<li><a href='" + ci.getUrl() + "'>" + ci.getText() + "</a></li>";
else if (ci.getText() != null)
citation += "<li>" + ci.getText() + "</li>";
}
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description);
citation += "</ul>";
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, authorNames, citation);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,17 +645,20 @@ public boolean canRunOnBioengine() {

@Override
public String buildInfo() {
String authorNames = "";
String authorNames = "<ul>";
for (Author auth : this.authors) {
authorNames += " - " + auth.getName() + System.lineSeparator();
authorNames += "<li>" + auth.getName() + "</li>";
}
String citation = "";
authorNames += "</ul>";
String citation = "<ul>";
for (Cite ci : this.cite) {
citation += " - " + ci.getText() + System.lineSeparator();
if (ci.getUrl() != null)
citation += " " + ci.getUrl() + System.lineSeparator();
if (ci.getUrl() != null && ci.getText() != null)
citation += "<li><a href='" + ci.getUrl() + "'>" + ci.getText() + "</a></li>";
else if (ci.getText() != null)
citation += "<li>" + ci.getText() + "</li>";
}
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description);
citation += "</ul>";
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, authorNames, citation);
}

@Override
Expand Down

0 comments on commit cacd4af

Please sign in to comment.