Skip to content
Snippets Groups Projects
Commit fd7dc699 authored by gnaegi's avatar gnaegi
Browse files

OO-3475 show anonymous icon for deleted users, don't link to visiting card

parent a9ac0919
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,7 @@ public class DisplayPortraitController extends BasicController implements Generi
private final boolean useLarge;
private final boolean isAnonymous;
private final boolean isDeletedUser;
private final boolean displayPortraitImage;
private boolean forceAnonymous;
......@@ -135,8 +136,9 @@ public class DisplayPortraitController extends BasicController implements Generi
public DisplayPortraitController(UserRequest ureq, WindowControl wControl, Identity portraitIdent,
boolean useLarge, boolean canLinkToHomePage, boolean displayUserFullName, boolean displayPortraitImage) {
super(ureq, wControl);
this.isDeletedUser = portraitIdent.getStatus().equals(Identity.STATUS_DELETED);
myContent = createVelocityContainer("displayportrait");
myContent.contextPut("canLinkToHomePage", canLinkToHomePage ? Boolean.TRUE : Boolean.FALSE);
myContent.contextPut("canLinkToHomePage", (canLinkToHomePage && !isDeletedUser) ? Boolean.TRUE : Boolean.FALSE);
if (portraitIdent == null) throw new AssertException("identity can not be null!");
this.useLarge = useLarge;
......@@ -177,9 +179,9 @@ public class DisplayPortraitController extends BasicController implements Generi
if (useLarge) {
image = DisplayPortraitManager.getInstance().getBigPortrait(portraitIdent.getName());
if (image != null && !forceAnonymous) {
if (image != null && !forceAnonymous && !isDeletedUser) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.AVATAR_BIG_CSS_CLASS);
} else if (isAnonymous || forceAnonymous) {
} else if (isAnonymous || forceAnonymous || isDeletedUser) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.ANONYMOUS_BIG_CSS_CLASS);
} else if (gender.equals("-")) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.DUMMY_BIG_CSS_CLASS);
......@@ -190,9 +192,9 @@ public class DisplayPortraitController extends BasicController implements Generi
}
} else {
image = DisplayPortraitManager.getInstance().getSmallPortrait(portraitIdent.getName());
if (image != null && !forceAnonymous) {
if (image != null && !forceAnonymous && !isDeletedUser) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.AVATAR_SMALL_CSS_CLASS);
} else if (isAnonymous || forceAnonymous) {
} else if (isAnonymous || forceAnonymous || isDeletedUser) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.ANONYMOUS_SMALL_CSS_CLASS);
} else if (gender.equals("-")) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.DUMMY_SMALL_CSS_CLASS);
......
......@@ -154,12 +154,14 @@ public class UserInfoMainController extends MainLayoutBasicController implements
firstLastName = userManager.getUserDisplayName(chosenIdentity);
// Navigation menu
menuTree = new MenuTree("menuTree");
GenericTreeModel tm = buildTreeModel(firstLastName);
menuTree.setTreeModel(tm);
menuTree.setSelectedNodeId(tm.getRootNode().getChildAt(0).getIdent());
menuTree.addListener(this);
menuTree.setRootVisible(showRootNode);
if (!chosenIdentity.getStatus().equals(Identity.STATUS_DELETED)) {
menuTree = new MenuTree("menuTree");
GenericTreeModel tm = buildTreeModel(firstLastName);
menuTree.setTreeModel(tm);
menuTree.setSelectedNodeId(tm.getRootNode().getChildAt(0).getIdent());
menuTree.addListener(this);
menuTree.setRootVisible(showRootNode);
}
// override if user is guest, don't show anything
if (ureq.getUserSession().getRoles().isGuestOnly()) {
......
<div class="o_visitingcard clearfix well"><div class="o_scrollblock">
<h2><i class="o_icon o_icon_visitingcard"> </i>$r.translate("menu.homepage") $userFullname</h2>
#if ($deleted)
<p class="o_warning">$r.translate("user.deleted")</p>
#end
#if ($deleted)
<p class="o_warning">$r.translate("user.deleted")</p>
#else
<div class="o_visitingcard_content">
<div class="o_visitingcard_image o_block clearfix">
<div class="pull-left">$r.render("image")</div>
......@@ -44,8 +43,10 @@
#end
</table>
</div>
#end
</div></div>
#if (!$deleted)
<div class="o_visitingcard_link o_extlink clearfix o_block_large_bottom">
<h5>$r.translate("extlink")</h5>
<div class="o_copy_code o_nowrap">
......@@ -59,3 +60,4 @@
</script>
</div>
</div>
#end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment