icons for posts, likes and comments changed (bootstrap's ones are now used)
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@131824 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
963694852d
commit
80861705d0
|
@ -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 + ")",
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
<!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">
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:style>
|
||||
.statistic-icon {
|
||||
display: inline-block;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.statistic-value {
|
||||
color: #0084B4 !important;
|
||||
font-size: 14px;
|
||||
|
@ -15,16 +10,13 @@
|
|||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<g:Image styleName="{style.statistic-icon}" ui:field="postsImage"
|
||||
visible="false"></g:Image>
|
||||
<b:Button ui:field="postsButton" icon="SHARE_ALT" type="LINK" visible="false"></b:Button>
|
||||
<g:Label styleName="{style.statistic-value}" ui:field="postsValue"
|
||||
visible="false"></g:Label>
|
||||
<g:Image styleName="{style.statistic-icon}" ui:field="likesImage"
|
||||
visible="false"></g:Image>
|
||||
<b:Button ui:field="likesButton" icon="THUMBS_UP_ALT" type="LINK" visible="false"></b:Button>
|
||||
<g:Label styleName="{style.statistic-value}" ui:field="likesValue"
|
||||
visible="false"></g:Label>
|
||||
<g:Image styleName="{style.statistic-icon}" ui:field="commentsImage"
|
||||
visible="false"></g:Image>
|
||||
<b:Button ui:field="commentsButton" icon="COMMENTS" type="LINK" visible="false"></b:Button>
|
||||
<g:Label styleName="{style.statistic-value}" ui:field="commentsValue"
|
||||
visible="false"></g:Label>
|
||||
</g:HTMLPanel>
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ServerUtils {
|
|||
*/
|
||||
public static String getDevelopmentUser() {
|
||||
String user = UserStatisticsServiceImpl.defaultUserId;
|
||||
// user = "costantino.perciante";
|
||||
// user = "costantino.perciante";
|
||||
return user;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Loading…
Reference in New Issue