dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24242
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11845: redirect to mobile login for tablets
------------------------------------------------------------
revno: 11845
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-08-30 12:36:36 +0200
message:
redirect to mobile login for tablets
modified:
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/MappedRedirectStrategy.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/MappedRedirectStrategy.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/MappedRedirectStrategy.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/MappedRedirectStrategy.java 2013-08-30 10:36:36 +0000
@@ -90,17 +90,17 @@
}
String mobileVersion = (String) request.getAttribute( "mobileVersion" );
- mobileVersion = mobileVersion == null ? "basic" : mobileVersion;
+ mobileVersion = mobileVersion == null ? "desktop" : mobileVersion;
- if ( device.isMobile() && mobileVersion.equals( "basic" ) )
+ if ( mobileVersion.equals( "basic" ) )
{
url = getRootPath( request ) + "/light/index.action";
}
- else if ( device.isMobile() && mobileVersion.equals( "smartphone" ) )
+ else if ( mobileVersion.equals( "smartphone" ) )
{
url = getRootPath( request ) + "/mobile";
}
- else if ( device.isMobile() && mobileVersion.equals( "desktop" ) )
+ else if ( mobileVersion.equals( "desktop" ) )
{
url = getRootPath( request ) + "/";
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java 2013-08-30 10:36:36 +0000
@@ -28,17 +28,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
+import com.opensymphony.xwork2.Action;
import org.apache.struts2.ServletActionContext;
import org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mobile.device.Device;
import org.springframework.mobile.device.DeviceResolver;
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
/**
* @author mortenoh
@@ -56,7 +55,7 @@
{
this.deviceResolver = deviceResolver;
}
-
+
@Autowired
private ResourceBundleManager resourceBundleManager;
@@ -75,7 +74,7 @@
{
return failed;
}
-
+
private List<Locale> availableLocales;
public List<Locale> getAvailableLocales()
@@ -95,13 +94,13 @@
ServletActionContext.getResponse().addHeader( "Login-Page", "true" );
- if ( device.isMobile() )
+ if ( device.isMobile() || device.isTablet() )
{
return "mobile";
}
availableLocales = new ArrayList<Locale>( resourceBundleManager.getAvailableLocales() );
-
+
return "standard";
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm 2013-02-03 08:35:03 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm 2013-08-30 10:36:36 +0000
@@ -4,7 +4,7 @@
$.mobile.loading( 'show' );
$.ajax({
- url: '$contextPath/api/currentUser/user-account',
+ url: '$contextPath/api/currentUser/profile',
dataType: 'json'
}).success(function(data) {
// user account
@@ -44,7 +44,7 @@
$.mobile.loading( 'show' );
$.ajax({
- url: '$contextPath/api/currentUser/user-account',
+ url: '$contextPath/api/currentUser/profile',
contentType: 'application/json',
data: JSON.stringify( settings ),
type: 'POST'