Fixed DOM elements, styling and code style issues

- Reduced number of DOM elements
- Also added mention of "config" backup.
This commit is contained in:
Vincent Petry 2014-05-28 11:29:22 +02:00
parent ca45937d84
commit 7e055a9404
3 changed files with 24 additions and 27 deletions

View File

@ -370,7 +370,7 @@ input[type="submit"].enabled {
opacity: .6; opacity: .6;
} }
#body-login .update .title { #body-login .update h2 {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
margin-bottom: 30px; margin-bottom: 30px;

View File

@ -18,7 +18,6 @@
* @param $el progress list element * @param $el progress list element
*/ */
start: function($el) { start: function($el) {
var self = this;
if (this._started) { if (this._started) {
return; return;
} }
@ -51,12 +50,16 @@
.addClass('error bold') .addClass('error bold')
.append('<br />') .append('<br />')
.append(t('core', 'The update was unsuccessful.' + .append(t('core', 'The update was unsuccessful.' +
'Please report this issue to the <a href="https://github.com/owncloud/core/issues" target="_blank">ownCloud community</a>.')) 'Please report this issue to the ' +
'<a href="https://github.com/owncloud/core/issues" target="_blank">ownCloud community</a>.'))
.appendTo($el); .appendTo($el);
}); });
updateEventSource.listen('done', function(message) { updateEventSource.listen('done', function() {
// FIXME: use product name // FIXME: use product name
$('<span>').addClass('bold').append('<br />').append(t('core', 'The update was successful. Redirecting you to ownCloud now.')).appendTo($el); $('<span>').addClass('bold')
.append('<br />')
.append(t('core', 'The update was successful. Redirecting you to ownCloud now.'))
.appendTo($el);
setTimeout(function () { setTimeout(function () {
OC.redirect(OC.webroot); OC.redirect(OC.webroot);
}, 3000); }, 3000);
@ -73,11 +76,10 @@
})(); })();
$(document).ready(function() { $(document).ready(function() {
$('.updateForm').on('submit', function(ev) { $('.updateButton').on('click', function() {
ev.preventDefault();
var $progressEl = $('.updateProgress'); var $progressEl = $('.updateProgress');
$progressEl.removeClass('hidden'); $progressEl.removeClass('hidden');
$('.updateForm').addClass('hidden'); $('.updateOverview').addClass('hidden');
OC.Update.start($progressEl); OC.Update.start($progressEl);
return false; return false;
}); });

View File

@ -1,32 +1,27 @@
<div class="update"> <div class="update">
<form name="updateForm" class="updateForm"> <div class="updateOverview">
<p class="title bold"> <h2 class="title bold"><?php p($l->t('%s will be updated to version %s.',
<?php p($l->t('%s will be updated to version %s.', array($_['productName'], $_['version']))); ?></h2>
array($_['productName'], $_['version']))); ?>
</p>
<?php if (!empty($_['appList'])) { ?> <?php if (!empty($_['appList'])) { ?>
<div class="infogroup"> <div class="infogroup">
<p class="bold"><?php p($l->t('The following apps will be disabled during the upgrade:')) ?></p> <span class="bold"><?php p($l->t('The following apps will be disabled:')) ?></span>
<ul class="content appList"> <ul class="content appList">
<?php foreach ($_['appList'] as $appInfo) { ?> <?php foreach ($_['appList'] as $appInfo) { ?>
<li><?php p($appInfo['name']) ?> (<?php p($appInfo['id']) ?>)</li> <li><?php p($appInfo['name']) ?> (<?php p($appInfo['id']) ?>)</li>
<?php } ?> <?php } ?>
</ul> </ul>
</div> </div>
<?php } ?> <?php } ?>
<?php if (!empty($_['oldTheme'])) { ?> <?php if (!empty($_['oldTheme'])) { ?>
<div class="infogroup"> <div class="infogroup bold">
<p class="bold"><?php p($l->t('The theme %s has been disabled.', array($_['oldTheme']))) ?></p> <?php p($l->t('The theme %s has been disabled.', array($_['oldTheme']))) ?>
</div> </div>
<?php } ?> <?php } ?>
<div class="infogroup"> <div class="infogroup bold">
<p class="bold"><?php p($l->t('Please make sure that the database and the data folder have been backed up before proceeding.')) ?></p> <?php p($l->t('Please make sure that the database, the config folder and the data folder have been backed up before proceeding.')) ?>
</div> </div>
<div> <input class="updateButton" type="button" value="<?php p($l->t('Start update')) ?>">
<input type="submit" value="<?php p($l->t('Start upgrade')) ?>"></input>
</div>
</form>
<div class="updateProgress hidden">
</div> </div>
<div class="updateProgress hidden"></div>
</div> </div>