← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18036: Apps module, added restore config function

 

------------------------------------------------------------
revno: 18036
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-01-16 20:19:53 +0100
message:
  Apps module, added restore config function
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/appSettings.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/javascript/deleteApp.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-maintenance/dhis-web-maintenance-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties	2014-09-26 06:00:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties	2015-01-16 19:19:53 +0000
@@ -20,3 +20,4 @@
 appmanager_you_have_no_apps_installed=You have no apps installed at the moment
 appmanager_author=Author
 appmanager_version=Version
+appmanager_restore_to_default=Restore to default
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/appSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/appSettings.vm	2015-01-16 19:07:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/appSettings.vm	2015-01-16 19:19:53 +0000
@@ -32,7 +32,10 @@
 <div class="setting"><input type="text" id="appFolderPath" name="appFolderPath" style="width:40em" value="$!appFolderPath"/></div>
 <div class="settingLabel">$i18n.getString( "appmanager_baseurl" ) <span class="tipText">($i18n.getString( "appmanager_where_apps_can_be_found" ))</span></div>
 <div class="setting"><input type="text" id="appBaseUrl" name="appBaseUrl" style="width:40em" value="$!appBaseUrl"/></div>
-<div><input type="button" value="Save" style="width:120px" onclick="setAppConfig()" /></div>
+<div>
+	<input type="button" value="Save" style="width:120px" onclick="setAppConfig()" /> &nbsp;
+	<a href="javascript:resetAppConfig()">$i18n.getString( "appmanager_restore_to_default" )</a>
+</div>
 
 <h3>$i18n.getString( "appmanager_management" )</h3>
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/javascript/deleteApp.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/javascript/deleteApp.js	2015-01-16 19:07:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/webapp/dhis-web-maintenance-appmanager/javascript/deleteApp.js	2015-01-16 19:19:53 +0000
@@ -20,4 +20,14 @@
 	} ).fail( function( xhr, text, error ) {
 		setHeaderDelayMessage( xhr.responseText );
 	} );	
+}
+
+function resetAppConfig() {
+	
+	$.ajax( {
+		url: "../api/apps/config",
+		type: "delete"
+	} ).done( function() {
+		window.location.href = "appSettings.action";
+	} );
 }
\ No newline at end of file