dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27301
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13570: Impl context menu for detailed meta-data export
------------------------------------------------------------
revno: 13570
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-01-03 19:34:17 +0100
message:
Impl context menu for detailed meta-data export
modified:
dhis-2/dhis-web/dhis-web-importexport/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/dxf2FilteredMetaDataExport.vm
dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/filter.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.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-importexport/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/struts.xml 2013-10-30 12:51:03 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/struts.xml 2014-01-03 18:34:17 +0000
@@ -310,7 +310,8 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <!--@author Ovidiu Rosu <rosu.ovi@xxxxxxxxx>-->
+ <!-- Detailed meta-data export -->
+
<action name="dxf2FilteredMetaDataExport" class="org.hisp.dhis.importexport.action.dxf2.FilterListAction">
<result name="success" type="velocity">/main.vm</result>
<param name="menu">/dhis-web-importexport/mainMenu.vm</param>
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/dxf2FilteredMetaDataExport.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/dxf2FilteredMetaDataExport.vm 2013-10-30 12:51:03 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/dxf2FilteredMetaDataExport.vm 2014-01-03 18:34:17 +0000
@@ -6,6 +6,15 @@
<h3>$i18n.getString( "filtered_metadata_export" ) #openHelp( "filtered_metadata_export" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li data-enabled="canManage"><a data-target-fn="exportFilterButton"><i class="fa fa-play"></i> $i18n.getString( "export" )</a></li>
+ <li data-enabled="canManage"><a data-target-fn="editFilterButton"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li data-enabled="canManage"><a data-target-fn="removeFilterButton"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showFilterDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<!-- FILTER EXPORT FORM -->
<div id="mainDivFilter" style="width: 70%;">
<table class="mainPageTable">
@@ -31,24 +40,16 @@
<!-- FILTER TABLE -->
<table id="filterList" class="listTable">
- <col/>
- <col width="115"/>
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
- <th class="{sorter: false}">$i18n.getString( "operations" )</th>
</tr>
</thead>
<tbody id="filterTableBody">
#foreach( $filter in $filters )
- <tr id="tr${filter.uid}">
- <td>$filter.name</td>
- <td>
- <a href="javascript:exportFilterButton( '$filter.uid' );" title="$i18n.getString( 'export' )"><img src="../images/start_process.png" alt="$i18n.getString( 'export' )"/></a>
- <a href="javascript:editFilterButton( '$filter.uid' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
- <a href="javascript:removeFilterButton( '$filter.uid' );" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
- <a href="javascript:showFilterDetails( '$filter.uid' );" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
- </td>
+ <tr id="tr${filter.uid}" data-id="$!filter.id" data-uid="$!filter.uid" data-type="Filter" data-name="$encoder.htmlEncode( $!filter.name )"
+ data-can-manage="#if( $auth.hasAccess( 'dhis-web-importexport', 'dxf2FilteredMetaDataExport' ) )true#{else}false#end">
+ <td>$encoder.htmlEncode( $!filter.name )</td>
</tr>
#end
</tbody>
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/filter.js'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/filter.js 2013-10-31 10:29:22 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/filter.js 2014-01-03 18:34:17 +0000
@@ -5,12 +5,17 @@
// -----------------------------------------------------------------------------
// Document ready
// -----------------------------------------------------------------------------
-jQuery( function ()
- {
- tableSorter( "filterList" );
- loadFilters();
- }
-);
+
+jQuery( function() {
+ tableSorter( "filterList" );
+ loadFilters();
+
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive',
+ listId: 'filterTableBody'
+ });
+} );
// Create a new Filter form
function submitFilterForm( command )
@@ -40,8 +45,10 @@
}
// Show Filter details
-function showFilterDetails( filterUid )
+function showFilterDetails( context )
{
+ var filterUid = context.uid;
+
$( "#detailsArea" ).show( "fast" );
for ( var i = 0; i < filters.length; i++ )
{
@@ -58,8 +65,10 @@
// -----------------------------------------------------------------------------
// Start export
-function exportFilterButton( filterUid )
+function exportFilterButton( context )
{
+ var filterUid = context.uid;
+
for ( var i = 0; i < filters.length; i++ )
{
if ( filters[i].id == filterUid )
@@ -112,8 +121,10 @@
// -----------------------------------------------------------------------------
// Edit a Filter
-function editFilterButton( filterUid )
+function editFilterButton( context )
{
+ var filterUid = context.uid;
+
for ( var i = 0; i < filters.length; i++ )
{
if ( filters[i].id == filterUid )
@@ -134,8 +145,10 @@
// -----------------------------------------------------------------------------
// Delete a Filter
-function removeFilterButton( filterUid )
+function removeFilterButton( context )
{
+ var filterUid = context.uid;
+
var filter = {};
for ( var i = 0; i < filters.length; i++ )
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm 2013-12-04 12:58:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm 2014-01-03 18:34:17 +0000
@@ -100,8 +100,8 @@
<p><label>$i18n.getString( "aggregation_operator" ):</label><br/><span id="aggregationOperatorField"></span></p>
<p><label>$i18n.getString( "category_combination" ):</label><br/><span id="categoryComboField"></span></p>
<p><label>$i18n.getString( "url" ):</label><br/><span id="urlField"></span></p>
- <p><label>$i18n.getString( "last_updated" ):</label><br/><span id="lastUpdatedField"></span></p>
- <p><label>$i18n.getString( "data_sets" ):</label><br/><span id="dataSetsField"></span></p>
+ <p><label>$i18n.getString( "last_updated" ):</label><br/><span id="lastUpdatedField"></span></p>
+ <p><label>$i18n.getString( "data_sets" ):</label><br/><span id="dataSetsField"></span></p>
</div>
<div id="warningArea">