fixed link to explore VREs when user has no VREs yet
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@130655 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b2ab8caf97
commit
781d933483
|
@ -18,4 +18,6 @@ public interface MyVREsService extends RemoteService {
|
|||
void loadLayout(String scope, String URL);
|
||||
|
||||
String showMoreVREs();
|
||||
|
||||
String getSiteLandingPagePath();
|
||||
}
|
||||
|
|
|
@ -17,4 +17,6 @@ public interface MyVREsServiceAsync {
|
|||
|
||||
void showMoreVREs(AsyncCallback<String> callback);
|
||||
|
||||
void getSiteLandingPagePath(AsyncCallback<String> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@ package org.gcube.portlet.user.my_vres.client;
|
|||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
|
@ -10,14 +13,26 @@ public class NoVresPanel extends Composite {
|
|||
private static NoVresPanelUiBinder uiBinder = GWT
|
||||
.create(NoVresPanelUiBinder.class);
|
||||
|
||||
private final MyVREsServiceAsync myVREsService = GWT.create(MyVREsService.class);
|
||||
|
||||
interface NoVresPanelUiBinder extends UiBinder<Widget, NoVresPanel> {
|
||||
}
|
||||
|
||||
@UiField Anchor joinLink;
|
||||
@UiField Anchor availableLink;
|
||||
public NoVresPanel() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
myVREsService.getSiteLandingPagePath(new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
joinLink.setHref(result);
|
||||
availableLink.setHref(result);
|
||||
}
|
||||
|
||||
public NoVresPanel(String firstName) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<div class="NoVresStyle">
|
||||
You are not subscribed to any environment,
|
||||
please begin by
|
||||
<a class="vrelink" href="/explore"><span class="important">joining</span></a> one. <br /><br />
|
||||
<a class="vrelink" href="/explore"><span class="important">Explore</span></a> the research environments available in the infrastructure.
|
||||
<g:Anchor ui:field="joinLink" styleName="vrelink"><span class="important">joining</span></g:Anchor> one.<br /><br />
|
||||
<g:Anchor ui:field="availableLink" styleName="vrelink"><span class="important">Explore</span></g:Anchor> the Virtual Research Environments available in the infrastructure.
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -57,6 +57,13 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
|||
public String showMoreVREs() {
|
||||
return PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest());
|
||||
}
|
||||
@Override
|
||||
public String getSiteLandingPagePath() {
|
||||
String user = getASLSession().getUsername();
|
||||
_log.debug("user=" + user + " has no VREs");
|
||||
String toReturn = PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest())+GCubePortalConstants.VRES_EXPLORE_FRIENDLY_URL;
|
||||
return toReturn;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return true if you're running into the portal, false if in development
|
||||
|
@ -236,4 +243,5 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
|||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -33,8 +33,6 @@ a.vrelink:hover {
|
|||
|
||||
.NoVresStyle {
|
||||
line-height: 25px;
|
||||
font-family: 'Architects Daughter', Arial, Verdana, sans-serif;
|
||||
font-size: 15px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue