partially responsive, still need to tune it little bit
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@128391 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f37096fc6e
commit
ad3689ba5d
|
@ -4,7 +4,7 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||
<dependent-module archiveName="session-checker-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/session-checker/session-checker">
|
||||
<dependent-module archiveName="session-checker-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/session-checker/session-checker">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="pickitem-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -104,6 +104,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
<artifactId>aslsocial</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -129,6 +130,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>notifications-common-library</artifactId>
|
||||
<version>[1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -44,8 +44,7 @@ public class NewsFeed implements EntryPoint {
|
|||
public void init() {
|
||||
|
||||
mainPanel = new NewsFeedPanel();
|
||||
mainPanel.setWidth("620px");
|
||||
|
||||
|
||||
RootPanel.get(UNIQUE_DIV).add(mainPanel);
|
||||
|
||||
ClientFeed notification = new ClientFeed();
|
||||
|
|
|
@ -252,7 +252,7 @@ public class NewsFeedPanel extends Composite {
|
|||
*/
|
||||
public NewsFeedPanel() {
|
||||
bind();
|
||||
mainPanel.setWidth("600px");
|
||||
mainPanel.setWidth("100%");
|
||||
mainPanel.add(filterPanelWrapper);
|
||||
filterPanelWrapper.setVisible(false);
|
||||
mainPanel.add(newUpdatesPanel);
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.gcube.portlets.user.gcubewidgets.client.elements.Div;
|
|||
import org.gcube.portlets.user.newsfeed.client.event.AddCommentEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.EditCommentEvent;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.KeyPressEvent;
|
||||
|
@ -17,7 +18,6 @@ import com.google.gwt.uibinder.client.UiField;
|
|||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.Timer;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:w="urn:import:org.gcube.portlets.user.gcubewidgets.client.elements"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
|
||||
xmlns:m="urn:import:org.gcube.portlets.user.newsfeed.client.ui">
|
||||
<ui:style>
|
||||
.important {
|
||||
|
@ -9,7 +10,7 @@
|
|||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel styleName="comment-hidden" ui:field="mainPanel">
|
||||
<table class="">
|
||||
<table class="single-comment">
|
||||
<tr>
|
||||
<td width="30px" align="middle">
|
||||
<g:Image styleName="member-photo" url="" ui:field="avatarImage"
|
||||
|
@ -30,8 +31,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<g:Button ui:field="cancelButton" text="Cancel" />
|
||||
<g:Button ui:field="submitButton" text="Comment" />
|
||||
<b:Button ui:field="cancelButton" text="Cancel" />
|
||||
<b:Button ui:field="submitButton" text="Comment" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -41,6 +41,7 @@ public class ShowMoreFeeds extends Composite {
|
|||
caption.setHTML("Show more feeds");
|
||||
//done after
|
||||
panel.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
panel.setWidth("260px");
|
||||
}
|
||||
|
||||
@UiHandler("caption")
|
||||
|
|
|
@ -31,32 +31,4 @@
|
|||
</tr>
|
||||
</table>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
|
||||
<!-- <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> -->
|
||||
<!-- <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" -->
|
||||
<!-- xmlns:g="urn:import:com.google.gwt.user.client.ui"> -->
|
||||
<!-- <ui:style> -->
|
||||
<!-- .important { -->
|
||||
<!-- font-weight: bold; -->
|
||||
<!-- } -->
|
||||
<!-- </ui:style> -->
|
||||
<!-- <g:HorizontalPanel ui:field="mainPanel" styleName="single-comment"> -->
|
||||
<!-- <g:SimplePanel width="30px"> -->
|
||||
<!-- <g:Image styleName="member-photo" url="" ui:field="avatarImage" -->
|
||||
<!-- width="30" height="30" /> -->
|
||||
|
||||
<!-- </g:SimplePanel> -->
|
||||
<!-- <g:VerticalPanel ui:field="commentPanel" width="100%" styleName="shareContainer-in"> -->
|
||||
<!-- <g:HTML styleName="user-comment" ui:field="commentText" /> -->
|
||||
<!-- <g:HTML styleName="user-comment-time" ui:field="timeArea" /> -->
|
||||
<!-- </g:VerticalPanel> -->
|
||||
<!-- <g:SimplePanel width="15px"> -->
|
||||
<!-- <g:HTML height="15px" ui:field="editImage"></g:HTML> -->
|
||||
<!-- </g:SimplePanel> -->
|
||||
<!-- <g:SimplePanel width="15px"> -->
|
||||
<!-- <g:HTML height="15px" ui:field="closeImage"></g:HTML> -->
|
||||
<!-- </g:SimplePanel> -->
|
||||
|
||||
<!-- </g:HorizontalPanel> -->
|
||||
<!-- </ui:UiBinder> -->
|
||||
</ui:UiBinder>
|
|
@ -21,6 +21,7 @@ import org.gcube.application.framework.core.session.ASLSession;
|
|||
import org.gcube.application.framework.core.session.SessionManager;
|
||||
import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
|
||||
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
|
||||
import org.gcube.common.portal.GCubePortalConstants;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
|
@ -75,7 +76,7 @@ import com.liferay.portal.service.UserLocalServiceUtil;
|
|||
public class NewsServiceImpl extends RemoteServiceServlet implements NewsService {
|
||||
|
||||
private static final Logger _log = LoggerFactory.getLogger(NewsServiceImpl.class);
|
||||
|
||||
|
||||
private static final String VRE_LABEL = "VRE_LABEL";
|
||||
private static final String SHOW_TIMELINE_SOURCE = "SHOW_TIMELINE_SOURCE";
|
||||
private static final String REFRESH_TIME = "REFRESH_TIME";
|
||||
|
@ -124,6 +125,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
private ASLSession getASLSession() {
|
||||
String sessionID = this.getThreadLocalRequest().getSession().getId();
|
||||
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
||||
|
||||
if (user == null) {
|
||||
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
|
||||
user = getDevelopmentUser();
|
||||
|
@ -137,7 +139,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
*/
|
||||
public String getDevelopmentUser() {
|
||||
String user = NewsConstants.TEST_USER;
|
||||
// user = "costantino.perciante";
|
||||
//user = "costantino.perciante";
|
||||
return user;
|
||||
}
|
||||
/**
|
||||
|
@ -179,7 +181,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
if (username.compareTo(NewsConstants.TEST_USER) != 0 && !isDevelopment) {
|
||||
UserManager um = new LiferayUserManager();
|
||||
GCubeUser user = um.getUserByUsername(username);
|
||||
|
||||
|
||||
thumbnailURL = user.getUserAvatarURL();
|
||||
fullName = user.getFullname();
|
||||
email = user.getEmail();
|
||||
|
@ -188,7 +190,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest())+
|
||||
GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
||||
String accountURL = profilePageURL;
|
||||
|
||||
|
||||
try {
|
||||
accountURL = "";
|
||||
}catch (NullPointerException e) {
|
||||
|
@ -334,7 +336,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
}
|
||||
|
||||
String lowerCaseHashtag = hashtag.toLowerCase();
|
||||
|
||||
|
||||
/**
|
||||
* this handles the case where the portlet is deployed outside of VREs (regular)
|
||||
*/
|
||||
|
@ -643,8 +645,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
public boolean like(String feedid, String feedText, String feedOwnerId) {
|
||||
boolean likeCommitResult = false;
|
||||
UserInfo user = getUserSettings().getUserInfo();
|
||||
|
||||
if (user.getUsername().compareTo(NewsConstants.TEST_USER) == 0) {
|
||||
String username = user.getUsername();
|
||||
if (username.compareTo(NewsConstants.TEST_USER) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -661,7 +663,11 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
if (likeCommitResult) {
|
||||
//if the user who liked this post is not the user who posted it notify the poster user (Feed owner)
|
||||
if (! user.getUsername().equals(feedOwnerId)) {
|
||||
NotificationsManager nm = new ApplicationNotificationsManager(getASLSession(), APP_ID);
|
||||
NotificationsManager nm = new ApplicationNotificationsManager(
|
||||
getThreadLocalRequest(),
|
||||
getASLSession().getScopeName(),
|
||||
new SocialNetworkingUser(username, user.getEmailaddress(), user.getFullName(), user.getAvatarId()),
|
||||
APP_ID);
|
||||
boolean nResult = nm.notifyLikedFeed(feedOwnerId, feedid, escapeHtml(feedText));
|
||||
_log.trace("Like Notification added? " + nResult);
|
||||
}
|
||||
|
@ -727,7 +733,11 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
//if the comment was correctly delivered && is not an app feed notify users involved
|
||||
if (commentCommitResult && isWithinPortal()) {
|
||||
//if the user who commented this post is not the user who posted it notify the poster user (Feed owner)
|
||||
NotificationsManager nm = new ApplicationNotificationsManager(getASLSession(), APP_ID);
|
||||
NotificationsManager nm = new ApplicationNotificationsManager(
|
||||
getThreadLocalRequest(),
|
||||
getASLSession().getScopeName(),
|
||||
new SocialNetworkingUser(user.getUsername(), user.getEmailaddress(), user.getFullName(), user.getAvatarId()),
|
||||
APP_ID);
|
||||
if (! user.getUsername().equals(feedOwnerId) && (!isAppFeed)) {
|
||||
boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapedCommentText, comment.getKey());
|
||||
_log.trace("Comment Notification to post owner added? " + result);
|
||||
|
@ -1026,7 +1036,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* utilty method that convert a URL in a text into a clickable link into the browser
|
||||
*
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Utils {
|
|||
GroupManager gm = new LiferayGroupManager();
|
||||
ScopeBean sb = new ScopeBean(scope);
|
||||
List<GCubeUser> users = null;
|
||||
|
||||
|
||||
if (sb.is(Type.INFRASTRUCTURE))
|
||||
users = um.listUsersByGroup(gm.getRootVO().getGroupId());
|
||||
else if (sb.is(Type.VRE)) { //must be in VRE
|
||||
|
@ -156,11 +156,7 @@ public class Utils {
|
|||
*/
|
||||
protected static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList<ItemBean> taggedPeople, HttpServletRequest request) {
|
||||
String userProfilePageURL = "";
|
||||
try {
|
||||
userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
||||
} catch (PortalException | SystemException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
||||
for (ItemBean tagged : taggedPeople) {
|
||||
String taggedHTML = "<a class=\"link\" href=\""+userProfilePageURL
|
||||
+"?"+
|
||||
|
|
|
@ -1,5 +1,48 @@
|
|||
@import url(https://fonts.googleapis.com/css?family=Architects+Daughter);
|
||||
|
||||
/* For phones*/
|
||||
@media screen and (max-width: 520px) {
|
||||
|
||||
#comment-highlighterContainer {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.comment-highlighter {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
div#comment-inputContainer textarea.post-comment {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
.link-preview {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
div.attachment-preview-container {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.linkpreview-desc, .linkpreview-url, .linkpreview-image {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.link-preview {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
div.attachment-preview-container {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.linkpreview-desc, .linkpreview-url, .linkpreview-image {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
border-collapse: separate !important;
|
||||
border-spacing: 0;
|
||||
|
@ -10,6 +53,7 @@ table {
|
|||
color: #555;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
/* Superpose TextArea and Highlight DIV trick starts here */
|
||||
#comment-supercontainer {
|
||||
position: relative;
|
||||
|
@ -21,7 +65,7 @@ table {
|
|||
left: 0;
|
||||
top: 0;
|
||||
cursor: text;
|
||||
width: 460px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
|
@ -41,7 +85,7 @@ table {
|
|||
line-height: normal;
|
||||
border: 1px solid transparent;
|
||||
margin-left: 5px;
|
||||
width: 430px;
|
||||
width: 98%;
|
||||
min-height: 30px;
|
||||
word-wrap: break-word;
|
||||
/* this is very important when usere paste long links*/
|
||||
|
@ -60,11 +104,11 @@ div#comment-inputContainer textarea.post-comment {
|
|||
line-height: normal;
|
||||
border: 1px solid #C3CDE7;
|
||||
margin-left: 5px;
|
||||
width: 430px;
|
||||
width: 98%;
|
||||
min-height: 30px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
}
|
||||
|
||||
div#comment-inputContainer textarea.post-comment.comment-dark-color {
|
||||
|
@ -199,7 +243,7 @@ div#comment-inputContainer textarea.post-comment.comment-dark-color {
|
|||
background-image: none;
|
||||
border: 1px solid #DDD;
|
||||
border-radius: 4px;
|
||||
width: 485px;
|
||||
width: 97%;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
@ -222,7 +266,7 @@ div#comment-inputContainer textarea.post-comment.comment-dark-color {
|
|||
background-image: none;
|
||||
border: 1px solid #DDD;
|
||||
border-radius: 4px;
|
||||
width: 485px;
|
||||
width: 99%;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
@ -268,7 +312,7 @@ img.member-photo {
|
|||
-moz-transition: opacity .45s ease-in-out;
|
||||
-webkit-transition: opacity .45s ease-in-out;
|
||||
-ms-transition: opacity .45s ease-in-out;
|
||||
width: 494px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.commentsPanel {
|
||||
|
@ -294,7 +338,7 @@ div>table.single-comment, .single-comment {
|
|||
border-bottom-width: 1px;
|
||||
border-left: 2px solid #DDD;
|
||||
padding-left: 3px;
|
||||
width: 495px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comment-bgcolor {
|
||||
|
@ -412,7 +456,7 @@ a.person-link {
|
|||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
color: #333;
|
||||
width: 500px;
|
||||
width: 100%;
|
||||
word-wrap: break-word;
|
||||
-ms-word-break: break-all;
|
||||
/* Non standard for webkit */
|
||||
|
@ -428,7 +472,7 @@ a.person-link {
|
|||
}
|
||||
|
||||
.tweet-actions {
|
||||
width: 500px;
|
||||
width: 99%;
|
||||
padding-top: 5px;
|
||||
font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial,
|
||||
sans-serif;
|
||||
|
@ -478,7 +522,7 @@ a.person-link {
|
|||
|
||||
.div-table {
|
||||
display: table;
|
||||
width: 590px;
|
||||
width: 98%;
|
||||
background-clip: border-box;
|
||||
background-image: none;
|
||||
background-origin: padding-box;
|
||||
|
@ -544,4 +588,3 @@ a.person-link {
|
|||
transition: background .45s ease-in-out;
|
||||
-moz-transition: background .45s ease-in-out;
|
||||
-webkit-transition: background .45s ease-in-out;
|
||||
}
|
Loading…
Reference in New Issue