NIHVIVO-3502 Fix the proxy panel so all of the contents always have an image - either the profile image, if available, or the correct placeholder. Avoid hard-coding the URL of the placeholder, so we can remove the kluge of a person.thumbnail.jpg in Vitro

This commit is contained in:
j2blake 2012-03-21 20:33:34 +00:00
parent da2c958492
commit 84a9b22d99
3 changed files with 5 additions and 2 deletions

View file

@ -26,6 +26,8 @@ import edu.cornell.mannlib.vitro.webapp.controller.authenticate.Authenticator;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.utils.ImageUtil;
/** /**
* Handle the "My Account" form display and submission. * Handle the "My Account" form display and submission.
@ -268,7 +270,8 @@ public class UserAccountsMyAccountPage extends UserAccountsPage {
String userUri = proxyUser.getUri(); String userUri = proxyUser.getUri();
String label = assembleUserAccountLabel(proxyUser); String label = assembleUserAccountLabel(proxyUser);
String classLabel = ""; String classLabel = "";
String imageUrl = ""; String imageUrl = UrlBuilder.getUrl(ImageUtil
.getPlaceholderImagePathForType(VitroVocabulary.USERACCOUNT));
// Does this user have a profile? Can we get better info? // Does this user have a profile? Can we get better info?
Individual proxyProfilePage = getProfilePage(proxyUser); Individual proxyProfilePage = getProfilePage(proxyUser);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -44,7 +44,7 @@ function itemElement(template, uri, label, classLabel, imageUrl, removeInfo) {
this.uri = uri; this.uri = uri;
this.label = label; this.label = label;
this.classLabel = classLabel; this.classLabel = classLabel;
this.imageUrl = (imageUrl) ? imageUrl : imageUrl="../images/placeholders/person.thumbnail.jpg"; this.imageUrl = imageUrl;
this.removeInfo = removeInfo; this.removeInfo = removeInfo;
this.toString = function() { this.toString = function() {