← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8302: minor fixes to mobile

 

------------------------------------------------------------
revno: 8302
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-09-29 10:50:36 +0700
message:
  minor fixes to mobile
removed:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/inbox.vm
added:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm
modified:
  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/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm
  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/settings.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-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	2012-09-28 09:09:02 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java	2012-09-29 03:50:36 +0000
@@ -27,10 +27,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.api.utils.ContextUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -50,24 +54,37 @@
     }
 
     @RequestMapping( value = "/index" )
-    public String index( Model model )
+    public String index( Model model, HttpServletRequest request )
     {
+        model.addAttribute( "baseUrl", ContextUtils.getRootPath( request ) );
         model.addAttribute( "page", "index.vm" );
 
         return "base";
     }
 
-    @RequestMapping( value = "/inbox" )
-    public String inbox( Model model )
-    {
-        model.addAttribute( "page", "inbox.vm" );
+    @RequestMapping( value = "/messages" )
+    public String messages( Model model, HttpServletRequest request )
+    {
+        model.addAttribute( "baseUrl", ContextUtils.getRootPath( request ) );
+        model.addAttribute( "page", "messages.vm" );
+
+        return "base";
+    }
+
+    @RequestMapping( value = "/messages/{uid}" )
+    public String message( @PathVariable( "uid" ) String uid, Model model, HttpServletRequest request )
+    {
+        model.addAttribute( "baseUrl", ContextUtils.getRootPath( request ) );
+        model.addAttribute( "page", "message.vm" );
+        model.addAttribute( "messageId", uid );
 
         return "base";
     }
 
     @RequestMapping( value = "/settings" )
-    public String settings( Model model )
+    public String settings( Model model, HttpServletRequest request )
     {
+        model.addAttribute( "baseUrl", ContextUtils.getRootPath( request ) );
         model.addAttribute( "page", "settings.vm" );
 
         return "base";

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm	2012-09-27 09:38:59 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm	2012-09-29 03:50:36 +0000
@@ -3,10 +3,10 @@
 <head>
 	<title>DHIS2</title>
 	<meta name="viewport" content="width=device-width, initial-scale=1">
-	<link rel="stylesheet" href="../dhis-web-mobile-resources/css/jquery.mobile.min.css?v=1.1.1" />
-    <script src="../dhis-web-commons/javascripts/jQuery/jquery.min.js?v=1.7.1"></script>
-    <script src="../dhis-web-mobile-resources/js/underscore.min.js?v=1.3.3"></script>
-    <script src="../dhis-web-mobile-resources/js/jquery.mobile.min.js?v=1.1.1"></script>
+	<link rel="stylesheet" href="$baseUrl/../dhis-web-mobile-resources/css/jquery.mobile.min.css?v=1.1.1" />
+    <script src="$baseUrl/../dhis-web-commons/javascripts/jQuery/jquery.min.js?v=1.7.1"></script>
+    <script src="$baseUrl/../dhis-web-mobile-resources/js/underscore.min.js?v=1.3.3"></script>
+    <script src="$baseUrl/../dhis-web-mobile-resources/js/jquery.mobile.min.js?v=1.1.1"></script>
 
     <script>
     $(document).bind('pageinit',function(){

=== removed file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/inbox.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/inbox.vm	2012-09-28 09:09:02 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/inbox.vm	1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
-<script>
-    $(document).bind('pagebeforecreate',function(){
-        $.ajax({
-            url: '../api/currentUser/inbox.json',
-            async: false
-        }).success(function(data) {
-        }).error(function() {
-        });
-    });
-</script>
-
-<section data-role="page" id="inboxPage" data-theme="c">
-
-	<header data-role="header" data-theme="b">
-		<div align="center"><img src="../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
-        <a href="index" data-icon="back">Back</a>
-	</header>
-
-	<section data-role="content">
-        <ul data-role="listview" data-inset="true">
-            <li data-role="list-divider">Messages</li>
-            <li><a href="index">Message #1</a></li>
-            <li><a href="index">Message #2</a></li>
-            <li><a href="index">Message #3</a></li>
-            <li><a href="index">Message #4</a></li>
-            <li data-role="list-divider">Interpretations</li>
-            <li><a href="index">Interpretation #1</a></li>
-            <li><a href="index">Interpretation #2</a></li>
-            <li><a href="index">Interpretation #3</a></li>
-        </ul>
-	</section>
-
-    <footer data-role="footer" data-theme="b">
-        <h1></h1>
-   	</footer>
-
-</section>

=== 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	2012-09-27 12:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm	2012-09-29 03:50:36 +0000
@@ -5,10 +5,11 @@
             url: '../api/currentUser/dashboard.json',
             async: false
         }).success(function(data) {
-            $('#inbox a').append("<span class='ui-li-count'>" +
-                    ( data.unreadMessageConversation + data.unreadInterpretations ) + "</span>")
+            $('#messages a').append("<span class='ui-li-count'>" + data.unreadMessageConversation + "</span>");
+            $('#interpretations a').append("<span class='ui-li-count'>" + data.unreadInterpretations + "</span>");
         }).error(function() {
-            $('#inbox a').append("<span class='ui-li-count'>Offline</span>")
+            $('#messages a').append("<span class='ui-li-count'>Offline</span>")
+            $('#interpretations a').append("<span class='ui-li-count'>Offline</span>")
         });
     });
 </script>
