Feature #16452, Revise posts look and feel
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@178920 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7a3d0f1fbe
commit
e2bec3c086
|
@ -8,7 +8,7 @@
|
||||||
<dependent-module archiveName="gcube-widgets-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
<dependent-module archiveName="gcube-widgets-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module archiveName="social-util-library-1.5.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
|
<dependent-module archiveName="social-util-library-1.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module archiveName="pickitem-widget-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
|
<dependent-module archiveName="pickitem-widget-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<Change>Feature #16205: News Feed avoid refresh page when user is commenting</Change>
|
<Change>Feature #16205: News Feed avoid refresh page when user is commenting</Change>
|
||||||
<Change>Minor CSS fix for anchors links font size</Change>
|
<Change>Minor CSS fix for anchors links font size</Change>
|
||||||
<Change>Bug fix #16225 mentions and replies http links not working in some email notifications</Change>
|
<Change>Bug fix #16225 mentions and replies http links not working in some email notifications</Change>
|
||||||
|
<Change>Feature #16452, Revise posts look and feel</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets-user.news-feed.2-6-1"
|
<Changeset component="org.gcube.portlets-user.news-feed.2-6-1"
|
||||||
date="2018-04-12">
|
date="2018-04-12">
|
||||||
|
|
|
@ -3,21 +3,27 @@
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||||
<ui:style>
|
<ui:style>
|
||||||
.avatar-frame {
|
.avatar-frame {
|
||||||
|
border-radius: 2em;
|
||||||
border: 1px solid #E6E6E6;
|
border: 1px solid #E6E6E6;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-replacement {
|
.avatar-replacement {
|
||||||
|
border-radius: 2em;
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
font-family: "HelveticaNeue-Light", "Helvetica Neue Light",
|
||||||
|
"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel width="50px" height="50px" styleName="{style.avatar-frame}">
|
<g:HTMLPanel width="40px" height="40px"
|
||||||
<g:HTML width="50px" height="50px" styleName="{style.avatar-replacement}" ui:field="avatarBox"></g:HTML>
|
styleName="{style.avatar-frame}">
|
||||||
|
<g:HTML width="40px" height="40px"
|
||||||
|
styleName="{style.avatar-replacement}" ui:field="avatarBox"></g:HTML>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -3,11 +3,13 @@
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||||
<ui:style>
|
<ui:style>
|
||||||
.avatar-frame {
|
.avatar-frame {
|
||||||
|
border-radius: 2em;
|
||||||
border: 1px solid #E6E6E6;
|
border: 1px solid #E6E6E6;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
.avatar-replacement {
|
.avatar-replacement {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
|
border-radius: 2em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
||||||
|
|
|
@ -10,9 +10,8 @@
|
||||||
<table class="single-comment">
|
<table class="single-comment">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="36px" align="middle">
|
<td width="36px" align="middle">
|
||||||
<div style="width:32px;"> </div>
|
|
||||||
<g:Image styleName="member-photo" url="" ui:field="avatarImage"
|
<g:Image styleName="member-photo" url="" ui:field="avatarImage"
|
||||||
width="32px" height="32px" />
|
width="30px" height="30px" />
|
||||||
<m:AvatarReplacement4Comments visible="false"
|
<m:AvatarReplacement4Comments visible="false"
|
||||||
ui:field="avatarReplacement"></m:AvatarReplacement4Comments>
|
ui:field="avatarReplacement"></m:AvatarReplacement4Comments>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -6,7 +6,6 @@ package org.gcube.portlets.user.newsfeed.client.ui;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.gcube.common.portal.GCubePortalConstants;
|
import org.gcube.common.portal.GCubePortalConstants;
|
||||||
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
||||||
|
@ -28,7 +27,6 @@ import org.gcube.portlets.widgets.imagepreviewerwidget.client.ui.Carousel;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.RunAsyncCallback;
|
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
@ -40,12 +38,12 @@ 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.uibinder.client.UiHandler;
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
import com.google.gwt.user.client.Timer;
|
import com.google.gwt.user.client.Timer;
|
||||||
import com.google.gwt.user.client.Window;
|
|
||||||
import com.google.gwt.user.client.Window.Location;
|
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;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
|
import com.google.gwt.user.client.ui.InlineLabel;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
import com.google.gwt.user.client.ui.Label;
|
||||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
@ -66,9 +64,9 @@ public class TweetTemplate extends Composite {
|
||||||
|
|
||||||
public static final String loading = GWT.getModuleBaseURL() + "../images/loading-comments.gif";
|
public static final String loading = GWT.getModuleBaseURL() + "../images/loading-comments.gif";
|
||||||
|
|
||||||
private static final int MAX_SHOWTEXT_LENGTH = 256;
|
private static final int MAX_SHOWTEXT_LENGTH = 512;
|
||||||
|
|
||||||
private EnhancedFeed myFeed;
|
private EnhancedFeed myPost;
|
||||||
private UserInfo myUserInfo;
|
private UserInfo myUserInfo;
|
||||||
|
|
||||||
private HandlerManager eventBus;
|
private HandlerManager eventBus;
|
||||||
|
@ -77,7 +75,7 @@ public class TweetTemplate extends Composite {
|
||||||
private boolean commentsFetched = false;
|
private boolean commentsFetched = false;
|
||||||
private int totalComments = 0;
|
private int totalComments = 0;
|
||||||
private HTML showAllComments = new HTML();
|
private HTML showAllComments = new HTML();
|
||||||
private boolean isAppFeed = false;
|
private boolean isAppPost = false;
|
||||||
private HTML submitCommentPreloader = new HTML("<div class=\"more-comment\"><img style=\"padding-right:15px;\"src=\""+ loading +"\" /></div>");
|
private HTML submitCommentPreloader = new HTML("<div class=\"more-comment\"><img style=\"padding-right:15px;\"src=\""+ loading +"\" /></div>");
|
||||||
private TweetTemplate myInstance;
|
private TweetTemplate myInstance;
|
||||||
|
|
||||||
|
@ -92,16 +90,20 @@ public class TweetTemplate extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
HTML contentArea;
|
HTML contentArea;
|
||||||
@UiField
|
@UiField
|
||||||
|
HTML postOwnerArea;
|
||||||
|
@UiField
|
||||||
HTML seeMore;
|
HTML seeMore;
|
||||||
@UiField
|
@UiField
|
||||||
HTML timeArea;
|
InlineLabel timeArea;
|
||||||
|
@UiField
|
||||||
|
InlineLabel separator;
|
||||||
|
@UiField
|
||||||
|
InlineLabel vreSourceInMetadata;
|
||||||
@UiField
|
@UiField
|
||||||
HTML likeArea;
|
HTML likeArea;
|
||||||
@UiField
|
@UiField
|
||||||
HTML commentArea;
|
HTML commentArea;
|
||||||
@UiField
|
@UiField
|
||||||
HTML sharePostArea;
|
|
||||||
@UiField
|
|
||||||
Image avatarImage;
|
Image avatarImage;
|
||||||
@UiField
|
@UiField
|
||||||
AvatarReplacement avatarReplacement;
|
AvatarReplacement avatarReplacement;
|
||||||
|
@ -118,8 +120,6 @@ public class TweetTemplate extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
HTML openImage;
|
HTML openImage;
|
||||||
@UiField
|
@UiField
|
||||||
HTML vreSource;
|
|
||||||
@UiField
|
|
||||||
VerticalPanel previewPanel;
|
VerticalPanel previewPanel;
|
||||||
@UiField
|
@UiField
|
||||||
Placeholder attachmentPreviewPanel;
|
Placeholder attachmentPreviewPanel;
|
||||||
|
@ -128,12 +128,12 @@ public class TweetTemplate extends Composite {
|
||||||
/**
|
/**
|
||||||
* used when fetching tweets from server
|
* used when fetching tweets from server
|
||||||
* @param myUserInfo
|
* @param myUserInfo
|
||||||
* @param myFeed
|
* @param myPost
|
||||||
* @param isUsers
|
* @param isUsers
|
||||||
* @param displaySingle tells if you're displaying a single fedd or not
|
* @param displaySingle tells if you're displaying a single fedd or not
|
||||||
* @param eventBus
|
* @param eventBus
|
||||||
*/
|
*/
|
||||||
public TweetTemplate(boolean displaySingle, boolean showTimelineSource, UserInfo myUserInfo, EnhancedFeed myFeed, HandlerManager eventBus) {
|
public TweetTemplate(boolean displaySingle, boolean showTimelineSource, UserInfo myUserInfo, EnhancedFeed myPost, HandlerManager eventBus) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
commentsNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
|
commentsNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
|
||||||
likesNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
|
likesNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
|
||||||
|
@ -144,12 +144,13 @@ public class TweetTemplate extends Composite {
|
||||||
|
|
||||||
myInstance = this;
|
myInstance = this;
|
||||||
this.myUserInfo = myUserInfo;
|
this.myUserInfo = myUserInfo;
|
||||||
this.vreSource.setVisible(false);
|
this.vreSourceInMetadata.setVisible(false);
|
||||||
this.myFeed = myFeed;
|
this.separator.setVisible(false);
|
||||||
isAppFeed = myFeed.getFeed().isApplicationFeed();
|
this.myPost = myPost;
|
||||||
Feed feed = myFeed.getFeed();
|
isAppPost = myPost.getFeed().isApplicationFeed();
|
||||||
|
Feed feed = myPost.getFeed();
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.isUsers = myFeed.isUsers();
|
this.isUsers = myPost.isUsers();
|
||||||
this.carousel = new Carousel();
|
this.carousel = new Carousel();
|
||||||
myComments = new ArrayList<SingleComment>();
|
myComments = new ArrayList<SingleComment>();
|
||||||
|
|
||||||
|
@ -248,7 +249,7 @@ public class TweetTemplate extends Composite {
|
||||||
attachmentPreviewPanel.add(firstAttachmentPreviewer);
|
attachmentPreviewPanel.add(firstAttachmentPreviewer);
|
||||||
|
|
||||||
// check the others
|
// check the others
|
||||||
for (Attachment otherAttachment : myFeed.getAttachments()) {
|
for (Attachment otherAttachment : myPost.getAttachments()) {
|
||||||
|
|
||||||
AttachmentPreviewer attachmentPreviewer = new AttachmentPreviewer(otherAttachment);
|
AttachmentPreviewer attachmentPreviewer = new AttachmentPreviewer(otherAttachment);
|
||||||
|
|
||||||
|
@ -291,7 +292,7 @@ public class TweetTemplate extends Composite {
|
||||||
openImage.setStyleName("openImage");
|
openImage.setStyleName("openImage");
|
||||||
openImage.setTitle("Open this feed separately");
|
openImage.setTitle("Open this feed separately");
|
||||||
//show if the user has already liked this or not
|
//show if the user has already liked this or not
|
||||||
setFavoritedUI(myFeed.isLiked());
|
setFavoritedUI(myPost.isLiked());
|
||||||
|
|
||||||
commentArea.setHTML("<a>" + NewsFeedPanel.COMMENT_LABEL + "</a>");
|
commentArea.setHTML("<a>" + NewsFeedPanel.COMMENT_LABEL + "</a>");
|
||||||
|
|
||||||
|
@ -305,7 +306,7 @@ public class TweetTemplate extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
avatarImage.setUrl(feed.getThumbnailURL());
|
avatarImage.setUrl(feed.getThumbnailURL());
|
||||||
avatarImage.setPixelSize(50, 50);
|
avatarImage.setPixelSize(40, 40);
|
||||||
|
|
||||||
//replace the < & and >
|
//replace the < & and >
|
||||||
feedText = feedText.replaceAll("<","<").replaceAll(">",">");
|
feedText = feedText.replaceAll("<","<").replaceAll(">",">");
|
||||||
|
@ -313,19 +314,28 @@ public class TweetTemplate extends Composite {
|
||||||
|
|
||||||
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + NewsFeedPanel.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + NewsFeedPanel.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
||||||
|
|
||||||
//show the vreid iff the info is present
|
|
||||||
this.vreSource.setVisible(true);
|
|
||||||
if (showTimelineSource && feed.getVreid() != null && feed.getVreid().compareTo("") != 0) {
|
if (showTimelineSource && feed.getVreid() != null && feed.getVreid().compareTo("") != 0) {
|
||||||
|
this.vreSourceInMetadata.setVisible(true);
|
||||||
|
this.separator.setVisible(true);
|
||||||
String vreName = feed.getVreid().substring(feed.getVreid().lastIndexOf("/")+1);
|
String vreName = feed.getVreid().substring(feed.getVreid().lastIndexOf("/")+1);
|
||||||
vreSource.setHTML("<a class=\"link\" style=\"font-size: 10px; white-space: nowrap;\" href=\"/group/"+vreName.toLowerCase()+"\">[" +vreName + "]</a>");
|
vreSourceInMetadata.setText(vreName);
|
||||||
|
vreSourceInMetadata.addClickHandler(new ClickHandler() {
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
Location.assign("/group/"+vreName.toLowerCase());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isAppFeed) {
|
if (! isAppPost) {
|
||||||
// sharePostArea.setHTML("<a>" + NewsFeedPanel.SHARE_FWD_LABEL + "</a>");
|
// sharePostArea.setHTML("<a>" + NewsFeedPanel.SHARE_FWD_LABEL + "</a>");
|
||||||
contentArea.setHTML("<a class=\"link\" href=\""+profilePageURL
|
postOwnerArea.setHTML("<a class=\"linkProfile\" href=\""+profilePageURL
|
||||||
+"?"+
|
+"?"+
|
||||||
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
||||||
Encoder.encode(feed.getEntityId())+"\">"+feed.getFullName()+"</a> " + feedText);
|
Encoder.encode(feed.getEntityId())+"\">"+feed.getFullName()+"</a>");
|
||||||
|
contentArea.setHTML(feedText);
|
||||||
|
|
||||||
//check if the user has his own avatar
|
//check if the user has his own avatar
|
||||||
if (feed.getThumbnailURL().contains("img_id=0") || !feed.getThumbnailURL().contains("?")) { //it means no avatar is set
|
if (feed.getThumbnailURL().contains("img_id=0") || !feed.getThumbnailURL().contains("?")) { //it means no avatar is set
|
||||||
|
@ -348,17 +358,14 @@ public class TweetTemplate extends Composite {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// messageSeparator.setVisible(false);
|
// messageSeparator.setVisible(false);
|
||||||
contentArea.setHTML("<a class=\"link\" href=\""+feed.getUri()+"\">"+feed.getFullName()+"</a> " + feedText);
|
postOwnerArea.setHTML("<a class=\"linkProfile\" href=\""+feed.getUri()+"\">"+feed.getFullName()+"</a>");
|
||||||
if (isAppFeed) {
|
contentArea.setHTML(feedText);
|
||||||
|
|
||||||
|
if (isAppPost) {
|
||||||
if (myUserInfo.isAdmin())
|
if (myUserInfo.isAdmin())
|
||||||
closeImage.setTitle("Delete this Application feed (Administrator Only)");
|
closeImage.setTitle("Delete this Application feed (Administrator Only)");
|
||||||
else
|
else
|
||||||
closeImage.removeFromParent();
|
closeImage.removeFromParent();
|
||||||
try{
|
|
||||||
String vreName = feed.getVreid().substring(feed.getVreid().lastIndexOf("/")+1);
|
|
||||||
sharePostArea.setHTML("<a class=\"link\" style=\"white-space: nowrap;\" href=\""+feed.getUri()+"\"> - go App [" +vreName + "] - </a>");
|
|
||||||
}
|
|
||||||
catch (Exception e) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +379,7 @@ public class TweetTemplate extends Composite {
|
||||||
else
|
else
|
||||||
formattedTime = DateTimeFormat.getFormat("MMMM dd, h:mm a").format(feed.getTime());
|
formattedTime = DateTimeFormat.getFormat("MMMM dd, h:mm a").format(feed.getTime());
|
||||||
|
|
||||||
timeArea.setHTML(formattedTime);
|
timeArea.setText(formattedTime);
|
||||||
String formattedTimeWithYear = DateTimeFormat.getFormat("dd MMMM yyyy h:mm a ").format(feed.getTime());
|
String formattedTimeWithYear = DateTimeFormat.getFormat("dd MMMM yyyy h:mm a ").format(feed.getTime());
|
||||||
timeArea.setTitle(formattedTimeWithYear);
|
timeArea.setTitle(formattedTimeWithYear);
|
||||||
if (! feed.getCommentsNo().equals("0")) {
|
if (! feed.getCommentsNo().equals("0")) {
|
||||||
|
@ -391,16 +398,16 @@ public class TweetTemplate extends Composite {
|
||||||
totalComments = 0;
|
totalComments = 0;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
timeArea.setHTML("just now");
|
timeArea.setText("just now");
|
||||||
}
|
}
|
||||||
commentsPanel.setStyleName("commentsPanel");
|
commentsPanel.setStyleName("commentsPanel");
|
||||||
if (myFeed.getComments() != null && myFeed.getComments().size() > 0) {
|
if (myPost.getComments() != null && myPost.getComments().size() > 0) {
|
||||||
if (totalComments > 2 && !displaySingle) {
|
if (totalComments > 2 && !displaySingle) {
|
||||||
showAllComments = getShowAllCommentsLink(totalComments);
|
showAllComments = getShowAllCommentsLink(totalComments);
|
||||||
commentsPanel.add(showAllComments);
|
commentsPanel.add(showAllComments);
|
||||||
commentsNo.setVisible(true);
|
commentsNo.setVisible(true);
|
||||||
}
|
}
|
||||||
for (Comment comment : myFeed.getComments()) {
|
for (Comment comment : myPost.getComments()) {
|
||||||
addComment(new SingleComment(comment, this, (comment.getUserid().equals(myUserInfo.getUsername()))));
|
addComment(new SingleComment(comment, this, (comment.getUserid().equals(myUserInfo.getUsername()))));
|
||||||
}
|
}
|
||||||
showAddCommentForm(false);
|
showAddCommentForm(false);
|
||||||
|
@ -455,7 +462,7 @@ public class TweetTemplate extends Composite {
|
||||||
|
|
||||||
@UiHandler("seeMore")
|
@UiHandler("seeMore")
|
||||||
void onSeeMoreClick(ClickEvent e) {
|
void onSeeMoreClick(ClickEvent e) {
|
||||||
String feedText = myFeed.getFeed().getDescription();
|
String feedText = myPost.getFeed().getDescription();
|
||||||
//replace the < & and >
|
//replace the < & and >
|
||||||
feedText = feedText.replaceAll("<","<").replaceAll(">",">");
|
feedText = feedText.replaceAll("<","<").replaceAll(">",">");
|
||||||
feedText = feedText.replaceAll("&","&");
|
feedText = feedText.replaceAll("&","&");
|
||||||
|
@ -465,8 +472,8 @@ public class TweetTemplate extends Composite {
|
||||||
|
|
||||||
contentArea.setHTML("<a class=\"link\"href=\"" + profilePageURL + "?"+
|
contentArea.setHTML("<a class=\"link\"href=\"" + profilePageURL + "?"+
|
||||||
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
||||||
Encoder.encode(myFeed.getFeed().getEntityId())+"\">"+
|
Encoder.encode(myPost.getFeed().getEntityId())+"\">"+
|
||||||
myFeed.getFeed().getFullName()+"</a> " + feedText);
|
myPost.getFeed().getFullName()+"</a> " + feedText);
|
||||||
|
|
||||||
seeMore.setHTML("");
|
seeMore.setHTML("");
|
||||||
}
|
}
|
||||||
|
@ -488,19 +495,19 @@ public class TweetTemplate extends Composite {
|
||||||
//if is not liked
|
//if is not liked
|
||||||
if (!likeArea.getText().equals(NewsFeedPanel.LIKED_LABEL)) {
|
if (!likeArea.getText().equals(NewsFeedPanel.LIKED_LABEL)) {
|
||||||
try {
|
try {
|
||||||
int cur = Integer.parseInt(myFeed.getFeed().getLikesNo());
|
int cur = Integer.parseInt(myPost.getFeed().getLikesNo());
|
||||||
cur++;
|
cur++;
|
||||||
if (cur == 1) {
|
if (cur == 1) {
|
||||||
myFeed.getFeed().setLikesNo("1");
|
myPost.getFeed().setLikesNo("1");
|
||||||
likesNo.setText("1");
|
likesNo.setText("1");
|
||||||
likesNo.setTitle("People who have " + NewsFeedPanel.LIKED_LABEL + " this");
|
likesNo.setTitle("People who have " + NewsFeedPanel.LIKED_LABEL + " this");
|
||||||
likesNo.setVisible(true);
|
likesNo.setVisible(true);
|
||||||
} else {
|
} else {
|
||||||
myFeed.getFeed().setLikesNo(""+cur);
|
myPost.getFeed().setLikesNo(""+cur);
|
||||||
likesNo.setText(""+cur);
|
likesNo.setText(""+cur);
|
||||||
likesNo.setVisible(true);
|
likesNo.setVisible(true);
|
||||||
}
|
}
|
||||||
eventBus.fireEvent(new AddLikeEvent(this, myFeed.getFeed().getKey()));
|
eventBus.fireEvent(new AddLikeEvent(this, myPost.getFeed().getKey()));
|
||||||
setFavoritedUI(true);
|
setFavoritedUI(true);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException ex) {
|
catch (NumberFormatException ex) {
|
||||||
|
@ -508,19 +515,19 @@ public class TweetTemplate extends Composite {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//it is liked
|
//it is liked
|
||||||
int cur = Integer.parseInt(myFeed.getFeed().getLikesNo());
|
int cur = Integer.parseInt(myPost.getFeed().getLikesNo());
|
||||||
cur--;
|
cur--;
|
||||||
if (cur == 0) {
|
if (cur == 0) {
|
||||||
myFeed.getFeed().setLikesNo("0");
|
myPost.getFeed().setLikesNo("0");
|
||||||
likesNo.setText("");
|
likesNo.setText("");
|
||||||
likesNo.setVisible(false);
|
likesNo.setVisible(false);
|
||||||
likesNo.setTitle("");
|
likesNo.setTitle("");
|
||||||
} else {
|
} else {
|
||||||
myFeed.getFeed().setLikesNo(""+cur);
|
myPost.getFeed().setLikesNo(""+cur);
|
||||||
likesNo.setText(""+cur);
|
likesNo.setText(""+cur);
|
||||||
likesNo.setVisible(true);
|
likesNo.setVisible(true);
|
||||||
}
|
}
|
||||||
eventBus.fireEvent(new UnLikeEvent(this, myFeed.getFeed().getKey()));
|
eventBus.fireEvent(new UnLikeEvent(this, myPost.getFeed().getKey()));
|
||||||
setFavoritedUI(false);
|
setFavoritedUI(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -539,25 +546,6 @@ public class TweetTemplate extends Composite {
|
||||||
GWT.log("Commenting disabled");
|
GWT.log("Commenting disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("sharePostArea")
|
|
||||||
void onMessageClick(ClickEvent e) {
|
|
||||||
if (! isAppFeed) {
|
|
||||||
final List<String> listToLogin = new ArrayList<String>();
|
|
||||||
listToLogin.add(myFeed.getFeed().getEntityId());
|
|
||||||
GWT.runAsync(new RunAsyncCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
SharePostDialog dlg = new SharePostDialog(myInstance);
|
|
||||||
dlg.openModal();
|
|
||||||
}
|
|
||||||
public void onFailure(Throwable reason) {
|
|
||||||
Window.alert("Could not load this component: " + reason.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showAddCommentForm(boolean focus) {
|
public void showAddCommentForm(boolean focus) {
|
||||||
final AddCommentTemplate toAdd = new AddCommentTemplate(this, myUserInfo, eventBus);
|
final AddCommentTemplate toAdd = new AddCommentTemplate(this, myUserInfo, eventBus);
|
||||||
commentsPanel.add(toAdd);
|
commentsPanel.add(toAdd);
|
||||||
|
@ -590,7 +578,7 @@ public class TweetTemplate extends Composite {
|
||||||
|
|
||||||
@UiHandler("likesNo")
|
@UiHandler("likesNo")
|
||||||
void onSeeLikes(ClickEvent e) {
|
void onSeeLikes(ClickEvent e) {
|
||||||
eventBus.fireEvent(new SeeLikesEvent(myFeed.getFeed().getKey()));
|
eventBus.fireEvent(new SeeLikesEvent(myPost.getFeed().getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("commentsNo")
|
@UiHandler("commentsNo")
|
||||||
|
@ -610,7 +598,7 @@ public class TweetTemplate extends Composite {
|
||||||
this.commentingDisabled = commenting;
|
this.commentingDisabled = commenting;
|
||||||
}
|
}
|
||||||
public String getFeedKey() {
|
public String getFeedKey() {
|
||||||
return myFeed.getFeed().getKey();
|
return myPost.getFeed().getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(Widget w) {
|
public void remove(Widget w) {
|
||||||
|
@ -692,15 +680,15 @@ public class TweetTemplate extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMyFeedUserId() {
|
public String getMyFeedUserId() {
|
||||||
return myFeed.getFeed().getEntityId();
|
return myPost.getFeed().getEntityId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMyFeedText() {
|
public String getMyFeedText() {
|
||||||
return myFeed.getFeed().getDescription();
|
return myPost.getFeed().getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAppFeed() {
|
public boolean isAppFeed() {
|
||||||
return isAppFeed;
|
return isAppPost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUser() {
|
public boolean isUser() {
|
||||||
|
@ -719,7 +707,7 @@ public class TweetTemplate extends Composite {
|
||||||
* @return the context (scope) of the Post
|
* @return the context (scope) of the Post
|
||||||
*/
|
*/
|
||||||
public String getVREContext() {
|
public String getVREContext() {
|
||||||
return this.myFeed.getFeed().getVreid();
|
return this.myPost.getFeed().getVreid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,21 +4,45 @@
|
||||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
|
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
|
||||||
xmlns:m="urn:import:org.gcube.portlets.user.newsfeed.client.ui">
|
xmlns:m="urn:import:org.gcube.portlets.user.newsfeed.client.ui">
|
||||||
<g:HTMLPanel ui:field="mainHTML">
|
<g:HTMLPanel ui:field="mainHTML">
|
||||||
|
|
||||||
<div class="div-table">
|
<div class="div-table">
|
||||||
<div class="div-table-row">
|
<div class="div-table-row">
|
||||||
<div class="div-table-col photo">
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td align="left" style="vertical-align: top;">
|
||||||
<g:Image title="" styleName="member-photo" url=""
|
<g:Image title="" styleName="member-photo" url=""
|
||||||
ui:field="avatarImage" width="60" height="60" />
|
ui:field="avatarImage" width="40" height="40" />
|
||||||
<m:AvatarReplacement visible="false"
|
<m:AvatarReplacement visible="false"
|
||||||
ui:field="avatarReplacement"></m:AvatarReplacement>
|
ui:field="avatarReplacement"></m:AvatarReplacement>
|
||||||
|
</td>
|
||||||
|
<td align="left" style="vertical-align: middle">
|
||||||
|
<div style="margin-left: 10px;">
|
||||||
|
<g:HTML styleName="" ui:field="postOwnerArea" />
|
||||||
|
<g:InlineLabel styleName="timeStampContent"
|
||||||
|
ui:field="timeArea"></g:InlineLabel>
|
||||||
|
<g:InlineLabel styleName="timeStampContent"
|
||||||
|
ui:field="separator"> · </g:InlineLabel>
|
||||||
|
<g:InlineLabel styleName="vreSourceInMetadata"
|
||||||
|
ui:field="vreSourceInMetadata"></g:InlineLabel>
|
||||||
</div>
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="div-table-col nf-post-remove">
|
||||||
|
<g:HTML height="15px" ui:field="closeImage"></g:HTML>
|
||||||
|
<g:HTML height="15px" ui:field="openImage"></g:HTML>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="div-table-row">
|
||||||
<div class="div-table-col content">
|
<div class="div-table-col content">
|
||||||
<div class="tweet-content">
|
<div class="tweet-content">
|
||||||
<g:HTML styleName="" ui:field="contentArea" />
|
<g:HTML styleName="" ui:field="contentArea" />
|
||||||
<g:HTML styleName="" ui:field="seeMore" />
|
<g:HTML styleName="" ui:field="seeMore" />
|
||||||
</div>
|
</div>
|
||||||
<g:VerticalPanel ui:field="previewPanel" width="100%"></g:VerticalPanel>
|
<g:VerticalPanel ui:field="previewPanel"
|
||||||
|
width="100%"></g:VerticalPanel>
|
||||||
<m:Placeholder ui:field="attachmentPreviewPanel"></m:Placeholder>
|
<m:Placeholder ui:field="attachmentPreviewPanel"></m:Placeholder>
|
||||||
<div class="tweet-actions">
|
<div class="tweet-actions">
|
||||||
<table cellspacing="0" cellpadding="0">
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
@ -34,36 +58,26 @@
|
||||||
<g:HTML styleName="like" ui:field="likeArea" />
|
<g:HTML styleName="like" ui:field="likeArea" />
|
||||||
</td>
|
</td>
|
||||||
<td align="left" style="vertical-align: top;">
|
<td align="left" style="vertical-align: top;">
|
||||||
<g:Label ui:field="messageSeparator" styleName="tweet-separator"></g:Label>
|
<g:Label ui:field="messageSeparator"
|
||||||
|
styleName="tweet-separator"></g:Label>
|
||||||
</td>
|
</td>
|
||||||
<td align="left" style="vertical-align: top;">
|
<td align="left" style="vertical-align: top;">
|
||||||
<g:HTML styleName="message" ui:field="sharePostArea" />
|
<b:Button width="45px" icon="COMMENTS" type="LINK"
|
||||||
|
ui:field="commentsNo" visible="false"></b:Button>
|
||||||
</td>
|
</td>
|
||||||
<td align="left" style="vertical-align: top;">
|
<td align="left" style="vertical-align: top;">
|
||||||
<g:HTML styleName="time" ui:field="timeArea" />
|
<b:Button width="45px" icon="THUMBS_UP_ALT"
|
||||||
</td>
|
type="LINK" ui:field="likesNo" visible="false"></b:Button>
|
||||||
<td align="left" style="vertical-align: top;">
|
|
||||||
<b:Button width="45px" icon="COMMENTS" type="LINK" ui:field="commentsNo" visible="false"></b:Button>
|
|
||||||
</td>
|
|
||||||
<td align="left" style="vertical-align: top;">
|
|
||||||
<b:Button width="45px" icon="THUMBS_UP_ALT" type="LINK" ui:field="likesNo" visible="false"></b:Button>
|
|
||||||
</td>
|
|
||||||
<td align="right" style="width: 100%; vertical-align: top;">
|
|
||||||
<g:HTML styleName="comment" ui:field="vreSource"></g:HTML>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="tweet-content">
|
<div class="tweet-content">
|
||||||
<g:VerticalPanel ui:field="commentsPanel"></g:VerticalPanel>
|
<g:VerticalPanel ui:field="commentsPanel"></g:VerticalPanel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-table-col nf-post-remove">
|
|
||||||
<g:HTML height="15px" ui:field="closeImage"></g:HTML>
|
|
||||||
<g:HTML height="15px" ui:field="openImage"></g:HTML>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -4,6 +4,42 @@ table {
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.linkProfile {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
height: auto;
|
||||||
|
line-height: 19px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeStampContent {
|
||||||
|
color: rgb(97, 103, 112);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
height: auto;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
.vreSourceInMetadata {
|
||||||
|
color: rgb(97, 103, 112);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
height: auto;
|
||||||
|
line-height: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vreSourceInMetadata:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
img.member-photo {
|
||||||
|
border-radius: 2em;
|
||||||
|
display: block;
|
||||||
|
padding: 2px;
|
||||||
|
border: 1px solid #E6E6E6;
|
||||||
|
}
|
||||||
|
|
||||||
.result-hashtag {
|
.result-hashtag {
|
||||||
color: #555;
|
color: #555;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -18,7 +54,7 @@ table {
|
||||||
order-bottom-color: #08c;
|
order-bottom-color: #08c;
|
||||||
}
|
}
|
||||||
|
|
||||||
#newsfeedDIV .nav-pills > li.disabled > a {
|
#newsfeedDIV .nav-pills>li.disabled>a {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,12 +310,6 @@ div#comment-inputContainer textarea.post-comment.comment-dark-color {
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
img.member-photo {
|
|
||||||
display: block;
|
|
||||||
padding: 2px;
|
|
||||||
border: 1px solid #E6E6E6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comment-hidden {
|
.comment-hidden {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
@ -506,7 +536,7 @@ a.person-link {
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-table-col.content {
|
.div-table-col.content {
|
||||||
padding-left: 10px;
|
padding-top: 7px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,8 +605,8 @@ div.tweet-content a.link {
|
||||||
width: 260px;
|
width: 260px;
|
||||||
}
|
}
|
||||||
/* div.attachment-preview-container { */
|
/* div.attachment-preview-container { */
|
||||||
/* width: 300px; */
|
/* width: 300px; */
|
||||||
/* } */
|
/* } */
|
||||||
.linkpreview-desc, .linkpreview-url, .linkpreview-image {
|
.linkpreview-desc, .linkpreview-url, .linkpreview-image {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -607,8 +637,8 @@ div.tweet-content a.link {
|
||||||
width: 260px;
|
width: 260px;
|
||||||
}
|
}
|
||||||
/* div.attachment-preview-container { */
|
/* div.attachment-preview-container { */
|
||||||
/* width: 300px; */
|
/* width: 300px; */
|
||||||
/* } */
|
/* } */
|
||||||
.new-feeds-show {
|
.new-feeds-show {
|
||||||
width: 260px;
|
width: 260px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue