Skip to content
Extraits de code Groupes Projets
Valider ac360489 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #5406 added a more detailed error message, some ui tweaks and display a...

refs #5406 added a more detailed error message, some ui tweaks and display a link to email sysadmin if possible
parent 4bdf5d17
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -623,6 +623,10 @@ abstract class Controller ...@@ -623,6 +623,10 @@ abstract class Controller
$view->isUserIsAnonymous = Piwik::isUserIsAnonymous(); $view->isUserIsAnonymous = Piwik::isUserIsAnonymous();
$view->hasSuperUserAccess = Piwik::hasUserSuperUserAccess(); $view->hasSuperUserAccess = Piwik::hasUserSuperUserAccess();
if (!Piwik::isUserIsAnonymous()) {
$view->emailSuperUser = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
}
$this->addCustomLogoInfo($view); $this->addCustomLogoInfo($view);
$view->logoHeader = \Piwik\Plugins\API\API::getInstance()->getHeaderLogoUrl(); $view->logoHeader = \Piwik\Plugins\API\API::getInstance()->getHeaderLogoUrl();
......
...@@ -609,7 +609,7 @@ ...@@ -609,7 +609,7 @@
"EncryptedSmtpTransport": "Enter the transport layer encryption required by your SMTP server.", "EncryptedSmtpTransport": "Enter the transport layer encryption required by your SMTP server.",
"EnglishLanguageName": "English", "EnglishLanguageName": "English",
"Error": "Error", "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", "EvolutionOverPeriod": "Evolution over the period",
"EvolutionSummaryGeneric": "%1$s in %2$s compared to %3$s in %4$s. Evolution: %5$s", "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.", "ExceptionCheckUserHasSuperUserAccessOrIsTheUser": "The user has to be either a Super User or the user '%s' itself.",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{{ postEvent("Template.nextToCalendar") }} {{ postEvent("Template.nextToCalendar") }}
{% render dashboardSettingsControl %} {% render dashboardSettingsControl %}
{% include "@CoreHome/_headerMessage.twig" %} {% include "@CoreHome/_headerMessage.twig" %}
{{ ajax.requestErrorDiv }} {{ ajax.requestErrorDiv(emailSuperUser) }}
</div> </div>
{{ ajax.loadingDiv() }} {{ ajax.loadingDiv() }}
......
...@@ -136,7 +136,11 @@ ...@@ -136,7 +136,11 @@
var params = $.extend(this.widgetParameters, overrideParams || {}); var params = $.extend(this.widgetParameters, overrideParams || {});
widgetsHelper.loadWidgetAjax(this.uniqueId, params, onWidgetLoadedReplaceElementWithContent, function () { widgetsHelper.loadWidgetAjax(this.uniqueId, params, onWidgetLoadedReplaceElementWithContent, function () {
$('.widgetContent', currentWidget).removeClass('loading'); $('.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>'); $('.widgetContent', currentWidget).html('<div class="widgetLoadingError">' + errorMessage + '</div>');
}); });
......
...@@ -204,13 +204,20 @@ ...@@ -204,13 +204,20 @@
display: none; display: none;
} }
.widgetLoading, .widgetLoadingError { .widgetLoading {
cursor: wait; cursor: wait;
}
.widgetLoading, .widgetLoadingError {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
font-size: 10pt; font-size: 10pt;
} }
.widgetLoadingError {
color: @theme-color-brand;
}
#closeMenuIcon { #closeMenuIcon {
float: right; float: right;
margin: 3px; margin: 3px;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
font-size: 1.1em; font-size: 1.1em;
color: #F88D22; color: #F88D22;
padding: 0.5em; padding: 0.5em;
margin-left: 30%;
display: none; display: none;
padding-top: 40px; padding-top: 40px;
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{% include "@CoreHome/_topScreen.twig" %} {% include "@CoreHome/_topScreen.twig" %}
{% import 'ajaxMacros.twig' as ajax %} {% import 'ajaxMacros.twig' as ajax %}
{{ ajax.requestErrorDiv }} {{ ajax.requestErrorDiv(emailSuperUser) }}
{{ postEvent("Template.beforeContent", "admin", currentModule) }} {{ postEvent("Template.beforeContent", "admin", currentModule) }}
<div id="container"> <div id="container">
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% macro requestErrorDiv() %} {% macro requestErrorDiv(emailSuperUser) %}
<div id="loadingError">{{ 'General_ErrorRequest'|translate }}</div> {% 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 %} {% endmacro %}
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter