Skip to content

Commit

Permalink
small ui improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 19, 2024
1 parent cacd4af commit c92202f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @author Carlos Garcia Lopez de Haro and Daniel Felipe Gonzalez Obando
*/
public interface ModelDescriptor {

static final String TEXT_DESCRIPTION = "<html><body>"
+ "<h3>%s</h3>"
+ "<p><strong>Nickname:</strong> %s</p>"
Expand All @@ -44,6 +44,16 @@ public interface ModelDescriptor {
+ "<p><strong>Citation:</strong></p>"
+ "%s"
+ "</body></html>";
static final String TEXT_DESCRIPTION_LOCAL = "<html><body>"
+ "<h3>%s</h3>"
+ "<p><strong>Nickname:</strong> %s</p>"
+ "<p><strong>Description:</strong> %s</p>"
+ "<p><strong>Folder name:</strong> %s</p>"
+ "<p><strong>Author(s):</strong></p>"
+ "%s"
+ "<p><strong>Citation:</strong></p>"
+ "%s"
+ "</body></html>";

/**
* Create a set of specifications about the basic info of the model: name od the model, authors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,11 @@ else if (ci.getText() != null)
citation += "<li>" + ci.getText() + "</li>";
}
citation += "</ul>";
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, authorNames, citation);
if (this.isModelInLocalRepo())
return String.format(TEXT_DESCRIPTION_LOCAL, this.name, this.getNickname(),
this.description, new File(localModelPath).getName(), authorNames, citation);
else
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 @@ -658,7 +658,11 @@ else if (ci.getText() != null)
citation += "<li>" + ci.getText() + "</li>";
}
citation += "</ul>";
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, authorNames, citation);
if (this.isModelInLocalRepo())
return String.format(TEXT_DESCRIPTION_LOCAL, this.name, this.getNickname(),
this.description, new File(localModelPath).getName(), authorNames, citation);
else
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, authorNames, citation);
}

@Override
Expand Down

0 comments on commit c92202f

Please sign in to comment.