@@ -16,12 +17,13 @@
 <section data-role="page" id="mainPage" data-theme="c">
 
 	<header data-role="header" data-theme="b">
-		<div align="center"><img src="../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
+		<div align="center"><img src="$baseUrl/../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
 	</header>
 
 	<section data-role="content">
         <ul data-role="listview" data-inset="true">
-            <li id="inbox"><a href="inbox">Inbox</a></li>
+            <li id="messages"><a href="messages">Messages</a></li>
+            <li id="interpretations"><a href="interpretations">Interpretations</a></li>
             <li id="settings"><a href="settings">Settings</a></li>
         </ul>
 	</section>
@@ -357,4 +359,4 @@
    	</footer>
 
 </section>
--->
\ No newline at end of file
+-->

=== added file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm	2012-09-29 03:50:36 +0000
@@ -0,0 +1,17 @@
+
+<section data-role="page" id="messagePage" data-theme="c">
+
+	<header data-role="header" data-theme="b">
+		<div align="center"><img src="$baseUrl/../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
+        <a href="../messages" data-icon="back">Back</a>
+	</header>
+
+	<section data-role="content">
+        <h1>Reading message $messageId.</h1>
+	</section>
+
+    <footer data-role="footer" data-theme="b">
+        <h1></h1>
+   	</footer>
+
+</section>

=== added file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm	2012-09-29 03:50:36 +0000
@@ -0,0 +1,35 @@
+
+<script>
+    $(document).bind('pagebeforecreate',function(){
+        $.ajax({
+            url: '../api/currentUser/inbox.json',
+            async: false
+        }).success(function(data) {
+            console.log(data);
+
+            $.each(data.messageConversations, function(i, item) {
+                $('#messageList').append('<li><a href="messages/' + item.id + '">' + item.name + '</a></li>');
+            });
+        }).error(function() {
+        });
+    });
+</script>
+
+<section data-role="page" id="messagesPage" data-theme="c">
+
+	<header data-role="header" data-theme="b">
+		<div align="center"><img src="$baseUrl/../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
+        <a href="index" data-icon="back">Back</a>
+	</header>
+
+	<section data-role="content">
+        <ul id="messageList" data-role="listview" data-inset="true">
+            <li data-role="list-divider">Messages</li>
+        </ul>
+	</section>
+
+    <footer data-role="footer" data-theme="b">
+        <h1></h1>
+   	</footer>
+
+</section>

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.vm	2012-09-27 12:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/settings.vm	2012-09-29 03:50:36 +0000
@@ -40,7 +40,7 @@
 <section data-role="page" id="settingsPage" data-theme="c">
 
 	<header data-role="header" data-theme="b">
-		<div align="center"><img src="../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
+		<div align="center"><img src="$baseUrl/../dhis-web-commons/css/light_blue/logo_banner.png" /></div>
         <a href="index" data-icon="back">Back</a>
 	</header>