← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8246: added icons to sendMessage, makes it easier to see if the recipient is a user or usergroup

 

------------------------------------------------------------
revno: 8246
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-09-25 11:09:42 +0700
message:
  added icons to sendMessage, makes it easier to see if the recipient is a user or usergroup
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_003_user.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_043_group.png
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.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
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_003_user.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_003_user.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_003_user.png	2012-09-25 04:09:42 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_043_group.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_043_group.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/glyphicons_043_group.png	2012-09-25 04:09:42 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm	2012-09-24 09:29:52 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm	2012-09-25 04:09:42 +0000
@@ -6,7 +6,23 @@
 var i18n_enter_text = '$encoder.jsEscape( $i18n.getString( "enter_text" ), "'")';
 var i18n_select_one_or_more_recipients = '$encoder.jsEscape( $i18n.getString( "select_one_or_more_recipients" ), "'")';
 
-$(function() {
+function format(item)
+{
+    if(item.id.indexOf('u:') != -1)
+    {
+        return '<img src="../icons/glyphicons_003_user.png" style="width: 16px; height: 16px; padding-right: 5px;"/>' + item.text;
+    }
+    else if (item.id.indexOf('ug:') != -1)
+    {
+        return '<img src="../icons/glyphicons_043_group.png" style="width: 16px; height: 16px; padding-right: 5px;"/>' + item.text;
+    }
+    else
+    {
+        return item.text;
+    }
+}
+
+jQuery(function() {
     $('#additionalUsers').select2({
        placeholder: 'Select user and user groups',
        minimumInputLength: 2,
@@ -23,7 +39,9 @@
            results: function(data, page) {
                return { results: data.matches }
            }
-       }
+       },
+       formatResult: format,
+       formatSelection: format
     });
 });
 </script>