← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13071: edit/remove actions for interpretations, wip

 

------------------------------------------------------------
revno: 13071
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-11-29 15:20:31 +0100
message:
  edit/remove actions for interpretations, wip
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.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-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2013-11-29 13:41:44 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2013-11-29 14:20:31 +0000
@@ -10,21 +10,108 @@
 #end
 #end
 
+<script>
+jQuery(function() {
+  var gearDropDown = jQuery('.gearDropDown');
+  var dropDown = jQuery('.dropDown');
+
+  gearDropDown.on('click', function( e ) {
+    dropDown.show();
+    dropDown.css({left: e.pageX, top: e.pageY});
+
+    dropDown.offset({
+      'top': gearDropDown.offset().top + 24,
+      'left': gearDropDown.offset().left - 35
+    });
+
+    return false;
+  });
+
+  $(document).on('touchend click', function() {
+    if( dropDown.is(":visible") ) {
+      dropDown.hide();
+    }
+  });
+});
+</script>
+
+<style>
+.gearDropDown {
+  background-color           : #f7f7f7;
+  float: right;
+  border: 1px solid #eaeaea;
+  padding: 4px 10px;
+  cursor: pointer;
+}
+
+.dropDown {
+  position                   : absolute;
+  display                    : none;
+  font-size                  : 9pt;
+  color                      : #000;
+  border                     : 1px solid #ddd;
+  padding-left               : 2px;
+  padding-right              : 2px;
+  width                      : 70px;
+  max-height                 : 610px;
+  overflow-y                 : auto;
+  background-color           : #f7f7f7;
+  z-index                    : 10;
+  border-bottom-left-radius  : 3px;
+  border-bottom-right-radius : 3px;
+  box-shadow                 : #ccc 0px 1px 1px 0px;
+}
+
+.dropDown > ul > li {
+  list-style-type : none;
+  padding         : 100;
+  margin          : 5px 0;
+}
+
+.dropDown > ul > li > a {
+  display       : block;
+  padding       : 5px 5px;
+  color         : #000;
+  border-radius : 3px;
+  cursor        : pointer;
+}
+
+.dropDown > ul > li > a:hover {
+  text-decoration  : none;
+  background-color : #eee;
+}
+
+</style>
+
+#macro( gearDropDown )
+<div class="gearDropDown">
+  <span><i class="fa fa-gear"></i> <i class="fa fa-caret-down"></i></span>
+</div>
+#end
+
+<div class="dropDown">
+  <ul>
+    <li><a>Edit</a></li>
+    <li><a>Delete</a></li>
+  </ul>
+</div>
+
 #set( $maxComments = 4 )
 #foreach( $ip in $interpretations )
 <div class="interpretationContainer">
     #if( $ip.organisationUnit )#set( $ou = "&ou=" + $ip.organisationUnit.uid )#else#set( $ou = "" )#end
     #if( $ip.period )#set( $pe = "&pe=" + $ip.period.isoDate )#else#set( $pe = "" )#end
-    
+
     <div class="interpretation">
 	    <div class="interpretationName">
 	    	<div class="interpretationSymbol">
 	    	  #getSymbol( $ip )
 	    	</div>
 	    	<div class="interpretationUser">
-	           <a class="bold userLink" href="profile.action?id=${ip.user.uid}">${encoder.htmlEncode( $ip.user.name )}</a><br>
-	           <span class="tipText">${format.formatDate( $ip.created )}</span>
-	        </div>
+           <a class="bold userLink" href="profile.action?id=${ip.user.uid}">${encoder.htmlEncode( $ip.user.name )}</a><br>
+           <span class="tipText">${format.formatDate( $ip.created )}</span>
+        </div>
+        #gearDropDown()
 	    </div>
 	    <div class="interpretationText">
 	        $!dhisTextUtils.htmlify( ${ip.text} )
@@ -32,7 +119,7 @@
 	    <div class="interpretationItem">
 	    #if( $ip.chartInterpretation )
 	        <a href="../dhis-web-visualizer/app/index.html?id=${ip.chart.uid}&date=${format.formatDate( $ip.created )}">
-	        <img style="cursor:pointer" 
+	        <img style="cursor:pointer"
 	            src="../api/charts/${ip.chart.uid}/data?date=${format.formatDate( $ip.created )}&width=558&height=300${ou}"
 	            title="$i18n.getString( 'click_to_view_in_data_visualizer' )"></a>
 	    #elseif( $ip.mapInterpretation )
@@ -40,9 +127,9 @@
 	        <img style="cursor:pointer"
 	            src="../api/maps/${ip.map.uid}/data?date=${format.formatDate( $ip.created )}&width=558"
 	            title="$i18n.getString( 'click_to_view_in_gis' )"></a>
-	    #elseif( $ip.reportTableInterpretation )	        
+	    #elseif( $ip.reportTableInterpretation )
 	        <a class="bold"
-	           title="$i18n.getString( 'click_to_view_report_table' )" 
+	           title="$i18n.getString( 'click_to_view_report_table' )"
 	           href="../dhis-web-pivot/app/index.html?id=${ip.reportTable.uid}${pe}${ou}">
 	           $encoder.htmlEncode( $ip.reportTable.name )</a>
 	    #elseif( $ip.dataSetReportInterpretation )
@@ -52,12 +139,12 @@
 	           $encoder.htmlEncode( $ip.dataSet.name )</a>
 	    #end
 	    </div>
-	    
+
 	    #set( $comments = $ip.comments )
 	    #set( $commentStartPos = ( $comments.size() - $maxComments ) )
-	    <div class="interpretationCommentArea">	        
+	    <div class="interpretationCommentArea">
 	        #if( $comments.size() > $maxComments )
-	        <div id="commentHeader${ip.uid}" class="interpretationCommentHeader"><a href="javascript:expandComments( '${ip.uid}' )">View all $comments.size() comments</a></div>	        	
+	        <div id="commentHeader${ip.uid}" class="interpretationCommentHeader"><a href="javascript:expandComments( '${ip.uid}' )">View all $comments.size() comments</a></div>
         	#end
         	<div id="comments${ip.uid}">
 	        #foreach( $comment in $comments )