← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13098: moved some css around in dashboard module, allow superuser to edit/remove all interpretations

 

------------------------------------------------------------
revno: 13098
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-02 13:30:19 +0100
message:
  moved some css around in dashboard module, allow superuser to edit/remove all interpretations
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css
  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/javascript/interpretation.js


--
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/green/green.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2013-12-02 12:30:19 +0000
@@ -191,6 +191,65 @@
 }
 
 /*----------------------------------------------------------------------------*/
+/* DropDown Menu                                                              */
+/*----------------------------------------------------------------------------*/
+
+.gearDropDown {
+  background-color : #f7f7f7;
+  float            : right;
+  border           : 1px solid #eaeaea;
+  padding          : 4px 10px;
+  cursor           : pointer;
+  border-top-left-radius  : 3px;
+  border-top-right-radius : 3px;
+}
+
+.gearDropDown.active {
+  background-color : #ddd;
+}
+
+.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                    : 9;
+  border-bottom-left-radius  : 3px;
+  border-bottom-right-radius : 3px;
+  box-shadow                 : #ccc 0 1px 1px 0;
+}
+
+.dropDown > ul {
+  margin: 6px 0;
+}
+
+.dropDown > ul > li {
+  list-style-type : none;
+  padding         : 0;
+  margin          : 0;
+}
+
+.dropDown > ul > li > a {
+  display       : block;
+  padding       : 8px 5px;
+  color         : #000;
+  border-radius : 3px;
+  cursor        : pointer;
+}
+
+.dropDown > ul > li > a:hover {
+  text-decoration  : none;
+  background-color : #eee;
+}
+
+/*----------------------------------------------------------------------------*/
 /* Context Menu                                                               */
 /*----------------------------------------------------------------------------*/
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2013-12-02 12:30:19 +0000
@@ -191,6 +191,65 @@
 }
 
 /*----------------------------------------------------------------------------*/
+/* DropDown Menu                                                              */
+/*----------------------------------------------------------------------------*/
+
+.gearDropDown {
+  background-color : #f7f7f7;
+  float            : right;
+  border           : 1px solid #eaeaea;
+  padding          : 4px 10px;
+  cursor           : pointer;
+  border-top-left-radius  : 3px;
+  border-top-right-radius : 3px;
+}
+
+.gearDropDown.active {
+  background-color : #ddd;
+}
+
+.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                    : 9;
+  border-bottom-left-radius  : 3px;
+  border-bottom-right-radius : 3px;
+  box-shadow                 : #ccc 0 1px 1px 0;
+}
+
+.dropDown > ul {
+  margin: 6px 0;
+}
+
+.dropDown > ul > li {
+  list-style-type : none;
+  padding         : 0;
+  margin          : 0;
+}
+
+.dropDown > ul > li > a {
+  display       : block;
+  padding       : 8px 5px;
+  color         : #000;
+  border-radius : 3px;
+  cursor        : pointer;
+}
+
+.dropDown > ul > li > a:hover {
+  text-decoration  : none;
+  background-color : #eee;
+}
+
+/*----------------------------------------------------------------------------*/
 /* Context Menu                                                               */
 /*----------------------------------------------------------------------------*/
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2013-12-02 12:30:19 +0000
@@ -191,6 +191,65 @@
 }
 
 /*----------------------------------------------------------------------------*/
+/* DropDown Menu                                                              */
+/*----------------------------------------------------------------------------*/
+
+.gearDropDown {
+  background-color : #f7f7f7;
+  float            : right;
+  border           : 1px solid #eaeaea;
+  padding          : 4px 10px;
+  cursor           : pointer;
+  border-top-left-radius  : 3px;
+  border-top-right-radius : 3px;
+}
+
+.gearDropDown.active {
+  background-color : #ddd;
+}
+
+.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                    : 9;
+  border-bottom-left-radius  : 3px;
+  border-bottom-right-radius : 3px;
+  box-shadow                 : #ccc 0 1px 1px 0;
+}
+
+.dropDown > ul {
+  margin: 6px 0;
+}
+
+.dropDown > ul > li {
+  list-style-type : none;
+  padding         : 0;
+  margin          : 0;
+}
+
+.dropDown > ul > li > a {
+  display       : block;
+  padding       : 8px 5px;
+  color         : #000;
+  border-radius : 3px;
+  cursor        : pointer;
+}
+
+.dropDown > ul > li > a:hover {
+  text-decoration  : none;
+  background-color : #eee;
+}
+
+/*----------------------------------------------------------------------------*/
 /* Context Menu                                                               */
 /*----------------------------------------------------------------------------*/
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2013-12-02 12:30:19 +0000
@@ -191,6 +191,65 @@
 }
 
 /*----------------------------------------------------------------------------*/
