mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 21:49:04 +01:00
Avoid failing when there are no backups
This commit is contained in:
parent
4b7162040b
commit
0245e8ae0e
@ -3,6 +3,7 @@
|
||||
namespace Formwork\Panel\Controllers;
|
||||
|
||||
use Formwork\Backupper;
|
||||
use Formwork\Data\Collection;
|
||||
use Formwork\Http\Response;
|
||||
use Formwork\Router\RouteParams;
|
||||
use Formwork\Utils\Arr;
|
||||
@ -50,7 +51,7 @@ class ToolsController extends AbstractController
|
||||
'tabs' => $this->tabs,
|
||||
'current' => 'backups',
|
||||
]),
|
||||
'backups' => array_values($backups),
|
||||
'backups' => Collection::from($backups),
|
||||
]));
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['Woche', 'Wochen']
|
||||
date.duration.years: ['Jahr', 'Jahre']
|
||||
date.months.long: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
|
||||
date.months.short: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']
|
||||
date.never: nie
|
||||
date.now: jetzt
|
||||
date.today: Heute
|
||||
date.weekdays.long: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag']
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['week', 'weeks']
|
||||
date.duration.years: ['year', 'years']
|
||||
date.months.long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||
date.months.short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
date.never: never
|
||||
date.now: now
|
||||
date.today: Today
|
||||
date.weekdays.long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['semana', 'semanas']
|
||||
date.duration.years: ['año', 'años']
|
||||
date.months.long: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
|
||||
date.months.short: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic']
|
||||
date.never: nunca
|
||||
date.now: ahora
|
||||
date.today: Hoy
|
||||
date.weekdays.long: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado']
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['semaine', 'semaines']
|
||||
date.duration.years: ['an', 'ans']
|
||||
date.months.long: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']
|
||||
date.months.short: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Juil', 'Aou', 'Sep', 'Oct', 'Nov', 'Déc']
|
||||
date.never: jamais
|
||||
date.now: maintenant
|
||||
date.today: Aujourd’hui
|
||||
date.weekdays.long: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['settimana', 'settimane']
|
||||
date.duration.years: ['anno', 'anni']
|
||||
date.months.long: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre']
|
||||
date.months.short: ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic']
|
||||
date.never: mai
|
||||
date.now: adesso
|
||||
date.today: Oggi
|
||||
date.weekdays.long: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato']
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['semana', 'semanas']
|
||||
date.duration.years: ['ano', 'anos']
|
||||
date.months.long: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro']
|
||||
date.months.short: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']
|
||||
date.never: nunca
|
||||
date.now: agora
|
||||
date.today: Hoje
|
||||
date.weekdays.long: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado']
|
||||
|
@ -9,6 +9,7 @@ date.duration.weeks: ['неделя', 'нед']
|
||||
date.duration.years: ['год', 'г']
|
||||
date.months.long: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октября', 'Ноябрь', 'Декабрь']
|
||||
date.months.short: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек']
|
||||
date.never: никогда
|
||||
date.now: теперь
|
||||
date.today: Сегодня
|
||||
date.weekdays.long: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота']
|
||||
|
@ -8,9 +8,9 @@
|
||||
<div data-view="backups">
|
||||
<section class="section">
|
||||
<button type="button" class="button button-secondary mr-6" data-command="make-backup"><?= $this->icon('clock-rotate-left') ?> <?= $this->translate('panel.backup.backup') ?></button>
|
||||
<p class="mt-4 mb-0"><?= $this->translate('panel.tools.latestBackup') ?> <span class="text-bold backup-last-time"><?= $this->timedistance($backups[0]['timestamp']) ?></span></p>
|
||||
<p class="mt-4 mb-0"><?= $this->translate('panel.tools.latestBackup') ?> <span class="text-bold backup-last-time"><?= $backups->isEmpty() ? $this->translate('date.never') : $this->timedistance($backups->first()['timestamp']) ?></span></p>
|
||||
</section>
|
||||
|
||||
<?php if (!$backups->isEmpty()) : ?>
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<div class="caption"><?= $this->translate('panel.tools.latestBackups') ?></div>
|
||||
@ -38,6 +38,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<template id="backups-row">
|
||||
|
Loading…
x
Reference in New Issue
Block a user