links redirects correctly to user profiles

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@79414 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-07-18 17:01:36 +00:00
parent 224c71c22b
commit df31e460c1
3 changed files with 20 additions and 4 deletions

View File

@ -1,6 +1,7 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.user.NewsFeed.1-1-0" date="2013-07-08">
<Change>Open single feed separately enhancement implemeented #1818</Change>
<Change>links redirects correctly to user profiles</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.NewsFeed.1-0-0"
date="2013-04-19">

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.newsfeed.client.templates;
import org.gcube.portal.databook.client.GCubeSocialNetworking;
import org.gcube.portal.databook.client.util.Encoder;
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portlets.user.newsfeed.client.event.DeleteCommentEvent;
import org.gcube.portlets.user.newsfeed.client.panels.NewsFeedPanel;
@ -56,7 +57,10 @@ public class SingleComment extends Composite {
seeMore.setHTML("<a class=\"seemore\"> See More </a>");
}
commentText.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"\">"+toShow.getFullName()+"</a> " + commentToShow);
commentText.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"?"+
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
Encoder.encode(toShow.getUserid())+"\">"+toShow.getFullName()+
"</a> " + commentToShow);
timeArea.setHTML(DateTimeFormat.getFormat("MMMM dd, h:mm a").format(toShow.getTime()));
if (isUsers) {
closeImage.setStyleName("closeImage");
@ -68,7 +72,10 @@ public class SingleComment extends Composite {
@UiHandler("seeMore")
void onSeeMoreClick(ClickEvent e) {
commentText.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"\">"+myComment.getFullName()+"</a> " + myComment.getText());
commentText.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"?"+
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
Encoder.encode(myComment.getUserid())+"\">"+
myComment.getFullName()+"</a> " + myComment.getText());
seeMore.setHTML("");
}

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portal.databook.client.GCubeSocialNetworking;
import org.gcube.portal.databook.client.util.Encoder;
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portal.databook.shared.Feed;
import org.gcube.portal.databook.shared.UserInfo;
@ -150,7 +151,10 @@ public class TweetTemplate extends Composite {
if (! isAppFeed) {
messageArea.setHTML("<a>" + NewsFeedPanel.MESSAGE_LABEL + "</a>");
contentArea.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"\">"+feed.getFullName()+"</a> " + feedText);
contentArea.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK
+"?"+
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
Encoder.encode(feed.getEntityId())+"\">"+feed.getFullName()+"</a> " + feedText);
}
else {
// messageSeparator.setVisible(false);
@ -245,7 +249,11 @@ public class TweetTemplate extends Composite {
@UiHandler("seeMore")
void onSeeMoreClick(ClickEvent e) {
contentArea.setHTML("<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"\">"+myFeed.getFeed().getFullName()+"</a> " + myFeed.getFeed().getDescription());
contentArea.setHTML("<a class=\"link\"href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"?"+
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
Encoder.encode(myFeed.getFeed().getEntityId())+"\">"+
myFeed.getFeed().getFullName()+"</a> " + myFeed.getFeed().getDescription());
seeMore.setHTML("");
}