+/* DropDown Menu                                                              */
+/*----------------------------------------------------------------------------*/
+
+.gearDropDown {
+  background-color : #f7f7f7;
+  float            : right;
+  border           : 1px solid #eaeaea;
+  padding          : 4px 10px;
+  cursor           : pointer;
+  border-top-left-radius  : 3px;
+  border-top-right-radius : 3px;
+}
+
+.gearDropDown.active {
+  background-color : #ddd;
+}
+
+.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                    : 9;
+  border-bottom-left-radius  : 3px;
+  border-bottom-right-radius : 3px;
+  box-shadow                 : #ccc 0 1px 1px 0;
+}
+
+.dropDown > ul {
+  margin: 6px 0;
+}
+
+.dropDown > ul > li {
+  list-style-type : none;
+  padding         : 0;
+  margin          : 0;
+}
+
+.dropDown > ul > li > a {
+  display       : block;
+  padding       : 8px 5px;
+  color         : #000;
+  border-radius : 3px;
+  cursor        : pointer;
+}
+
+.dropDown > ul > li > a:hover {
+  text-decoration  : none;
+  background-color : #eee;
+}
+
+/*----------------------------------------------------------------------------*/
 /* Context Menu                                                               */
 /*----------------------------------------------------------------------------*/
 

=== 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-12-02 12:21:20 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2013-12-02 12:30:19 +0000
@@ -14,12 +14,12 @@
 jQuery(function() {
   var dropDown = jQuery('.dropDown');
 
-  dropDown.on('click.dropdown', 'li', function(e) {
+  dropDown.on('click.dropdown', 'li', function( e ) {
     var jqTarget = jQuery(e.target).closest('li');
     var targetFn = dhis2.contextmenu.utils.findFnInWindowScope(jqTarget.data('target-fn'));
 
     if( typeof targetFn !== 'undefined' ) {
-      targetFn( e );
+      targetFn(e);
     }
   });
 
@@ -46,113 +46,10 @@
     }
   });
 });
-
-function editIp( e ) {
-  var jqActiveGearDropDown = jQuery('.gearDropDown.active');
-  var isHeader = jqActiveGearDropDown.parents('.interpretationContent').length != 0;
-  var isComment = jqActiveGearDropDown.parents('.interpretationCommentArea').length != 0;
-  var jqInterpretation = jqActiveGearDropDown.parents('.interpretationContainer');
-  var jqInterpretationComment = jqActiveGearDropDown.parents('.interpretationComment');
-
-  var ipUid = jqInterpretation.data('ip-uid');
-  var ipCommentUid = jqInterpretationComment.data('ip-comment-uid');
-
-  if( isHeader ) {
-  } else if( isComment ) {
-  }
-}
-
-function deleteIp( e ) {
-  var jqActiveGearDropDown = jQuery('.gearDropDown.active');
-  var isHeader = jqActiveGearDropDown.parents('.interpretationContent').length != 0;
-  var isComment = jqActiveGearDropDown.parents('.interpretationCommentArea').length != 0;
-  var jqInterpretation = jqActiveGearDropDown.parents('.interpretationContainer');
-  var jqInterpretationComment = jqActiveGearDropDown.parents('.interpretationComment');
-
-  var ipUid = jqInterpretation.data('ip-uid');
-  var ipCommentUid = jqInterpretationComment.data('ip-comment-uid');
-
-  if( isHeader ) {
-    jQuery.ajax({
-      url: '../api/interpretations/' + ipUid,
-      type: 'DELETE'
-    }).done(function() {
-      jqInterpretation.remove();
-    }).error(function() {
-      setHeaderDelayMessage('$i18n.getString("could_not_delete_interpretation")');
-    });
-  } else if( isComment ) {
-    jQuery.ajax({
-      url: '../api/interpretations/' + ipUid + '/comments/' + ipCommentUid,
-      type: 'DELETE'
-    }).done(function() {
-      jqInterpretationComment.remove();
-    }).error(function() {
-      setHeaderDelayMessage('$i18n.getString("could_not_delete_interpretation_comment")');
-    });
-  }
-}
 </script>
 
