Increment of posts, likes and comment replies automatically done

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@122608 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-01-28 15:52:50 +00:00
parent 360cba5e16
commit e77e3560dd
4 changed files with 13 additions and 6 deletions

View File

@ -483,7 +483,9 @@ public class StatisticsPanel extends Composite {
if(event.getSubject().equals(this.getName())){ if(event.getSubject().equals(this.getName())){
GWT.log("Decrement number of post message received"); GWT.log("Decrement number of post message received");
// they can't be less than zero...
numberOfWrittenFeeds --; numberOfWrittenFeeds --;
numberOfWrittenFeeds = numberOfWrittenFeeds < 0 ? 0: numberOfWrittenFeeds;
numberOfFeedsLabel.setText(formattedNumbers(numberOfWrittenFeeds)); numberOfFeedsLabel.setText(formattedNumbers(numberOfWrittenFeeds));
if(isRoot) if(isRoot)
numberOfFeedsLabel.setTitle("Your posts during the last year (" + numberOfWrittenFeeds + ")."); numberOfFeedsLabel.setTitle("Your posts during the last year (" + numberOfWrittenFeeds + ").");
@ -550,8 +552,9 @@ public class StatisticsPanel extends Composite {
GWT.log("Decrement number of likes received"); GWT.log("Decrement number of likes received");
// they can't be less than zero...
numberOfLikesGot --; numberOfLikesGot --;
numberOfLikesGot = numberOfLikesGot < 0 ? 0: numberOfLikesGot;
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png"; String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
if(isRoot) if(isRoot)
@ -628,8 +631,9 @@ public class StatisticsPanel extends Composite {
GWT.log("Decrement number of comments received"); GWT.log("Decrement number of comments received");
// they can't be less than zero...
numberOfCommentsGot --; numberOfCommentsGot --;
numberOfCommentsGot = numberOfCommentsGot < 0 ? 0: numberOfCommentsGot;
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png"; String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
if(isRoot) if(isRoot)
content.setComments( content.setComments(

View File

@ -4,7 +4,9 @@
<ui:style> <ui:style>
.statistic-icon { .statistic-icon {
display: inline-block; display: inline-block;
vertical-align: bottom; vertical-align: text-bottom;
width: auto;
height: 19px;
} }
.statistic-value { .statistic-value {

View File

@ -5,6 +5,8 @@
.statistic-container { .statistic-container {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
height: 60px;
width: auto;
} }
.statistic-header { .statistic-header {
@ -20,9 +22,9 @@
text-align: center; text-align: center;
vertical-align: text-top; vertical-align: text-top;
} }
</ui:style> </ui:style>
<g:HTMLPanel styleName="{style.statistic-container}" ui:field="container"> <g:HTMLPanel styleName="{style.statistic-container}"
ui:field="container">
<g:Label styleName="{style.statistic-header}" ui:field="header" /> <g:Label styleName="{style.statistic-header}" ui:field="header" />
<g:FlowPanel ui:field="containerValues"> <g:FlowPanel ui:field="containerValues">
<!-- Content goes here --> <!-- Content goes here -->

View File

@ -11,7 +11,6 @@
} }
.user-image { .user-image {
align: left;
height: 70px; height: 70px;
width: auto; width: auto;
border-radius: 6px; border-radius: 6px;