From 2b3ecb8cc9cc075f2c5cd7647280087ebd832370 Mon Sep 17 00:00:00 2001 From: benakamoorthi Date: Wed, 5 Dec 2012 06:18:00 +0000 Subject: Refs #3456, various UX improvements to GeoIP updater/auto-downloader. git-svn-id: http://dev.piwik.org/svn/trunk@7577 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/UserCountry/Controller.php | 9 +++++++-- plugins/UserCountry/templates/admin.js | 1 + plugins/UserCountry/templates/adminIndex.tpl | 12 ++++++++---- plugins/UserCountry/templates/styles.css | 5 ++++- plugins/UserCountry/templates/updaterSetup.tpl | 12 +++++++----- 5 files changed, 27 insertions(+), 12 deletions(-) (limited to 'plugins/UserCountry') diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php index 8d62f7e473..bf08563637 100644 --- a/plugins/UserCountry/Controller.php +++ b/plugins/UserCountry/Controller.php @@ -35,7 +35,7 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin { Piwik::checkUserIsSuperUser(); $view = Piwik_View::factory('adminIndex'); - + $allProviderInfo = Piwik_UserCountry_LocationProvider::getAllProviderInfo( $newline = '
', $includeExtra = true); $view->locationProviders = $allProviderInfo; @@ -160,6 +160,8 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin $view->geoIPIspUrl = $urls['isp']; $view->geoIPOrgUrl = $urls['org']; $view->geoIPUpdatePeriod = Piwik_UserCountry_GeoIPAutoUpdater::getSchedulePeriod(); + + $view->geoLiteUrl = Piwik_UserCountry_LocationProvider_GeoIp::GEO_LITE_URL; } /** @@ -466,10 +468,13 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin { $missingDbKey = $missingDbs[0]; $missingDbName = Piwik_UserCountry_LocationProvider_GeoIp::$dbNames[$missingDbKey][0]; + $url = Piwik_UserCountry_GeoIPAutoUpdater::getConfiguredUrl($missingDbKey); + + $link = ''.$missingDbName.''; return array( 'to_download' => $missingDbKey, - 'to_download_label' => Piwik_Translate('UserCountry_DownloadingDb', $missingDbName).'...', + 'to_download_label' => Piwik_Translate('UserCountry_DownloadingDb', $link).'...', ); } return false; diff --git a/plugins/UserCountry/templates/admin.js b/plugins/UserCountry/templates/admin.js index fc5e71c762..5c874753d5 100755 --- a/plugins/UserCountry/templates/admin.js +++ b/plugins/UserCountry/templates/admin.js @@ -140,6 +140,7 @@ $(document).ready(function() { $('body').on('click', '#start-automatic-update-geoip', function() { $('#geoipdb-screen1').hide("slide", {direction: "left"}, 800, function () { + $('#geoip-db-mangement').text(_pk_translate('UserCountry_SetupAutomaticUpdatesOfGeoIP_js')); $('#geoipdb-update-info').fadeIn(1000); }); }); diff --git a/plugins/UserCountry/templates/adminIndex.tpl b/plugins/UserCountry/templates/adminIndex.tpl index 7c5fe69131..490205f2f3 100755 --- a/plugins/UserCountry/templates/adminIndex.tpl +++ b/plugins/UserCountry/templates/adminIndex.tpl @@ -94,10 +94,14 @@ -

{'UserCountry_GeoIPDatabases'|translate}

+{if !$geoIPDatabasesInstalled} +

{'UserCountry_GeoIPDatabases'|translate}

+{else} +

{'UserCountry_SetupAutomaticUpdatesOfGeoIP_js'|translate}

+{/if} {if $showGeoIPUpdateSection} -
+
{if !$geoIPDatabasesInstalled}
@@ -107,12 +111,12 @@
-

{'UserCountry_IPurchasedGeoIPDBs'|translate}

+

{'UserCountry_IPurchasedGeoIPDBs'|translate:'':''}

{/if} diff --git a/plugins/UserCountry/templates/styles.css b/plugins/UserCountry/templates/styles.css index 4ded571aa5..57cf159777 100755 --- a/plugins/UserCountry/templates/styles.css +++ b/plugins/UserCountry/templates/styles.css @@ -19,10 +19,13 @@ span.is-broken { } #manage-geoip-dbs { - width:900px; height: 20em; } +#geoipdb-screen1, #geoipdb-screen2-download,#geoipdb-update-info { + width:900px; +} + #geoipdb-update-info tr input[type="text"],#geoipdb-screen2-update tr input[type="text"] { width: 90%; } diff --git a/plugins/UserCountry/templates/updaterSetup.tpl b/plugins/UserCountry/templates/updaterSetup.tpl index 96d55b5f1a..4cb2342af4 100755 --- a/plugins/UserCountry/templates/updaterSetup.tpl +++ b/plugins/UserCountry/templates/updaterSetup.tpl @@ -1,8 +1,10 @@
-

{'UserCountry_GeoIPUpdaterInstructions'|translate:'':'':'':''}

+

{'UserCountry_GeoIPUpdaterInstructions'|translate:'':'':'':''}

+ {'UserCountry_GeoLiteCityLink'|translate:"":$geoLiteUrl:''} {if $geoIPDatabasesInstalled} -

{'UserCountry_GeoIPUpdaterIntro'|translate}:

+

{'UserCountry_GeoIPUpdaterIntro'|translate}: {/if} +

@@ -28,13 +30,13 @@ - + -- cgit v1.2.3
{'Live_GoalType'|translate}
{'General_Period'|translate}{'UserCountry_DownloadNewDatabasesEvery'|translate} - + - +