Made the portlet responsive

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@126874 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
costantino.perciante 2016-04-07 17:21:30 +00:00
parent aa0b4fdaa2
commit fd23914193
8 changed files with 44 additions and 38 deletions

View File

@ -30,5 +30,22 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/gwt-user.jar">
<attributes>
<attribute name="javadoc_location" value="file:/home/costantino/Downloads/gwt-2.7.0/doc/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/gwt-codeserver.jar">
<attributes>
<attribute name="javadoc_location" value="file:/home/costantino/Downloads/gwt-2.7.0/doc/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/gwt-dev.jar">
<attributes>
<attribute name="javadoc_location" value="file:/home/costantino/Downloads/gwt-2.7.0/doc/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/validation-api-1.0.0.GA.jar" sourcepath="/home/costantino/Downloads/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="output" path="target/notifications-2.0.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/notifications-2.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
jarsExcludedFromWebInfLib= jarsExcludedFromWebInfLib=
lastWarOutDir=/Users/massi/Documents/workspace/notifications/target/notifications-1.3.1-SNAPSHOT lastWarOutDir=/home/costantino/workspace/notifications/target/notifications-2.0.0-SNAPSHOT
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -1,5 +1,4 @@
#Thu Jun 16 11:14:17 CEST 2011
eclipse.preferences.version=1 eclipse.preferences.version=1
entryPointModules= entryPointModules=org.gcube.portlets.user.notifications.Notifications
filesCopiedToWebInfLib=gwt-servlet.jar filesCopiedToWebInfLib=gwt-servlet.jar
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy13YXIgc3JjL21haW4vd2ViYXBwXV0+PC9leHRyYS1hcmdzPjx2bS1hcmdzPjwhW0NEQVRBWy1YbXg1MTJtXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLmNvbXBhbnkuU29tZU1vZHVsZTwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+ gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy13YXIgc3JjL21haW4vd2ViYXBwXV0+PC9leHRyYS1hcmdzPjx2bS1hcmdzPjwhW0NEQVRBWy1YbXg1MTJtXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLmNvbXBhbnkuU29tZU1vZHVsZTwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+

View File

