restyled GUI

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@122043 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-12-21 17:33:23 +00:00
parent d0a4578f42
commit eebe4de85f
10 changed files with 74 additions and 138 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/share-updates-1.8.1-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/share-updates-1.8.2-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/share-updates-1.8.1-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/share-updates-1.8.2-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -7,9 +7,6 @@
<dependent-module archiveName="gcube-widgets-1.9.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets"> <dependent-module archiveName="gcube-widgets-1.9.1-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="pickitem-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="share-updates"/> <property name="context-root" value="share-updates"/>
</wb-module> </wb-module>

View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>share-updates</artifactId> <artifactId>share-updates</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>1.8.1-SNAPSHOT</version> <version>1.8.2-SNAPSHOT</version>
<name>gCube Share Updates Portlet</name> <name>gCube Share Updates Portlet</name>
<description> <description>
@ -74,6 +74,10 @@
<artifactId>social-networking-library</artifactId> <artifactId>social-networking-library</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>notifications-common-library</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId> <artifactId>aslcore</artifactId>

View File

@ -20,6 +20,7 @@ import org.gcube.portlets.widgets.fileupload.client.view.UploadProgressPanel;
import org.jsonmaker.gwt.client.Jsonizer; import org.jsonmaker.gwt.client.Jsonizer;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Style.Unit;
@ -144,14 +145,12 @@ public class ShareUpdateForm extends Composite {
shareupdateService.getUserSettings(new AsyncCallback<UserSettings>() { shareupdateService.getUserSettings(new AsyncCallback<UserSettings>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
avatarImage.setSize("60px", "60px");
avatarImage.setUrl(avatar_default); avatarImage.setUrl(avatar_default);
} }
public void onSuccess(UserSettings userSettings) { public void onSuccess(UserSettings userSettings) {
myUserInfo = userSettings.getUserInfo(); myUserInfo = userSettings.getUserInfo();
avatarImage.getElement().getParentElement().setAttribute("href", myUserInfo.getAccountURL()); avatarImage.getElement().getParentElement().setAttribute("href", myUserInfo.getAccountURL());
avatarImage.setSize("60px", "60px");
avatarImage.setUrl(myUserInfo.getAvatarId()); avatarImage.setUrl(myUserInfo.getAvatarId());
String singleVREName = ""; String singleVREName = "";
@ -198,6 +197,9 @@ public class ShareUpdateForm extends Composite {
@UiHandler("shareTextArea") @UiHandler("shareTextArea")
void onShareUpdateClick(ClickEvent e) { void onShareUpdateClick(ClickEvent e) {
shareTextArea.removeSampleText(); shareTextArea.removeSampleText();
Document.get().getElementById("highlighterContainer").getStyle().setHeight(52, Unit.PX);
Document.get().getElementById("highlighter").getStyle().setHeight(52, Unit.PX);
Document.get().getElementById("postTextArea").getStyle().setHeight(52, Unit.PX);
} }
@UiHandler("attachButton") @UiHandler("attachButton")

View File

@ -3,16 +3,13 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:org.gcube.portlets.user.shareupdates.client.view" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:org.gcube.portlets.user.shareupdates.client.view"
xmlns:j="urn:import:org.gcube.portlets.widgets.fileupload.client.view"> xmlns:j="urn:import:org.gcube.portlets.widgets.fileupload.client.view">
<g:HTMLPanel ui:field="mainPanel"> <g:HTMLPanel ui:field="mainPanel">
<table class="tab-main-container"> <div class="share-updates-table">
<tr> <div>
<td align="middle" valign="top"> <div class="share-updates-photo-cell">
<a href=""> <g:Image title="Edit Profile Picture" styleName="share-updates-member-photo"
<g:Image title="Edit Profile Picture" styleName="member-photo" url="" ui:field="avatarImage" />
url="" ui:field="avatarImage" width="60px" height="60px" /> </div>
</a> <div class="share-updates-cell">
</td>
<td valign="top">
<div id="supercontainer"> <div id="supercontainer">
<div id="highlighterContainer"> <div id="highlighterContainer">
<div id="highlighter"> <div id="highlighter">
@ -23,11 +20,13 @@
ui:field="shareTextArea" /> ui:field="shareTextArea" />
</div> </div>
</div> </div>
</td> </div>
</tr> </div>
</table> </div>
<j:UploadProgressPanel ui:field="uploadProgress"></j:UploadProgressPanel> <j:UploadProgressPanel ui:field="uploadProgress"></j:UploadProgressPanel>
<m:Placeholder ui:field="preview"></m:Placeholder> <m:Placeholder ui:field="preview"></m:Placeholder>
<table class="toolsContainer"> <table class="toolsContainer">
<tr> <tr>
<td valign="middle" width="60px;"> <td valign="middle" width="60px;">

View File

@ -1,39 +0,0 @@
package org.gcube.portlets.user.shareupdates.server;
import java.util.ArrayList;
import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.portlets.widgets.pickitem.shared.ItemBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Massimiliano Assante ISTI-CNR
*
*/
public class MentionNotificationsThread implements Runnable {
private static Logger _log = LoggerFactory.getLogger(MentionNotificationsThread.class);
private String postText;
private String postId;
private NotificationsManager nm;
private ArrayList<ItemBean> users;
public MentionNotificationsThread(String postId, String postText, NotificationsManager nm, ArrayList<ItemBean> users) {
super();
this.postId = postId;
this.postText = postText;
this.nm = nm;
this.users = users;
}
@Override
public void run() {
for (ItemBean userToNotify : users) {
boolean result = nm.notifyUserTag(userToNotify.getName(), postId, postText);
_log.trace("Sending Notification for post mention to: " + userToNotify.getName() + " result?"+ result);
}
}
}

View File

@ -1,48 +0,0 @@
package org.gcube.portlets.user.shareupdates.server;
import java.util.List;
import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.UserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Massimiliano Assante ISTI-CNR
*
*/
public class PostNotificationsThread implements Runnable {
private static Logger _log = LoggerFactory.getLogger(PostNotificationsThread.class);
private String postText;
private String postId;
private String groupId;
private List<String> hashtags;
private NotificationsManager nm;
public PostNotificationsThread(String postId, String postText, String groupId, NotificationsManager nm, List<String> hashtags) {
super();
this.postId = postId;
this.postText = postText;
this.groupId = groupId;
this.hashtags = hashtags;
this.nm = nm;
}
@Override
public void run() {
UserManager um = new LiferayUserManager();
String[] hashtagsToPass = hashtags.toArray(new String[hashtags.size()]);
try {
for (UserModel user : um.listUsersByGroup(groupId)) {
boolean result = nm.notifyPost(user.getScreenName(), postId, postText, hashtagsToPass);
_log.trace("Sending Notification for post alert to: " + user.getScreenName() + " result?"+ result);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -39,6 +39,9 @@ import org.gcube.portal.databook.shared.FeedType;
import org.gcube.portal.databook.shared.PrivacyLevel; import org.gcube.portal.databook.shared.PrivacyLevel;
import org.gcube.portal.databook.shared.UserInfo; import org.gcube.portal.databook.shared.UserInfo;
import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException; import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException;
import org.gcube.portal.notifications.bean.GenericItemBean;
import org.gcube.portal.notifications.thread.MentionNotificationsThread;
import org.gcube.portal.notifications.thread.PostNotificationsThread;
import org.gcube.portlets.user.shareupdates.client.ShareUpdateService; import org.gcube.portlets.user.shareupdates.client.ShareUpdateService;
import org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm; import org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm;
import org.gcube.portlets.user.shareupdates.server.opengraph.OpenGraph; import org.gcube.portlets.user.shareupdates.server.opengraph.OpenGraph;
@ -249,7 +252,11 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
//send the notification to the mentioned users //send the notification to the mentioned users
if (mentionedUsers != null && mentionedUsers.size() > 0) { if (mentionedUsers != null && mentionedUsers.size() > 0) {
NotificationsManager nm = new ApplicationNotificationsManager(session); NotificationsManager nm = new ApplicationNotificationsManager(session);
Thread thread = new Thread(new MentionNotificationsThread(toShare.getKey(), textToPost, nm, mentionedUsers)); ArrayList<GenericItemBean> toPass = new ArrayList<GenericItemBean>();
for (ItemBean u : mentionedUsers) {
toPass.add(new GenericItemBean(u.getId(), u.getName(), u.getAlternativeName(), u.getThumbnailURL()));
}
Thread thread = new Thread(new MentionNotificationsThread(toShare.getKey(), textToPost, nm, toPass));
thread.start(); thread.start();
} }

View File

@ -26,5 +26,5 @@
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />
<source path='shared' /> <source path='shared' />
<add-linker name="xsiframe" />
</module> </module>

View File

@ -1,3 +1,34 @@
.share-updates-table {
display: table;
border-collapse: collapse;
width: 100%;
}
.share-updates-table>div {
display: table-row;
}
.share-updates-table .share-updates-cell {
display: table-cell;
padding-left: 3px;
}
.share-updates-table .share-updates-photo-cell {
display: table-cell;
width: 60px;
text-align: center;
}
.share-updates-photo-cell>img {
}
.share-updates-member-photo {
margin-left: 6px;
width: 39px;
height: 39px;
border-radius: 4px;
}
/* Superpose TextArea and Highlight DIV trick starts here */ /* Superpose TextArea and Highlight DIV trick starts here */
#supercontainer { #supercontainer {
@ -10,7 +41,7 @@
top: 0; top: 0;
cursor: text; cursor: text;
width: 525px; width: 525px;
height: 54px; height: 32px;
} }
#inputContainer { #inputContainer {
@ -27,38 +58,32 @@
font-size: 13px; font-size: 13px;
letter-spacing: normal; letter-spacing: normal;
line-height: normal; line-height: normal;
border: 1px solid transparent; border: 1px solid transparent;
-moz-border-radius: 4px; -moz-border-radius: 4px;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
width: 525px; width: 525px;
height: 54px; height: 32px;
word-wrap: break-word;
word-wrap: break-word; /* this is very important when usere paste long links*/ /* this is very important when usere paste long links*/
} }
.postTextArea { .postTextArea {
padding: 4px 2px; padding: 4px 2px;
color: #999; color: #999;
background-color: transparent; background-color: transparent;
margin: 0px; margin: 0px;
font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial,
sans-serif; sans-serif;
font-size: 13px; font-size: 13px;
letter-spacing: normal; letter-spacing: normal;
line-height: normal; line-height: normal;
border: 1px solid #999; border: 1px solid #999;
-moz-border-radius: 4px; -moz-border-radius: 4px;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
width: 525px; width: 525px;
height: 54px; height: 32px;
} }
.highlightedUser { .highlightedUser {
@ -69,7 +94,6 @@
background-color: #0084B5 !important; background-color: #0084B5 !important;
} }
/* DIV trick ends here */ /* DIV trick ends here */
.gwt-Button { .gwt-Button {
@ -101,7 +125,7 @@
padding: 5px 15px; padding: 5px 15px;
} }
.shareButton:hover, .shareButton:focus { .shareButton:hover,.shareButton:focus {
background-color: #019AD3; background-color: #019AD3;
background-image: linear-gradient(#33BCEF, #019AD3); background-image: linear-gradient(#33BCEF, #019AD3);
border-color: #057ED0; border-color: #057ED0;
@ -111,7 +135,6 @@
background: #e3e8f3; background: #e3e8f3;
} }
.framed { .framed {
margin: 0 0 10px; margin: 0 0 10px;
padding: 10px; padding: 10px;
@ -128,13 +151,6 @@
padding-top: 2px; padding-top: 2px;
} }
.member-photo {
display: block;
padding: 2px;
border: 1px solid #E6E6E6;
margin: 0 2px 2px 0;
}
.link-previewer { .link-previewer {
width: 600px; width: 600px;
padding-top: 10px; padding-top: 10px;
@ -163,7 +179,7 @@
font-weight: bold; font-weight: bold;
line-height: 15px; line-height: 15px;
width: 465px; width: 465px;
word-break:break-all; word-break: break-all;
} }
.link-url { .link-url {
@ -240,12 +256,9 @@ a.link:hover {
} }
.toolsContainer { .toolsContainer {
padding-top: 3px; padding: 3px 0 0 2px;
width: 600px; width: 595px;
background-image: none; background-image: none;
border-top-color: #DADADA;
border-top-style: solid;
border-top-width: 1px;
} }
.wizardListbox { .wizardListbox {
@ -259,10 +272,11 @@ a.link:hover {
border-style: solid; border-style: solid;
cursor: pointer; cursor: pointer;
cursor: hand; cursor: hand;
margin-left: 6px; margin-left: 0px;
-moz-border-radius: 4px; -moz-border-radius: 4px;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
margin-top: 2px;
} }
/* smart textarea */ /* smart textarea */