dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24108
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11769: add link for sharing dashboards, disable if user can't manage current dashboard
------------------------------------------------------------
revno: 11769
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-08-23 13:12:24 +0200
message:
add link for sharing dashboards, disable if user can't manage current dashboard
modified:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css
--
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/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2013-08-06 18:33:05 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2013-08-23 11:12:24 +0000
@@ -109,6 +109,7 @@
delete_current_dashboard=Delete current dashboard
add_new=Add new
manage=Manage
+sharing=Sharing
click_add_new_to_get_started=Click 'Add new' to get started
add_stuff_by_searching=Add stuff by searching from the search field above
arrange_dashboard_by_dragging_and_dropping=Tip: arrange dashboard by dragging and dropping items
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm 2013-08-23 08:47:12 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm 2013-08-23 11:12:24 +0000
@@ -1,3 +1,6 @@
+
+#sharingDialog()
+
<script type="text/javascript">
var i18n_share_your_interpretation_of = '$encoder.jsEscape( $i18n.getString( "share_your_interpretation_of" ), "'")';
var i18n_interpretation_was_shared = '$encoder.jsEscape( $i18n.getString( "interpretation_was_shared" ), "'")';
@@ -11,6 +14,7 @@
var i18n_click_to_explore_drag_to_new_position = '$encoder.jsEscape( $i18n.getString( "click_to_explore_drag_to_new_position" ), "'")';
var i18n_drag_to_new_position = '$encoder.jsEscape( $i18n.getString( "drag_to_new_position" ), "'")';
var i18n_manage = '$encoder.jsEscape( $i18n.getString( "manage" ), "'")';
+var i18n_sharing = '$encoder.jsEscape( $i18n.getString( "sharing" ), "'")';
</script>
<div id="dashboardHeader"><h3>
@@ -40,6 +44,7 @@
<ul>
<li><a class='bold' href='javascript:dhis2.db.openAddDashboardForm()'>$i18n.getString( "add" )</a></li>
<li id="manageDashboard"><a class='bold'>$i18n.getString( "manage" )</a></li>
+ <li id="manageSharing"><a class='bold'>$i18n.getString( "sharing" )</a></li>
<li><a class='bold' href='javascript:dhis2.db.scrollLeft()' title='$i18n.getString( "previous" )'><</a></li>
<li><a class='bold' href='javascript:dhis2.db.scrollRight()' title='$i18n.getString( "next" )'>></a></li>
</ul>
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js 2013-08-23 10:02:34 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js 2013-08-23 11:12:24 +0000
@@ -41,16 +41,16 @@
dhis2.db.tmpl = {
dashboardLink: "<li id='dashboard-${id}'><a href='javascript:dhis2.db.renderDashboard( \"${id}\" )'>${name}</a></li>",
-
+
moduleIntro: "<li><div class='dasboardIntro'>${i18n_click}</div></li>",
-
+
dashboardIntro: "<li><div class='dasboardIntro'>${i18n_add}</div>" +
"<div class='dasboardTip'>${i18n_arrange}</div></li>",
hitHeader: "<li class='hitHeader'>${title}</li>",
hitItem: "<li><a class='viewLink' href='${link}'><img src='../images/${img}.png'>${name}</a>" +
- "{{if canManage }}<a class='addLink' href='javascript:dhis2.db.addItemContent( \"${type}\", \"${id}\" )'>Add</a>{{/if}}</li>",
+ "{{if canManage}}<a class='addLink' href='javascript:dhis2.db.addItemContent( \"${type}\", \"${id}\" )'>Add</a>{{/if}}</li>",
chartItem: "<li id='liDrop-${itemId}' class='liDropItem'><div class='dropItem' id='drop-${itemId}' data-item='${itemId}'></div></li>" +
"<li id='li-${itemId}' class='liItem'><div class='item' id='${itemId}'><div class='itemHeader'><a href='javascript:dhis2.db.removeItem( \"${itemId}\" )'>${i18n_remove}</a>" +
@@ -254,7 +254,6 @@
url: "../api/dashboards/" + dhis2.db.current,
success: function() {
$( "#manageDashboardForm" ).dialog( "destroy" );
- dhis2.db.current = undefined;
dhis2.db.renderDashboardListLoadFirst();
}
} );
@@ -270,6 +269,12 @@
.text( i18n_manage )
.attr( 'href', 'javascript:dhis2.db.openManageDashboardForm()' );
$( '#manageDashboard' ).html( manageLink );
+
+ var sharingLink = $( '<a/>' )
+ .addClass( 'bold' )
+ .text( i18n_sharing )
+ .attr( 'href', 'javascript:showSharingDialog("dashboard", "' + dashboard.id + '")' );
+ $( '#manageSharing' ).html( sharingLink );
} else {
var manageLink = $( '<a/>' )
.addClass( 'bold' )
@@ -280,6 +285,16 @@
})
.text( i18n_manage );
$( '#manageDashboard' ).html( manageLink );
+
+ var sharingLink = $( '<a/>' )
+ .addClass( 'bold' )
+ .css({
+ 'cursor': 'default',
+ 'text-decoration': 'none',
+ 'color': 'black'
+ })
+ .text( i18n_sharing );
+ $( '#manageSharing' ).html( sharingLink );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css 2013-08-21 12:13:54 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css 2013-08-23 11:12:24 +0000
@@ -32,7 +32,7 @@
#dashboardListContainer
{
position: absolute;
- left: 225px;
+ left: 299px;
right: 20px;
margin-top: 48px;
}