← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1473: Work in progress on embedded help function. Added div in main template for help contents.

 

------------------------------------------------------------
revno: 1473
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-02-23 19:58:09 +0100
message:
  Work in progress on embedded help function. Added div in main template for help contents.
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/hide.png
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/help/action/GetHelpContentAction.java


--
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-resources/src/main/webapp/dhis-web-commons/css/widgets.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2009-09-10 13:17:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2010-02-23 18:58:09 +0000
@@ -1,5 +1,51 @@
 
 /*----------------------------------------------------------------------------*/
+/* Right bar                                                                  */
+/*----------------------------------------------------------------------------*/
+
+div#rightBar
+{
+  display:none;
+  background-color: #baffbc;
+  height: 454px;
+  width: 300px;
+  float: right;
+  position: absolute;
+  top: 85px;
+  right: 10px;
+  border: 1px solid #12cd17;
+  padding-left: 15px;
+  padding-right: 15px;
+  padding-top: 9px;
+  padding-bottom: 9px;
+}
+
+#hideRightBar
+{
+  position: relative;
+  left: 0px;
+  top: 0px;
+}
+
+#rightBar h3 
+{
+  margin-top: 6px;
+  font-size: 11pt;
+  color: #606060;
+}
+
+#rightBar p
+{
+  font-size: 9pt;
+}
+
+#rightBar ul,ol
+{
+  font-size: 9pt;
+  padding-left: 14px;
+}
+
+/*----------------------------------------------------------------------------*/
 /* Thingy                                                                     */
 /*----------------------------------------------------------------------------*/
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js	2010-02-19 19:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js	2010-02-23 18:58:09 +0000
@@ -13,6 +13,32 @@
 }
 
 /**
+ * Gets help content for the given id. Opens the right bar and puts the content
+ * inside. Reads data from an underlying docbook file.
+ * 
+ * @param id the content id, refers to the section id in the docbook file.
+ */
+function getHelpContent( id )
+{
+    $.get( 
+       '../dhis-web-commons-help/getHelpContent.action',
+       { "id": id },
+       function( data )
+       {
+           $( "div#rightBar" ).fadeIn();
+           $( "div#rightBarContents" ).html( data );
+       } );
+}
+
+/**
+ * Hides the help content.
+ */
+function hideHelpContent()
+{
+	$( "div#rightBar" ).fadeOut();
+}
+
+/**
  * Filters values in a html table with tbody id "list".
  * 
  * @param filter the filter.

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/hide.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/hide.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/hide.png	2010-02-23 18:58:09 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2010-02-15 15:01:24 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2010-02-23 18:58:09 +0000
@@ -10,8 +10,8 @@
         
     #foreach ( $style in $stylesheets )
       <link type="text/css" rel="stylesheet" href="$style">
-	#end
-	
+    #end
+    
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         
     <script type="text/javascript" src="../dhis-web-commons/util/jquery.js"></script>
@@ -75,40 +75,40 @@
       </div>
       
       <div id="menuDropDown3" class="menuDropDownArea" onmouseover="cancelHideDropDownTimeout()" onmouseout="hideDropDownTimeout()">
-      	<ul class="menuDropDownBox">
+        <ul class="menuDropDownBox">
           <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/help.action'">$i18n.getString( "help_contents" )&nbsp;</li>
-      	  <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/displayFeedbackForm.action'">$i18n.getString( "feedback" )&nbsp;</li>
-      	  <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/displayChangeLog.action'">$i18n.getString( "change_log" )&nbsp;</li>
+          <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/displayFeedbackForm.action'">$i18n.getString( "feedback" )&nbsp;</li>
+          <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/displayChangeLog.action'">$i18n.getString( "change_log" )&nbsp;</li>
           <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/showUpdateUserAccountForm.action'">$i18n.getString( "user_account" )&nbsp;</li>
           <li class="menuDropDownItem" onclick="window.location.href='../dhis-web-commons-about/about.action'">$i18n.getString( "about_dhis2" )&nbsp;</li>
-	    </ul>
-	  </div>
+        </ul>
+      </div>
 
       <span id="headerText">
-      	#if ( $applicationTitle )
-      	  $applicationTitle
-	    #else
-      	  District Health Information Software 2
-      	#end
+        #if ( $applicationTitle )
+          $applicationTitle
+        #else
+          District Health Information Software 2
+        #end
       </span>
       
       <span id="showLeftBar">
-      	<a href="javascript:leftBar.showAnimated()" title="$i18n.getString( "show_menu" )">
-      	  <img src="../images/show_menu.png" width="16" height="16" alt="$i18n.getString( "show_menu" )"></a>
+        <a href="javascript:leftBar.showAnimated()" title="$i18n.getString( "show_menu" )">
+          <img src="../images/show_menu.png" width="16" height="16" alt="$i18n.getString( "show_menu" )"></a>
       </span>
     </div>
 
-	<div id="leftBar">    
+    <div id="leftBar">    
       <span id="hideLeftBar">
         <a href="javascript:leftBar.hideAnimated()" title="$i18n.getString( "hide_menu" )">
           <img src="../images/hide_menu.png" width="16" height="16" alt="$i18n.getString( "hide_menu" )"></a>
       </span>
       
-	  <div id="leftBarContents">
-	    #parse( $menu )
-	  </div>	  
-	</div>
-	
+      <div id="leftBarContents">
+        #parse( $menu )
+      </div>      
+    </div>
+        
     <div class="page" id="mainPage">
       #if( !$page )
         <p>$i18n.getString( "no_page_specified" )</p>
@@ -122,5 +122,10 @@
       </script>
     #end
     
+    <div id="rightBar">
+      <span id="hideRightBar"><a href="#" onclick="hideHelpContent()"><img src="../images/hide.png" onclick=""></a></span>
+      <div id="rightBarContents"/>
+    </div>
+    
   </body>
 </html>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/help/action/GetHelpContentAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/help/action/GetHelpContentAction.java	2010-02-23 17:10:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/help/action/GetHelpContentAction.java	2010-02-23 18:58:09 +0000
@@ -31,6 +31,8 @@
 
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.options.help.HelpManager;
 import org.hisp.dhis.util.StreamActionSupport;
 
@@ -40,6 +42,8 @@
 public class GetHelpContentAction
     extends StreamActionSupport
 {
+    private static final Log log = LogFactory.getLog( GetHelpContentAction.class );
+    
     private HelpManager helpManager;
     
     public void setHelpManager( HelpManager helpManager )
@@ -58,6 +62,8 @@
     protected String execute( HttpServletResponse response, OutputStream out )
         throws Exception
     {
+        log.info( "Searching help content for id: " + id );
+        
         helpManager.getHelpContent( out, id );
         
         return SUCCESS;