From 297ba682affd1ff73994a9f4b2202dce8c736a7e Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Thu, 31 Jan 2013 18:39:25 +0000 Subject: [PATCH] fixed min height git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@68669 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/view/NotificationsPanel.java | 26 ++++++++++++------ .../server/NotificationsServiceImpl.java | 4 +-- .../webapp/WEB-INF/jsp/Notifications_view.jsp | 4 +-- src/main/webapp/images/feeds-spacer.gif | Bin 0 -> 1540 bytes 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 src/main/webapp/images/feeds-spacer.gif diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java index ecb0ea7..296284d 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java @@ -15,6 +15,7 @@ import org.gcube.portlets.user.notifications.client.view.templates.DayWrapper; import org.gcube.portlets.user.notifications.client.view.templates.SingleNotificationView; import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -32,6 +33,7 @@ public class NotificationsPanel extends Composite { private final NotificationsServiceAsync notificationService = GWT.create(NotificationsService.class); public static final String loading = GWT.getModuleBaseURL() + "../images/feeds-loader.gif"; + private static final String spacer = GWT.getModuleBaseURL() + "../images/feeds-spacer.gif"; private static final String warning = GWT.getModuleBaseURL() + "../images/warning_blue.png"; private UserInfo myUserInfo; private Image loadingImage; @@ -66,7 +68,6 @@ public class NotificationsPanel extends Composite { notificationService.getUserNotifications(new AsyncCallback>>() { public void onFailure(Throwable caught) { - // TODO Auto-generated method stub } @@ -82,16 +83,25 @@ public class NotificationsPanel extends Composite { mainPanel.setHeight(""); mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); - + ArrayList sortedKeys=new ArrayList(notificationsPerDay.keySet()); Collections.sort(sortedKeys, Collections.reverseOrder()); - + + int notCounter = 0; for (Date day : sortedKeys) { mainPanel.add(new DayWrapper(day)); - for (Notification notif : notificationsPerDay.get(day)) + for (Notification notif : notificationsPerDay.get(day)) { mainPanel.add(new SingleNotificationView(notif)); + notCounter++; + } } setNotificationsRead(); + if (notCounter < 5) { + mainPanel.add(new Image(spacer)); + mainPanel.add(new Image(spacer)); + } + if (notCounter > 5 && notCounter < 10) + mainPanel.add(new Image(spacer)); } } else @@ -107,11 +117,11 @@ public class NotificationsPanel extends Composite { mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); mainPanel.add(loadingImage); } - + Timer t; private void setNotificationsRead() { t = new Timer() { - + @Override public void run() { notificationService.setAllUserNotificationsRead(new AsyncCallback() { @@ -120,10 +130,10 @@ public class NotificationsPanel extends Composite { public void onSuccess(Boolean result) { } }); - + } }; - + t.schedule(500); } } diff --git a/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java b/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java index 150d658..586334e 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java @@ -59,8 +59,8 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE); if (user == null) { //user = "test.user"; - //user = "leonardo.candela"; - user = "massimiliano.assante"; + user = "leonardo.candela"; + //user = "massimiliano.assante"; _log.warn("USER IS NULL setting "+user+" and Running OUTSIDE PORTAL"); withinPortal = false; } diff --git a/src/main/webapp/WEB-INF/jsp/Notifications_view.jsp b/src/main/webapp/WEB-INF/jsp/Notifications_view.jsp index d8066e3..16421fa 100644 --- a/src/main/webapp/WEB-INF/jsp/Notifications_view.jsp +++ b/src/main/webapp/WEB-INF/jsp/Notifications_view.jsp @@ -9,7 +9,7 @@ --%> -
-
+
+ diff --git a/src/main/webapp/images/feeds-spacer.gif b/src/main/webapp/images/feeds-spacer.gif new file mode 100644 index 0000000000000000000000000000000000000000..dabcc3c1a79ecd98039c9b65f951b58963a3a7e1 GIT binary patch literal 1540 zcmZ?wbhEHb{K9yGp@D(n|Ns9C3=E3@xg&f76kHNZ5`naheMLcHa&~HoLQ-maW}dCm z``!DM6f#q6mBLMZ4SWlnQ!_F>s)|yBtNcQetFn_VQ=?Nk^)#sNw%$$BS=C4WT$g}QL2Keo`G(%fti7VnW3Jcv5C34 zxsHO7fuVuEfswwUk*=Y+m9dePfq?=PC;@FNN=dT{a&d#&1?1T(Wt5Z@Sn2DRmzV36 z8|&p4rRy77T3Uk4Ff!5ws?aU2%qvN((9J7WhMC}!TAW;zSx}OhpQivaF)=B>w8T~k z=u(Imatq+b<`wIKy`z_$pQ~SySfFpHX8`gNOrftYex9{rvI$+t)9j zKYjf0{@vR*uV1}<@%-7-CyyUJd~pBX-8;8$-Mn%A+SMzUFI~KF{@mF!r%#aDv3%LmC5sm=Trhv$+&Qyn&73iP z+SDnNCrzBt-`CsI-PPIA-qzaE+|<}mUsqdGT~%38URGLCTvS+)pO>4Hot2r9o|c-D zoRpXl9~T=F9Tgc79u^uB926Mf@8|2|?d9p=?&j*^?BwWRZ)a;`ZDna;Zf0s?Yy`|w zdb&E=TACW_YN{&AN{R~daulEcJL|r4^K~D8vgv1!-|Fjcw*BVqKmGj6 zuD^ZfUw{9z??1nUhJ{B&Mn%Vr6+2Gcc=3ZnQq$5iGPAOC=E|KXZ@&D=DWzrQ6_r)h zHEY$bQ@39I;*!?3_Kwc3?w-AR_vzcOe{;*|*!aZc)bz|*v**m6H-C6!b!~lPb8CC& zuHAd~?%Th-a(Z@tad~xp^VaPj+{`u?opTGb9Kfl3(1C1=)QZ^k1 z3lFvONL$r#7%n=}DWV;VHvjFz03sNy}#rqgKYsi`{AyJ|R%mz|ku zl6`AWr}6T0b8V`B{oyoOabclLx0G#{$;wMheP&zLa+$8WvNB|K)ZQ-B)z{X>?5_ID zWwz$V#+1{uY`e|Y-rAaTdsi*D`MNthOJ3jF+ikx7-rkzuzy5MtY