@ -70,8 +70,8 @@ public class NotificationsPanel extends Composite {
public NotificationsPanel() { public NotificationsPanel() {
notificationSettings.setVisible(false); notificationSettings.setVisible(false);
mainPanel = new VerticalPanel(); mainPanel = new VerticalPanel();
mainPanel.setWidth("100%");
container.setWidth("100%"); container.setWidth("100%");
mainPanel.setWidth("100%");
settingsPanel.setWidth("100%"); settingsPanel.setWidth("100%");
showMoreNotificationsPanel.setWidth("100%"); showMoreNotificationsPanel.setWidth("100%");
settingsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); settingsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
@ -80,6 +80,7 @@ public class NotificationsPanel extends Composite {
container.add(mainPanel); container.add(mainPanel);
loadingImage = new Image(loading); loadingImage = new Image(loading);
showLoader(); showLoader();
initWidget(container);
notificationService.getUserInfo(new AsyncCallback<UserInfo>() { notificationService.getUserInfo(new AsyncCallback<UserInfo>() {
@ -94,7 +95,6 @@ public class NotificationsPanel extends Composite {
} }
} }
}); });
initWidget(container);
notificationSettings.addClickHandler(new ClickHandler() { notificationSettings.addClickHandler(new ClickHandler() {
@Override @Override
@ -130,22 +130,18 @@ public class NotificationsPanel extends Composite {
// if the url ends with "showsettings=true" open the settings modal automatically // if the url ends with "showsettings=true" open the settings modal automatically
if(Location.getHref().endsWith("showsettings=true")){ if(Location.getHref().endsWith("showsettings=true")){
Timer t = new Timer() { Timer t = new Timer() {
@Override @Override
public void run() { public void run() {
clickElement(notificationSettings.getElement()); clickElement(notificationSettings.getElement());
} }
}; };
t.schedule(1000); t.schedule(1000);
} }
} }
/** /**
* Simulate click event * Simulate native click event
* @param elem * @param elem
*/ */
private static native void clickElement(Element elem) /*-{ private static native void clickElement(Element elem) /*-{
@ -274,12 +270,9 @@ public class NotificationsPanel extends Composite {
private void showLoader() { private void showLoader() {
mainPanel.clear(); mainPanel.clear();
mainPanel.setWidth("100%");
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(loadingImage); mainPanel.add(loadingImage);
} }
private void showSettingsLoader(boolean show) { private void showSettingsLoader(boolean show) {

View File

@ -1,23 +1,21 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:e="urn:import:org.gcube.portlets.user.gcubewidgets.client.elements"> xmlns:e="urn:import:org.gcube.portlets.user.gcubewidgets.client.elements"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<g:HTMLPanel ui:field="mainPanel"> <g:HTMLPanel ui:field="mainPanel">
<table class="single-notification-table"> <b:Row>
<tr>
<td valign="TOP" style="width: 30px;" align="middle">
<g:Image styleName="notification-photo" url=""
ui:field="notificationImage" width="30" height="30" />
</td> <b:Column size="2">
<td valign="TOP" style="width: 50px;"> <b:Image styleName="notification-photo" url=""
ui:field="notificationImage" width="30" height="30" />
<e:Span styleName="user-notification-time" ui:field="timeArea" /> <e:Span styleName="user-notification-time" ui:field="timeArea" />
</td> </b:Column>
<td valign="TOP">
<e:Span styleName="user-notification" ui:field="notificationText" /> <b:Column size="8">
<e:Span styleName="user-notification" ui:field="goApp" /> <e:Span styleName="user-notification" ui:field="notificationText" />
</td> <e:Span styleName="user-notification" ui:field="goApp" />
</tr> </b:Column>
</table> </b:Row>
</g:HTMLPanel> </g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>

View File

@ -93,7 +93,7 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
*/ */
public String getDevelopmentUser() { public String getDevelopmentUser() {
String user = "test.user"; String user = "test.user";
// user = "massimiliano.assante"; // user = "massimiliano.assante";
return user; return user;
} }
public UserInfo getUserInfo() { public UserInfo getUserInfo() {
@ -109,8 +109,7 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
thumbnailURL = user.getUserAvatarURL(); thumbnailURL = user.getUserAvatarURL();
fullName = user.getFullname(); fullName = user.getFullname();
email = user.getEmail(); email = user.getEmail();
String accountURL = "TODO";//TODO: UserInfo toReturn = new UserInfo(username, fullName, thumbnailURL, email, null, true, false, null);
UserInfo toReturn = new UserInfo(username, fullName, thumbnailURL, email, accountURL, true, false, null);
return toReturn; return toReturn;
} }
else { else {
@ -251,7 +250,7 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
String toReturn = toReplace.replaceAll("&amp;", "&"); String toReturn = toReplace.replaceAll("&amp;", "&");
return toReturn; return toReturn;
} }
@Override @Override
public boolean setUserNotificationPreferences(Map<NotificationType, NotificationChannelType[]> enabledChannels) { public boolean setUserNotificationPreferences(Map<NotificationType, NotificationChannelType[]> enabledChannels) {
return store.setUserNotificationPreferences(getASLSession().getUsername(), enabledChannels); return store.setUserNotificationPreferences(getASLSession().getUsername(), enabledChannels);

View File

@ -16,6 +16,8 @@
<entry-point <entry-point
class='org.gcube.portlets.user.notifications.client.Notifications' /> class='org.gcube.portlets.user.notifications.client.Notifications' />
<set-property name="bootstrap.responsiveDesign" value="true" />
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />
<source path='shared' /> <source path='shared' />

View File

@ -59,7 +59,7 @@ a.link:hover {
.day-wrapper { .day-wrapper {
width: 100%; max-width: 100%;
border-bottom-color: #DADADA; border-bottom-color: #DADADA;
border-bottom-style: solid; border-bottom-style: solid;
border-bottom-width: 1px; border-bottom-width: 1px;
@ -78,7 +78,7 @@ a.link:hover {
} }
.single-notification-table { .single-notification-table {
width: 920px; max-width: 65%;
padding: 5px; padding: 5px;
border-bottom: 1px solid #EFEFEF; border-bottom: 1px solid #EFEFEF;
} }
@ -96,13 +96,12 @@ a.link:hover {
} }
.notification-photo { .notification-photo {
display: block;
padding: 2px; padding: 2px;
border: none; border: none;
margin-left: 5px;
} }
.user-notification-time { .user-notification-time {
width: 99%;
color: #999; color: #999;
font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial,
sans-serif; sans-serif;
@ -120,7 +119,6 @@ a.link:hover {
padding: 5px; padding: 5px;
} }
.user-notification { .user-notification {
width: 99%;
color: #333; color: #333;
font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial,
sans-serif; sans-serif;