-<style>
-.gearDropDown {
-  background-color : #f7f7f7;
-  float            : right;
-  border           : 1px solid #eaeaea;
-  padding          : 4px 10px;
-  cursor           : pointer;
-  border-top-left-radius  : 3px;
-  border-top-right-radius : 3px;
-}
-
-.gearDropDown.active {
-  background-color : #ddd;
-}
-
-.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                    : 9;
-  border-bottom-left-radius  : 3px;
-  border-bottom-right-radius : 3px;
-  box-shadow                 : #ccc 0 1px 1px 0;
-}
-
-.dropDown > ul {
-  margin: 6px 0;
-}
-
-.dropDown > ul > li {
-  list-style-type : none;
-  padding         : 0;
-  margin          : 0;
-}
-
-.dropDown > ul > li > a {
-  display       : block;
-  padding       : 8px 5px;
-  color         : #000;
-  border-radius : 3px;
-  cursor        : pointer;
-}
-
-.dropDown > ul > li > a:hover {
-  text-decoration  : none;
-  background-color : #eee;
-}
-</style>
-
 #macro( gearDropDown $user )
-  #if( $currentUser == $user )
+  #if( $currentUser.userCredentials.isSuper() || $currentUser == $user )
   <div class="gearDropDown">
     <span><i class="fa fa-gear"></i> <i class="fa fa-caret-down"></i></span>
   </div>

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js	2013-12-02 12:21:20 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js	2013-12-02 12:30:19 +0000
@@ -85,3 +85,51 @@
     });
   }
 }
+
+// DropDown Actions
+
+function editIp( e ) {
+  var jqActiveGearDropDown = jQuery('.gearDropDown.active');
+  var isHeader = jqActiveGearDropDown.parents('.interpretationContent').length != 0;
+  var isComment = jqActiveGearDropDown.parents('.interpretationCommentArea').length != 0;
+  var jqInterpretation = jqActiveGearDropDown.parents('.interpretationContainer');
+  var jqInterpretationComment = jqActiveGearDropDown.parents('.interpretationComment');
+
+  var ipUid = jqInterpretation.data('ip-uid');
+  var ipCommentUid = jqInterpretationComment.data('ip-comment-uid');
+
+  if( isHeader ) {
+  } else if( isComment ) {
+  }
+}
+
+function deleteIp( e ) {
+  var jqActiveGearDropDown = jQuery('.gearDropDown.active');
+  var isHeader = jqActiveGearDropDown.parents('.interpretationContent').length != 0;
+  var isComment = jqActiveGearDropDown.parents('.interpretationCommentArea').length != 0;
+  var jqInterpretation = jqActiveGearDropDown.parents('.interpretationContainer');
+  var jqInterpretationComment = jqActiveGearDropDown.parents('.interpretationComment');
+
+  var ipUid = jqInterpretation.data('ip-uid');
+  var ipCommentUid = jqInterpretationComment.data('ip-comment-uid');
+
+  if( isHeader ) {
+    jQuery.ajax({
+      url: '../api/interpretations/' + ipUid,
+      type: 'DELETE'
+    }).done(function() {
+      jqInterpretation.remove();
+    }).error(function() {
+      setHeaderDelayMessage('$i18n.getString("could_not_delete_interpretation")');
+    });
+  } else if( isComment ) {
+    jQuery.ajax({
+      url: '../api/interpretations/' + ipUid + '/comments/' + ipCommentUid,
+      type: 'DELETE'
+    }).done(function() {
+      jqInterpretationComment.remove();
+    }).error(function() {
+      setHeaderDelayMessage('$i18n.getString("could_not_delete_interpretation_comment")');
+    });
+  }
+}