dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19314
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8366: Moved js out of template
------------------------------------------------------------
revno: 8366
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-03 17:43:35 +0200
message:
Moved js out of template
modified:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js
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
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java 2012-10-03 14:32:11 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java 2012-10-03 15:43:35 +0000
@@ -42,7 +42,7 @@
public class RemoveMapViewAction
implements Action
{
- // -------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js 2012-09-24 08:49:54 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js 2012-10-03 15:43:35 +0000
@@ -98,3 +98,19 @@
$( "#" + imageId ).attr( "src", imageSrc );
} );
}
+
+function formatItem( item )
+{
+ if ( item.id && item.id.indexOf("u:") != -1 )
+ {
+ return '<img src="../icons/glyphicons_003_user.png" style="width: 12px; height: 12px; padding-right: 5px;"/>' + item.text;
+ }
+ else if ( item.id && item.id.indexOf('ug:') != -1 )
+ {
+ return '<img src="../icons/glyphicons_043_group.png" style="width: 12px; height: 12px; padding-right: 5px;"/>' + item.text;
+ }
+ else
+ {
+ return item.text;
+ }
+}
=== 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-26 08:56:09 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm 2012-10-03 15:43:35 +0000
@@ -4,22 +4,6 @@
var i18n_select_one_or_more_recipients = '$encoder.jsEscape( $i18n.getString( "select_one_or_more_recipients" ), "'")';
var i18n_select_users_and_user_groups = '$encoder.jsEscape( $i18n.getString( "select_users_and_user_groups" ), "'")';
-function format(item)
-{
- if( item.id && item.id.indexOf('u:') != -1 )
- {
- return '<img src="../icons/glyphicons_003_user.png" style="width: 12px; height: 12px; padding-right: 5px;"/>' + item.text;
- }
- else if ( item.id && item.id.indexOf('ug:') != -1 )
- {
- return '<img src="../icons/glyphicons_043_group.png" style="width: 12px; height: 12px; padding-right: 5px;"/>' + item.text;
- }
- else
- {
- return item.text;
- }
-}
-
jQuery(function() {
$('#additionalUsers').select2({
placeholder: i18n_select_users_and_user_groups,
@@ -38,8 +22,8 @@
return { results: data.matches }
}
},
- formatResult: format,
- formatSelection: format
+ formatResult: formatItem,
+ formatSelection: formatItem
});
});
</script>
@@ -51,12 +35,11 @@
<table>
<tr>
-<td style="min-width:80px">$i18n.getString( "recipients" )</td>
+<td style="min-width:80px" rowspan="2">$i18n.getString( "recipients" )</td>
<td>
#organisationUnitSelectionTree( true true false )
</td>
</tr>
-<td style="min-width:80px">$i18n.getString( "user_usergroups" )</td>
<td>
<input type="hidden" name="additionalUsers" id="additionalUsers" style="width: 545px; padding: 4px; border: 1px solid grey;"/>
</td>