Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-07-21 17:27:44 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-07-21 17:27:44 +0400
commitac360489b9b9800424b84de7b5d11ad6b7101be2 (patch)
treed0c0cfc0a619284be88132c977bce002c44434a8
parent4bdf5d17c8ceb3a979164c854ffad8ae7a5e41cb (diff)
refs #5406 added a more detailed error message, some ui tweaks and display a link to email sysadmin if possible
-rw-r--r--core/Plugin/Controller.php4
-rw-r--r--lang/en.json2
-rw-r--r--plugins/CoreHome/templates/_indexContent.twig2
-rwxr-xr-xplugins/Dashboard/javascripts/dashboardWidget.js6
-rw-r--r--plugins/Dashboard/stylesheets/dashboard.less9
-rw-r--r--plugins/Morpheus/stylesheets/uibase/_loading.less1
-rw-r--r--plugins/Morpheus/templates/admin.twig2
-rw-r--r--plugins/Morpheus/templates/ajaxMacros.twig8
8 files changed, 26 insertions, 8 deletions
diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php
index b8b636c6d4..729e7da0f6 100644
--- a/core/Plugin/Controller.php
+++ b/core/Plugin/Controller.php
@@ -623,6 +623,10 @@ abstract class Controller
$view->isUserIsAnonymous = Piwik::isUserIsAnonymous();
$view->hasSuperUserAccess = Piwik::hasUserSuperUserAccess();
+ if (!Piwik::isUserIsAnonymous()) {
+ $view->emailSuperUser = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
+ }
+
$this->addCustomLogoInfo($view);
$view->logoHeader = \Piwik\Plugins\API\API::getInstance()->getHeaderLogoUrl();
diff --git a/lang/en.json b/lang/en.json
index b9699f9226..5c0ce0df4a 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -609,7 +609,7 @@
"EncryptedSmtpTransport": "Enter the transport layer encryption required by your SMTP server.",
"EnglishLanguageName": "English",
"Error": "Error",
- "ErrorRequest": "Oops… problem during the request, please try again.",
+ "ErrorRequest": "Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please %scontact your Piwik administrator%s for assistance.",
"EvolutionOverPeriod": "Evolution over the period",
"EvolutionSummaryGeneric": "%1$s in %2$s compared to %3$s in %4$s. Evolution: %5$s",
"ExceptionCheckUserHasSuperUserAccessOrIsTheUser": "The user has to be either a Super User or the user '%s' itself.",
diff --git a/plugins/CoreHome/templates/_indexContent.twig b/plugins/CoreHome/templates/_indexContent.twig
index e115513a6d..0ce893d27c 100644
--- a/plugins/CoreHome/templates/_indexContent.twig
+++ b/plugins/CoreHome/templates/_indexContent.twig
@@ -6,7 +6,7 @@
{{ postEvent("Template.nextToCalendar") }}
{% render dashboardSettingsControl %}
{% include "@CoreHome/_headerMessage.twig" %}
- {{ ajax.requestErrorDiv }}
+ {{ ajax.requestErrorDiv(emailSuperUser) }}
</div>
{{ ajax.loadingDiv() }}
diff --git a/plugins/Dashboard/javascripts/dashboardWidget.js b/plugins/Dashboard/javascripts/dashboardWidget.js
index 64b7c8042d..8a7642978d 100755
--- a/plugins/Dashboard/javascripts/dashboardWidget.js
+++ b/plugins/Dashboard/javascripts/dashboardWidget.js
@@ -136,7 +136,11 @@
var params = $.extend(this.widgetParameters, overrideParams || {});
widgetsHelper.loadWidgetAjax(this.uniqueId, params, onWidgetLoadedReplaceElementWithContent, function () {
$('.widgetContent', currentWidget).removeClass('loading');
- var errorMessage = _pk_translate('General_ErrorRequest');
+ var errorMessage = _pk_translate('General_ErrorRequest', ['', '']);
+ if ($('#loadingError').html()) {
+ errorMessage = $('#loadingError').html();
+ }
+
$('.widgetContent', currentWidget).html('<div class="widgetLoadingError">' + errorMessage + '</div>');
});
diff --git a/plugins/Dashboard/stylesheets/dashboard.less b/plugins/Dashboard/stylesheets/dashboard.less
index fb59494026..2d28343213 100644
--- a/plugins/Dashboard/stylesheets/dashboard.less
+++ b/plugins/Dashboard/stylesheets/dashboard.less
@@ -204,13 +204,20 @@
display: none;
}
-.widgetLoading, .widgetLoadingError {
+.widgetLoading {
cursor: wait;
+}
+
+.widgetLoading, .widgetLoadingError {
padding: 10px;
text-align: center;
font-size: 10pt;
}
+.widgetLoadingError {
+ color: @theme-color-brand;
+}
+
#closeMenuIcon {
float: right;
margin: 3px;
diff --git a/plugins/Morpheus/stylesheets/uibase/_loading.less b/plugins/Morpheus/stylesheets/uibase/_loading.less
index e8b189d0d0..e68d0f0a69 100644
--- a/plugins/Morpheus/stylesheets/uibase/_loading.less
+++ b/plugins/Morpheus/stylesheets/uibase/_loading.less
@@ -20,7 +20,6 @@
font-size: 1.1em;
color: #F88D22;
padding: 0.5em;
- margin-left: 30%;
display: none;
padding-top: 40px;
} \ No newline at end of file
diff --git a/plugins/Morpheus/templates/admin.twig b/plugins/Morpheus/templates/admin.twig
index b07d8343ef..4ceff8273a 100644
--- a/plugins/Morpheus/templates/admin.twig
+++ b/plugins/Morpheus/templates/admin.twig
@@ -30,7 +30,7 @@
{% include "@CoreHome/_topScreen.twig" %}
{% import 'ajaxMacros.twig' as ajax %}
- {{ ajax.requestErrorDiv }}
+ {{ ajax.requestErrorDiv(emailSuperUser) }}
{{ postEvent("Template.beforeContent", "admin", currentModule) }}
<div id="container">
diff --git a/plugins/Morpheus/templates/ajaxMacros.twig b/plugins/Morpheus/templates/ajaxMacros.twig
index eddeeab10e..4d06fd4e30 100644
--- a/plugins/Morpheus/templates/ajaxMacros.twig
+++ b/plugins/Morpheus/templates/ajaxMacros.twig
@@ -13,6 +13,10 @@
</div>
{% endmacro %}
-{% macro requestErrorDiv() %}
-<div id="loadingError">{{ 'General_ErrorRequest'|translate }}</div>
+{% macro requestErrorDiv(emailSuperUser) %}
+ {% if emailSuperUser is defined and emailSuperUser %}
+ <div id="loadingError">{{ 'General_ErrorRequest'|translate('<a href="mailto:' ~ emailSuperUser ~ '">', '</a>')|raw }}</div>
+ {% else %}
+ <div id="loadingError">{{ 'General_ErrorRequest'|translate('', '') }}</div>
+ {% endif %}
{% endmacro %} \ No newline at end of file