From 713385b86acd402f0443d31b954c6b8fc2fc2837 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Thu, 18 May 2017 15:56:20 +0000 Subject: [PATCH] added possibilty to create category with no description git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@148856 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 2 +- .../joinvre/client/responsive/ResponsivePanel.java | 5 ++++- .../portlets/user/joinvre/client/ui/VreThumbnail.java | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.classpath b/.classpath index 1bb7917..6b52563 100644 --- a/.classpath +++ b/.classpath @@ -34,7 +34,7 @@ - + diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java b/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java index 860a683..34f82b8 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java @@ -41,7 +41,10 @@ public class ResponsivePanel extends Composite { GWT.log("cat: " + cat.getName()); PageHeader header = new PageHeader(); header.setText(cat.getName()); - header.setSubtext(cat.getDescription()); + if (cat.getDescription() == null || cat.getDescription().compareTo("") == 0 || cat.getDescription().compareTo("empty") == 0 ) + header.setSubtext(""); + else + header.setSubtext(cat.getDescription()); mainPanel.add(header); mainPanel.add(getVREThumbnails(categories, cat)); diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java index 83a9df6..717026b 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java @@ -29,7 +29,10 @@ public class VreThumbnail extends Composite { interface VreThumbnailUiBinder extends UiBinder { } private final JoinServiceAsync joinService = GWT.create(JoinService.class); - + private final static String PUBLIC_VRE_BUTTON_LABEL= "Access this VRE"; + private final static String PRIVATE_VRE_BUTTON_LABEL= "Private"; + private final static String RESTRICTED_VRE_BUTTON_LABEL= "Request Access"; + @UiField Heading vreName; @UiField Image vreImage; @UiField Button joinButton; @@ -47,7 +50,7 @@ public class VreThumbnail extends Composite { switch (vre.getMembershipType()) { case RESTRICTED: joinButton.setType(ButtonType.DEFAULT); - joinButton.setText("Request Access"); + joinButton.setText(RESTRICTED_VRE_BUTTON_LABEL); if (vre.getUserBelonging() == UserBelonging.PENDING) { joinButton.setText("Waiting approval"); joinButton.setType(ButtonType.WARNING); @@ -55,11 +58,11 @@ public class VreThumbnail extends Composite { } break; case OPEN: - joinButton.setText("Enter this VRE"); + joinButton.setText(PUBLIC_VRE_BUTTON_LABEL); break; default: joinButton.setEnabled(false); - joinButton.setText("Private"); + joinButton.setText(PRIVATE_VRE_BUTTON_LABEL); break; } if (vre.getUserBelonging() == UserBelonging.BELONGING) {