diff --git a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/StatisticsPanel.java b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/StatisticsPanel.java index c8bcead..16f2a56 100644 --- a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/StatisticsPanel.java +++ b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/StatisticsPanel.java @@ -61,7 +61,7 @@ public class StatisticsPanel extends Composite { /** * tooltip for the above image */ - private static final String ALERT_MESSAGE = "Information not available at the moment."; + private static final String ALERT_MESSAGE = "Information not available at the moment"; /** * Title of the page @@ -458,11 +458,8 @@ public class StatisticsPanel extends Composite { if(!isProfilePage || getUserToShowId() == null) activityDone.setEventBus(eventBus); - String urlPostsIcon = GWT.getModuleBaseURL() + "../images/share-blue.png"; - if(isRoot || isProfilePage) activityDone.setPosts( - urlPostsIcon, formattedNumbers(postsBean.getFeedsNumber()), TOOLTIP_POSTS_DONE, TOOLTIP_POSTS_DONE + " (" + postsBean.getFeedsNumber() + ")", @@ -470,7 +467,6 @@ public class StatisticsPanel extends Composite { information.getCurrentPageLanding()); else activityDone.setPosts( - urlPostsIcon, formattedNumbers(postsBean.getFeedsNumber()), TOOLTIP_POSTS_DONE, TOOLTIP_POSTS_DONE_VRE + " (" + postsBean.getFeedsNumber() + ")", @@ -480,10 +476,8 @@ public class StatisticsPanel extends Composite { numberOfWrittenFeeds = postsBean.getFeedsNumber(); activityDoneWidgetContainer.appendToPanel(activityDone); - String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png"; if(isRoot || isProfilePage) activityDone.setLikes( - urlLikesIcon, formattedNumbers(postsBean.getLikesMade()), TOOLTIP_LIKES_DONE, TOOLTIP_LIKES_DONE + " (" + postsBean.getLikesMade() + ")", @@ -491,17 +485,14 @@ public class StatisticsPanel extends Composite { information.getCurrentPageLanding()); else activityDone.setLikes( - urlLikesIcon, formattedNumbers(postsBean.getLikesMade()), TOOLTIP_LIKES_DONE_VRE, TOOLTIP_LIKES_DONE_VRE + " (" + postsBean.getLikesMade() + ")", ShowUserStatisticAction.LIKES_MADE_BY_USER, information.getCurrentPageLanding()); - String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png"; if(isRoot || isProfilePage) activityDone.setComments( - urlCommentsIcon, formattedNumbers(postsBean.getCommentsMade()), TOOLTIP_REPLIES_DONE, TOOLTIP_REPLIES_DONE + " (" + postsBean.getCommentsMade() + ")", @@ -509,7 +500,6 @@ public class StatisticsPanel extends Composite { information.getCurrentPageLanding()); else activityDone.setComments( - urlCommentsIcon, formattedNumbers(postsBean.getCommentsMade()), TOOLTIP_REPLIES_DONE_VRE, TOOLTIP_REPLIES_DONE_VRE +" (" + postsBean.getCommentsMade() + ")", @@ -527,7 +517,6 @@ public class StatisticsPanel extends Composite { if(isRoot || isProfilePage) activityGot.setLikes( - urlLikesIcon, formattedNumbers(postsBean.getLikesReceived()), TOOLTIP_LIKES_GOT, TOOLTIP_LIKES_GOT+ " (" + postsBean.getLikesReceived() + ")", @@ -535,7 +524,6 @@ public class StatisticsPanel extends Composite { information.getCurrentPageLanding()); else activityGot.setLikes( - urlLikesIcon, formattedNumbers(postsBean.getLikesReceived()), TOOLTIP_LIKES_GOT_VRE, TOOLTIP_LIKES_GOT_VRE + " (" + postsBean.getLikesReceived() + ")", @@ -546,7 +534,6 @@ public class StatisticsPanel extends Composite { if(isRoot || isProfilePage) activityGot.setComments( - urlCommentsIcon, formattedNumbers(postsBean.getCommentsReceived()), TOOLTIP_REPLIES_GOT, TOOLTIP_REPLIES_GOT + " (" + postsBean.getCommentsReceived() + ")", @@ -554,7 +541,6 @@ public class StatisticsPanel extends Composite { information.getCurrentPageLanding()); else activityGot.setComments( - urlCommentsIcon, formattedNumbers(postsBean.getCommentsReceived()), TOOLTIP_REPLIES_GOT_VRE, TOOLTIP_REPLIES_GOT_VRE + " (" + postsBean.getCommentsReceived() + ")", @@ -653,11 +639,9 @@ public class StatisticsPanel extends Composite { GWT.log("Increment number of post message received"); numberOfWrittenFeeds ++; - String urlPostsIcon = GWT.getModuleBaseURL() + "../images/share-blue.png"; if(isRoot) activityDone.setPosts( - urlPostsIcon, formattedNumbers(numberOfWrittenFeeds), TOOLTIP_POSTS_DONE, TOOLTIP_POSTS_DONE + " (" + numberOfWrittenFeeds + ")", @@ -665,7 +649,6 @@ public class StatisticsPanel extends Composite { informationBeanRetrieved.getCurrentPageLanding()); else activityDone.setPosts( - urlPostsIcon, formattedNumbers(numberOfWrittenFeeds), TOOLTIP_POSTS_DONE, TOOLTIP_POSTS_DONE_VRE + " (" + numberOfWrittenFeeds + ")", @@ -696,11 +679,9 @@ public class StatisticsPanel extends Composite { // they can't be less than zero... numberOfWrittenFeeds --; numberOfWrittenFeeds = numberOfWrittenFeeds < 0 ? 0: numberOfWrittenFeeds; - String urlPostsIcon = GWT.getModuleBaseURL() + "../images/share-blue.png"; if(isRoot) activityDone.setPosts( - urlPostsIcon, formattedNumbers(numberOfWrittenFeeds), TOOLTIP_POSTS_DONE, TOOLTIP_POSTS_DONE + " (" + numberOfWrittenFeeds + ")", @@ -708,7 +689,6 @@ public class StatisticsPanel extends Composite { informationBeanRetrieved.getCurrentPageLanding()); else activityDone.setPosts( - urlPostsIcon, formattedNumbers(numberOfWrittenFeeds), TOOLTIP_POSTS_DONE, TOOLTIP_POSTS_DONE_VRE + " (" + numberOfWrittenFeeds + ")", @@ -737,11 +717,9 @@ public class StatisticsPanel extends Composite { GWT.log("Increment number of likes received"); numberOfLikesGot ++; - String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png"; if(isRoot) activityGot.setLikes( - urlLikesIcon, formattedNumbers(numberOfLikesGot), TOOLTIP_LIKES_GOT, TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")", @@ -749,7 +727,6 @@ public class StatisticsPanel extends Composite { informationBeanRetrieved.getCurrentPageLanding()); else activityGot.setLikes( - urlLikesIcon, formattedNumbers(numberOfLikesGot), TOOLTIP_LIKES_GOT_VRE, TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")", @@ -781,11 +758,9 @@ public class StatisticsPanel extends Composite { // they can't be less than zero... numberOfLikesGot --; numberOfLikesGot = numberOfLikesGot < 0 ? 0: numberOfLikesGot; - String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png"; if(isRoot) activityGot.setLikes( - urlLikesIcon, formattedNumbers(numberOfLikesGot), TOOLTIP_LIKES_GOT, TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")", @@ -793,7 +768,6 @@ public class StatisticsPanel extends Composite { informationBeanRetrieved.getCurrentPageLanding()); else activityGot.setLikes( - urlLikesIcon, formattedNumbers(numberOfLikesGot), TOOLTIP_LIKES_GOT_VRE, TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")", @@ -824,19 +798,16 @@ public class StatisticsPanel extends Composite { numberOfCommentsGot ++; - String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png"; if(isRoot) activityGot.setComments( - urlCommentsIcon, formattedNumbers(numberOfCommentsGot), TOOLTIP_REPLIES_GOT, TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")", ShowUserStatisticAction.COMMENTS_GOT_BY_USER, informationBeanRetrieved.getCurrentPageLanding()); else - activityGot.setComments( - urlCommentsIcon, + activityGot.setComments( formattedNumbers(numberOfCommentsGot), TOOLTIP_REPLIES_GOT_VRE, TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")", @@ -868,10 +839,8 @@ public class StatisticsPanel extends Composite { // they can't be less than zero... numberOfCommentsGot --; numberOfCommentsGot = numberOfCommentsGot < 0 ? 0: numberOfCommentsGot; - String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png"; if(isRoot) activityGot.setComments( - urlCommentsIcon, formattedNumbers(numberOfCommentsGot), TOOLTIP_REPLIES_GOT, TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")", @@ -879,7 +848,6 @@ public class StatisticsPanel extends Composite { informationBeanRetrieved.getCurrentPageLanding()); else activityGot.setComments( - urlCommentsIcon, formattedNumbers(numberOfCommentsGot), TOOLTIP_REPLIES_GOT_VRE, TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")", diff --git a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.java b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.java index adc1f50..ff19942 100644 --- a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.java +++ b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.java @@ -3,6 +3,7 @@ package org.gcube.portlet.user.userstatisticsportlet.client.ui; import org.gcube.portal.databook.shared.ShowUserStatisticAction; import org.gcube.portlet.user.userstatisticsportlet.client.events.ShowFeedsRelatedToUserStatisticsEvent; +import com.github.gwtbootstrap.client.ui.Button; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Style.Cursor; import com.google.gwt.event.dom.client.ClickEvent; @@ -11,7 +12,6 @@ import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; @@ -25,13 +25,13 @@ public class ActivityWidget extends Composite { } @UiField - Image likesImage; + Button likesButton; @UiField - Image commentsImage; + Button commentsButton; @UiField - Image postsImage; + Button postsButton; @UiField Label likesValue; @@ -46,21 +46,24 @@ public class ActivityWidget extends Composite { public ActivityWidget() { initWidget(uiBinder.createAndBindUi(this)); + + // set styles + commentsButton.addStyleName("buttons-statistics-style"); + likesButton.addStyleName("buttons-statistics-style"); + postsButton.addStyleName("buttons-statistics-style"); } /** * Set comments information - * @param url * @param value * @param tipIcon * @param tipValue * @param actionToTakeOnClick * @param landingPage */ - public void setComments(String url, String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){ + public void setComments(String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){ - commentsImage.setUrl(url); - commentsImage.setTitle(tipIcon); + commentsButton.setTitle(tipIcon); commentsValue.setText(value); commentsValue.setTitle(tipValue); @@ -82,22 +85,20 @@ public class ActivityWidget extends Composite { // set to visible commentsValue.setVisible(true); - commentsImage.setVisible(true); + commentsButton.setVisible(true); } /** * Set likes information - * @param url * @param value * @param tipIcon * @param tipValue * @param actionToTakeOnClick * @param landingPage */ - public void setLikes(String url, String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){ + public void setLikes(String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){ - likesImage.setUrl(url); - likesImage.setTitle(tipIcon); + likesButton.setTitle(tipIcon); likesValue.setText(value); likesValue.setTitle(tipValue); @@ -119,22 +120,20 @@ public class ActivityWidget extends Composite { // set to visible likesValue.setVisible(true); - likesImage.setVisible(true); + likesButton.setVisible(true); } /** * Set posts information - * @param url * @param value * @param tipIcon * @param tipValue * @param actionToTakeOnClick * @param landingPage */ - public void setPosts(String url, String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){ + public void setPosts(String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){ - postsImage.setUrl(url); - postsImage.setTitle(tipIcon); + postsButton.setTitle(tipIcon); postsValue.setText(value); postsValue.setTitle(tipValue); @@ -156,7 +155,7 @@ public class ActivityWidget extends Composite { // set to visible postsValue.setVisible(true); - postsImage.setVisible(true); + postsButton.setVisible(true); } /** diff --git a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.ui.xml b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.ui.xml index ffdd2ef..70ebdce 100644 --- a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.ui.xml +++ b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/client/ui/ActivityWidget.ui.xml @@ -1,12 +1,7 @@ + xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"> - .statistic-icon { - display: inline-block; - vertical-align: text-bottom; - } - .statistic-value { color: #0084B4 !important; font-size: 14px; @@ -15,16 +10,13 @@ } - + - + - + diff --git a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/server/ServerUtils.java b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/server/ServerUtils.java index a58055f..0ed8e27 100644 --- a/src/main/java/org/gcube/portlet/user/userstatisticsportlet/server/ServerUtils.java +++ b/src/main/java/org/gcube/portlet/user/userstatisticsportlet/server/ServerUtils.java @@ -61,7 +61,7 @@ public class ServerUtils { */ public static String getDevelopmentUser() { String user = UserStatisticsServiceImpl.defaultUserId; - // user = "costantino.perciante"; + // user = "costantino.perciante"; return user; } diff --git a/src/main/webapp/Statistics.css b/src/main/webapp/Statistics.css index c9c0701..f980056 100644 --- a/src/main/webapp/Statistics.css +++ b/src/main/webapp/Statistics.css @@ -75,4 +75,9 @@ .improve-profile-hint-message { margin-top: 15px !important; padding: 25px !important; +} + +.buttons-statistics-style { + pointer-events: none; + padding: 2px 3px !important; } \ No newline at end of file diff --git a/src/main/webapp/images/comment_edit.png b/src/main/webapp/images/comment_edit.png deleted file mode 100644 index d31e68a..0000000 Binary files a/src/main/webapp/images/comment_edit.png and /dev/null differ diff --git a/src/main/webapp/images/share-blue.png b/src/main/webapp/images/share-blue.png deleted file mode 100644 index e7f0bb9..0000000 Binary files a/src/main/webapp/images/share-blue.png and /dev/null differ diff --git a/src/main/webapp/images/star_blue.png b/src/main/webapp/images/star_blue.png deleted file mode 100644 index e475c89..0000000 Binary files a/src/main/webapp/images/star_blue.png and /dev/null differ