=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java 2013-10-10 09:56:49 +0000
@@ -48,7 +48,7 @@
@Controller
public class MobileController
{
- @RequestMapping(value = "/mobile")
+ @RequestMapping( value = "/mobile" )
public String base()
{
return "redirect:/mobile/index";
@@ -60,7 +60,7 @@
return "redirect:/mobile/index";
}
- @RequestMapping( value = "/index" )
+ @RequestMapping(value = "/index")
public String index( Model model, HttpServletRequest request )
{
populateContextPath( model, request );
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2013-07-02 04:15:25 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2013-10-10 09:56:49 +0000
@@ -26,7 +26,7 @@
function getDashboard() {
return $.ajax({
- url: '$contextPath/api/currentUser/dashboard',
+ url: '$contextPath/api/me/dashboard',
dataType: 'json'
}).success(function(data) {
if( data.unreadMessageConversation > 0 ) {
@@ -35,13 +35,38 @@
});
}
+ function getApps() {
+ return $.ajax({
+ url: '$contextPath/api/apps',
+ dataType: 'json'
+ }).success(function(data) {
+ var tmpl = $('#app-template').html();
+
+ $.each(data, function(idx) {
+ var html = _.template(tmpl, {
+ 'idx': idx,
+ 'name': this.name,
+ 'launchUrl': this.launchUrl
+ });
+
+ if( $('#app-' + idx).length === 0 ) {
+ $('#user-account').after(html);
+ } else {
+ $('#app-' + idx).html(html);
+ }
+
+ $('#listview').listview('refresh');
+ });
+ });
+ }
+
$(document).bind('pagechange',function(){
$.mobile.loading( 'show' );
getDashboard().always(function() {
$('section[data-role="content"] ul').listview('refresh');
- $.when( fm.getMetaData(), fm.uploadDataValueSets()).always(function() {
+ $.when( getApps(), fm.getMetaData(), fm.uploadDataValueSets()).always(function() {
updateMenu();
renderOfflineStatus();
$.mobile.loading( 'hide' );
@@ -73,9 +98,11 @@
if( onlineStatus ) {
$( '#messages').removeClass('ui-disabled');
$( '#user-account').removeClass('ui-disabled');
+ $( '.app').removeClass('ui-disabled');
} else {
$( '#messages').addClass('ui-disabled');
$( '#user-account').addClass('ui-disabled');
+ $( '.app').addClass('ui-disabled');
}
}
@@ -122,6 +149,10 @@
<% } %>
+
+