Skip to content

Commit

Permalink
Merge pull request #10485 from nextcloud/update-triangle
Browse files Browse the repository at this point in the history
Fix design of update error page
  • Loading branch information
rullzer authored Aug 6, 2018
2 parents ca54166 + 6d7bf81 commit 49662f3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
15 changes: 14 additions & 1 deletion core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ form #selectDbType label.ui-state-active {
background-color: rgba(0,0,0,.3);
color: #fff;
text-align: left;
word-wrap: break-word;
border-radius: 3px;
cursor: default;
-moz-user-select: text;
Expand Down Expand Up @@ -619,22 +620,34 @@ p.info {
}
#update-progress-detailed {
text-align: left;
margin-bottom: 12px;
}
.update-show-detailed {
padding: 13px;
padding: 12px;
display: block;
opacity: .75;
}
.update-show-detailed .icon-caret-white {
display: inline-block;
vertical-align: middle;
}
#update-progress-icon {
height: 32px;
margin: 10px;
background-size: 32px;
}


/* Icons */
.icon-info-white {
background-image: url('../img/actions/info-white.svg?v=2');
}
.icon-error-white {
background-image: url('../img/actions/error-white.svg?v=1');
}
.icon-caret-white {
background-image: url('../img/actions/caret-white.svg?v=1');
}
.icon-confirm {
background-image: url('../img/actions/confirm.svg?v=2');
}
Expand Down
1 change: 1 addition & 0 deletions core/img/actions/error-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 8 additions & 15 deletions core/js/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$(window).off('beforeunload.inprogress');
self.setErrorMessage(message);
message = t('core', 'Please reload the page.');
$('<span>').addClass('error').append('<a href=".">'+message+'</a><br />').appendTo($el);
$('<p>').append('<a href=".">'+message+'</a>').appendTo($el);
updateEventSource.close();
});
updateEventSource.listen('failure', function(message) {
Expand All @@ -69,16 +69,15 @@
.removeClass('icon-loading-dark');

self.setErrorMessage(message);
var span = $('<span>')
.addClass('bold');
var updateUnsuccessful = $('<p>');
if(message === 'Exception: Updates between multiple major versions and downgrades are unsupported.') {
span.append(t('core', 'The update was unsuccessful. For more information <a href="{url}">check our forum post</a> covering this issue.', {'url': 'https://help.nextcloud.com/t/updates-between-multiple-major-versions-are-unsupported/7094'}));
updateUnsuccessful.append(t('core', 'The update was unsuccessful. For more information <a href="{url}">check our forum post</a> covering this issue.', {'url': 'https://help.nextcloud.com/t/updates-between-multiple-major-versions-are-unsupported/7094'}));
} else {
span.append(t('core', 'The update was unsuccessful. ' +
updateUnsuccessful.append(t('core', 'The update was unsuccessful. ' +
'Please report this issue to the ' +
'<a href="https://github.com/nextcloud/server/issues" target="_blank">Nextcloud community</a>.'));
}
span.appendTo($el);
updateUnsuccessful.appendTo($el);
});
updateEventSource.listen('done', function() {
$(window).off('beforeunload.inprogress');
Expand Down Expand Up @@ -123,9 +122,7 @@
setMessage: function(message) {
$('#update-progress-message').html(message);
$('#update-progress-detailed')
.append($('<span>'))
.append(message)
.append($('<br>'));
.append('<p>' + message + '</p>');
},

setPermanentMessage: function(message) {
Expand All @@ -134,19 +131,15 @@
.show()
.append($('<ul>').append(message));
$('#update-progress-detailed')
.append($('<span>'))
.append(message)
.append($('<br>'));
.append('<p>' + message + '</p>');
},

setErrorMessage: function (message) {
$('#update-progress-message-error')
.show()
.html(message);
$('#update-progress-detailed')
.append($('<span>'))
.append(message)
.append($('<br>'));
.append('<p>' + message + '</p>');
}
};

Expand Down
2 changes: 1 addition & 1 deletion core/templates/update.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<p id="update-progress-message-error" class="hidden"></p>
<ul id="update-progress-message-warnings" class="hidden"></ul>
<p id="update-progress-message"></p>
<a class="update-show-detailed"><?php p($l->t( 'Detailed logs' )); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a>
<a class="update-show-detailed"><?php p($l->t( 'Detailed logs' )); ?> <span class="icon-caret-white"></span></a>
<div id="update-progress-detailed" class="hidden"></div>
</div>
</div>

0 comments on commit 49662f3

Please sign in to comment.