|
|
@ -1,9 +1,11 @@
|
|
|
|
package org.gcube.portlets.user.notifications.client.view.templates;
|
|
|
|
package org.gcube.portlets.user.notifications.client.view.templates;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.gcube.common.portal.GCubePortalConstants;
|
|
|
|
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
|
|
|
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
|
|
|
import org.gcube.portal.databook.client.util.Encoder;
|
|
|
|
import org.gcube.portal.databook.client.util.Encoder;
|
|
|
|
import org.gcube.portal.databook.shared.Notification;
|
|
|
|
import org.gcube.portal.databook.shared.Notification;
|
|
|
|
import org.gcube.portal.databook.shared.NotificationType;
|
|
|
|
import org.gcube.portal.databook.shared.NotificationType;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
|
|
|
import org.gcube.portlets.user.gcubewidgets.client.elements.Span;
|
|
|
|
import org.gcube.portlets.user.gcubewidgets.client.elements.Span;
|
|
|
|
import org.gcube.portlets.user.notifications.client.view.templates.images.NotificationImages;
|
|
|
|
import org.gcube.portlets.user.notifications.client.view.templates.images.NotificationImages;
|
|
|
|
|
|
|
|
|
|
|
@ -12,6 +14,7 @@ import com.google.gwt.i18n.client.DateTimeFormat;
|
|
|
|
import com.google.gwt.resources.client.ImageResource;
|
|
|
|
import com.google.gwt.resources.client.ImageResource;
|
|
|
|
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
|
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
|
import com.google.gwt.uibinder.client.UiField;
|
|
|
|
import com.google.gwt.uibinder.client.UiField;
|
|
|
|
|
|
|
|
import com.google.gwt.user.client.Window.Location;
|
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
@ -63,8 +66,11 @@ public class SingleNotificationView extends Composite {
|
|
|
|
//shorten the notification text if greather than 200 chars
|
|
|
|
//shorten the notification text if greather than 200 chars
|
|
|
|
actualHTML = actualHTML.length() > 200 ? actualHTML.substring(0, 200) + " ..." : actualHTML;
|
|
|
|
actualHTML = actualHTML.length() > 200 ? actualHTML.substring(0, 200) + " ..." : actualHTML;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL +
|
|
|
|
|
|
|
|
ClientScopeHelper.extractOrgFriendlyURL(Location.getHref()) +"/"+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
|
|
|
|
|
|
|
|
|
|
|
notificationText.setHTML(
|
|
|
|
notificationText.setHTML(
|
|
|
|
"<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"?"+
|
|
|
|
"<a class=\"link\" href=\""+profilePageURL+"?"+
|
|
|
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
|
|
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
|
|
|
Encoder.encode(toShow.getSenderid())+"\">"+
|
|
|
|
Encoder.encode(toShow.getSenderid())+"\">"+
|
|
|
|
toShow.getSenderFullName()+"</a> " + actualHTML);
|
|
|
|
toShow.getSenderFullName()+"</a> " + actualHTML);
|
|
|
|