From 6ec544e6d2f4c3788b2f0c13835b583c36c7f12d Mon Sep 17 00:00:00 2001 From: maTh Date: Tue, 13 Jun 2023 22:39:33 +0200 Subject: [PATCH] Improved: update page (#5420) * prependTitle() * do not need the "damn" in the alert * update page layout improved * release channel * i18n labels * add log messages while updating * Delete updatee.php * Update updateController.php * Update updateController.php * Update updateController.php * Update updateController.php * add getCurrentGitBranch() * Update updateController.php * state2 buttons * i18n * loading * Update feedback.php * Update feedback.php * Update feedback.php * Update extra.js * Apply suggestions from code review Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> * Update updateController.php * Update terminology * update button is now armed --------- Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Co-authored-by: Alexandre Alapetite --- app/Controllers/updateController.php | 34 +++++++++++++++--- app/Models/View.php | 2 ++ app/i18n/cz/admin.php | 9 +++++ app/i18n/de/admin.php | 9 +++++ app/i18n/el/admin.php | 9 +++++ app/i18n/el/feedback.php | 6 ++-- app/i18n/en-us/admin.php | 9 +++++ app/i18n/en-us/gen.php | 2 +- app/i18n/en/admin.php | 27 +++++++++----- app/i18n/en/conf.php | 6 ++-- app/i18n/en/feedback.php | 6 ++-- app/i18n/en/gen.php | 6 ++-- app/i18n/en/sub.php | 2 +- app/i18n/es/admin.php | 9 +++++ app/i18n/fr/admin.php | 9 +++++ app/i18n/he/admin.php | 9 +++++ app/i18n/id/admin.php | 13 +++++-- app/i18n/id/feedback.php | 6 ++-- app/i18n/it/admin.php | 9 +++++ app/i18n/ja/admin.php | 9 +++++ app/i18n/ko/admin.php | 9 +++++ app/i18n/lv/admin.php | 9 +++++ app/i18n/lv/conf.php | 2 +- app/i18n/nl/admin.php | 9 +++++ app/i18n/oc/admin.php | 9 +++++ app/i18n/pl/admin.php | 9 +++++ app/i18n/pt-br/admin.php | 9 +++++ app/i18n/ru/admin.php | 9 +++++ app/i18n/sk/admin.php | 9 +++++ app/i18n/tr/admin.php | 9 +++++ app/i18n/zh-cn/admin.php | 9 +++++ app/i18n/zh-tw/admin.php | 9 +++++ app/views/update/index.phtml | 53 +++++++++++++++++++++------- p/scripts/extra.js | 12 +++++++ p/themes/Origine/origine.css | 18 ++++++++++ p/themes/Origine/origine.rtl.css | 18 ++++++++++ 36 files changed, 346 insertions(+), 47 deletions(-) diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index a9cc8c334b1..24118409092 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -44,6 +44,16 @@ public static function migrateToGitEdge(): bool { return true; } + public static function getCurrentGitBranch(): string { + $output = []; + exec('git branch --show-current', $output, $return); + if ($return === 0) { + return 'git branch: ' . $output[0]; + } else { + return 'git'; + } + } + public static function hasGitUpdate(): bool { $cwd = getcwd(); if ($cwd === false) { @@ -72,6 +82,7 @@ public static function hasGitUpdate(): bool { /** @return string|true */ public static function gitPull() { + Minz_Log::notice(_t('admin.update.viaGit')); $cwd = getcwd(); if ($cwd === false) { Minz_Log::warning('getcwd() failed'); @@ -110,6 +121,8 @@ public function firstAction(): void { invalidateHttpCache(); + $this->view->is_release_channel_stable = $this->is_release_channel_stable(FRESHRSS_VERSION); + $this->view->update_to_apply = false; $this->view->last_update_time = 'unknown'; $timestamp = @filemtime(join_path(DATA_PATH, self::LASTUPDATEFILE)); @@ -144,7 +157,17 @@ public function indexAction(): void { } } + private function is_release_channel_stable(string $currentVersion): bool { + return strpos($currentVersion, 'dev') === false && + strpos($currentVersion, 'edge') === false; + } + + /* Check installation if there is a newer version. + via Git, if available. + Else via system configuration auto_update_url + */ public function checkAction(): void { + FreshRSS_View::prependTitle(_t('admin.update.title') . ' · '); $this->view->_path('update/index.phtml'); if (file_exists(UPDATE_FILENAME)) { @@ -160,11 +183,10 @@ public function checkAction(): void { if (self::isGit()) { if (self::hasGitUpdate()) { - $version = 'git'; + $version = self::getCurrentGitBranch(); } else { $this->view->message = array( 'status' => 'latest', - 'title' => _t('gen.short.damn'), 'body' => _t('feedback.update.none') ); @touch(join_path(DATA_PATH, self::LASTUPDATEFILE)); @@ -199,7 +221,6 @@ public function checkAction(): void { $this->view->message = array( 'status' => 'bad', - 'title' => _t('gen.short.damn'), 'body' => _t('feedback.update.server_not_found', $auto_update_url) ); return; @@ -210,7 +231,6 @@ public function checkAction(): void { if (strpos($status, 'UPDATE') !== 0) { $this->view->message = array( 'status' => 'latest', - 'title' => _t('gen.short.damn'), 'body' => _t('feedback.update.none') ); @touch(join_path(DATA_PATH, self::LASTUPDATEFILE)); @@ -220,6 +240,8 @@ public function checkAction(): void { $script = $res_array[1]; $version = explode(' ', $status, 2); $version = $version[1]; + + Minz_Log::notice(_t('admin.update.copiedFromURL', $auto_update_url)); } if (file_put_contents(UPDATE_FILENAME, $script) !== false) { @@ -228,7 +250,6 @@ public function checkAction(): void { } else { $this->view->message = array( 'status' => 'bad', - 'title' => _t('gen.short.damn'), 'body' => _t('feedback.update.error', 'Cannot save the update script') ); } @@ -253,8 +274,10 @@ public function applyAction(): void { if ($res === true) { @unlink(UPDATE_FILENAME); @file_put_contents(join_path(DATA_PATH, self::LASTUPDATEFILE), ''); + Minz_Log::notice(_t('feedback.update.finished')); Minz_Request::good(_t('feedback.update.finished')); } else { + Minz_Log::error(_t('feedback.update.error', $res)); Minz_Request::bad(_t('feedback.update.error', $res), [ 'c' => 'update', 'a' => 'index' ]); } } else { @@ -288,6 +311,7 @@ public function applyAction(): void { 'params' => array('post_conf' => '1') ), true); } else { + Minz_Log::error(_t('feedback.update.error', $res)); Minz_Request::bad(_t('feedback.update.error', $res), [ 'c' => 'update', 'a' => 'index' ]); } } diff --git a/app/Models/View.php b/app/Models/View.php index ca237971f64..f1bc5570747 100644 --- a/app/Models/View.php +++ b/app/Models/View.php @@ -71,6 +71,8 @@ class FreshRSS_View extends Minz_View { public $update_to_apply; /** @var array */ public $status_database; + /** @var bool */ + public $is_release_channel_stable; // Archiving /** @var int */ diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index 0653cedb048..44fa715c12a 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Aktualizace systému', 'apply' => 'Použít', + 'changelog' => 'Changelog', // TODO 'check' => 'Zkontrolovat aktualizace', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Vaše aktuální verze FreshRSS je %s.', 'last' => 'Poslední kontrola: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Žádné nové aktualizace', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Aktualizovat systém', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrátor', diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index a62773f2ef3..a191eab03d6 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'System aktualisieren', 'apply' => 'Anwenden', + 'changelog' => 'Changelog', // TODO 'check' => 'Auf neue Aktualisierungen prüfen', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Ihre aktuelle Version von FreshRSS ist %s.', 'last' => 'Letzte Überprüfung: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Keine ausstehende Aktualisierung', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'System aktualisieren', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrator', // IGNORE diff --git a/app/i18n/el/admin.php b/app/i18n/el/admin.php index 93d454c92c5..a80e656b976 100644 --- a/app/i18n/el/admin.php +++ b/app/i18n/el/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Ενημέρωση συστήματος', 'apply' => 'Εφαρμογή', + 'changelog' => 'Changelog', // TODO 'check' => 'Έλεγχος για νέες ενημερώσεις', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Η τρέχουσα έκδοση του FreshRSS είναι %s.', 'last' => 'Τελευταία επαλήθευση: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Δεν υπάρχουν ενημερώσεις', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Ενημέρωση συστήματος', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Διαχειριστής', diff --git a/app/i18n/el/feedback.php b/app/i18n/el/feedback.php index 8a012f82db7..1555d0e6671 100644 --- a/app/i18n/el/feedback.php +++ b/app/i18n/el/feedback.php @@ -120,11 +120,11 @@ 'renamed' => 'Label “%s” has been renamed to “%s”.', // TODO ), 'update' => array( - 'can_apply' => 'FreshRSS will now be updated to the version %s.', // TODO + 'can_apply' => 'FreshRSS will now be updated to the version %s.', // DIRTY 'error' => 'The update process has encountered an error: %s', // TODO - 'file_is_nok' => 'New version %s available, but check permissions on %s directory. HTTP server must have have write permission', // TODO + 'file_is_nok' => 'New version %s available, but check permissions on %s directory. HTTP server must have have write permission', // DIRTY 'finished' => 'Update complete!', // TODO - 'none' => 'No update to apply', // TODO + 'none' => 'No update to apply', // DIRTY 'server_not_found' => 'Update server cannot be found. [%s]', // TODO ), 'user' => array( diff --git a/app/i18n/en-us/admin.php b/app/i18n/en-us/admin.php index b276dfc1048..59d456eca85 100644 --- a/app/i18n/en-us/admin.php +++ b/app/i18n/en-us/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Update system', // IGNORE 'apply' => 'Apply', // IGNORE + 'changelog' => 'Changelog', // IGNORE 'check' => 'Check for new updates', // IGNORE + 'copiedFromURL' => 'update.php copied from %s to ./data', // IGNORE 'current_version' => 'Your current version of FreshRSS is %s.', // IGNORE 'last' => 'Last verification: %s', // IGNORE + 'loading' => 'Updating…', // IGNORE 'none' => 'No update to apply', // IGNORE + 'releaseChannel' => array( + '_' => 'Release channel', // IGNORE + 'edge' => 'Rolling release (“edge”)', // IGNORE + 'latest' => 'Stable release (“latest”)', // IGNORE + ), 'title' => 'Update system', // IGNORE + 'viaGit' => 'Update via git and Github.com started', // IGNORE ), 'user' => array( 'admin' => 'Administrator', // IGNORE diff --git a/app/i18n/en-us/gen.php b/app/i18n/en-us/gen.php index 4f367494a6e..12c8d486eea 100644 --- a/app/i18n/en-us/gen.php +++ b/app/i18n/en-us/gen.php @@ -200,7 +200,7 @@ 'clipboard' => 'Clipboard', // IGNORE 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Email', // IGNORE - 'email-webmail-firefox-fix' => 'Email (webmail - fix for Firefox)', // TODO + 'email-webmail-firefox-fix' => 'Email (webmail - fix for Firefox)', // IGNORE 'facebook' => 'Facebook', // IGNORE 'gnusocial' => 'GNU social', // IGNORE 'jdh' => 'Journal du hacker', // IGNORE diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index 226adddc5a7..cc7686367fd 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -184,19 +184,28 @@ 'title' => 'User registration form', ), 'tos' => array( - 'disabled' => 'is not given', // TODO - 'enabled' => 'is enabled', // TODO - 'help' => 'How to enable the Terms of Service', // TODO + 'disabled' => 'is not given', + 'enabled' => 'is enabled', + 'help' => 'How to enable the Terms of Service', ), ), 'update' => array( - '_' => 'Update system', - 'apply' => 'Apply', + '_' => 'Update FreshRSS', + 'apply' => 'Start update', + 'changelog' => 'Changelog', 'check' => 'Check for new updates', - 'current_version' => 'Your current version of FreshRSS is %s.', - 'last' => 'Last verification: %s', - 'none' => 'No update to apply', - 'title' => 'Update system', + 'copiedFromURL' => 'update.php copied from %s to ./data', + 'current_version' => 'Current installed version', + 'last' => 'Last check', + 'loading' => 'Updating…', + 'none' => 'No update available', + 'releaseChannel' => array( + '_' => 'Release channel', + 'edge' => 'Rolling release (“edge”)', + 'latest' => 'Stable release (“latest”)', + ), + 'title' => 'Update FreshRSS', + 'viaGit' => 'Update via git and Github.com started', ), 'user' => array( 'admin' => 'Administrator', diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index 4c99ae6a2a8..6f1805f9e09 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -33,9 +33,9 @@ 'display' => array( '_' => 'Display', 'darkMode' => array( - '_' => 'Automatic dark mode (beta)', // TODO - 'auto' => 'Auto', // TODO - 'no' => 'No', // TODO + '_' => 'Automatic dark mode (beta)', + 'auto' => 'Auto', + 'no' => 'No', ), 'icon' => array( 'bottom_line' => 'Bottom line', diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index af752d91608..1e69f8287d2 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -120,11 +120,11 @@ 'renamed' => 'Label “%s” has been renamed to “%s”.', ), 'update' => array( - 'can_apply' => 'FreshRSS will now be updated to the version %s.', + 'can_apply' => 'An update of FreshRSS is available: Version %s.', 'error' => 'The update process has encountered an error: %s', - 'file_is_nok' => 'New version %s available, but check permissions on %s directory. HTTP server must have have write permission', + 'file_is_nok' => 'An update of FreshRSS is available (Version %s), but check permissions on %s directory. HTTP server must have have write permission', 'finished' => 'Update complete!', - 'none' => 'No update to apply', + 'none' => 'No update available', 'server_not_found' => 'Update server cannot be found. [%s]', ), 'user' => array( diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index c1ee3a08ab5..a68abf3562a 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -175,7 +175,7 @@ 'queries' => 'User queries', 'reading' => 'Reading', 'search' => 'Search words or #tags', - 'search_help' => 'See documentation for advanced search parameters', // TODO + 'search_help' => 'See documentation for advanced search parameters', 'sharing' => 'Sharing', 'shortcuts' => 'Shortcuts', 'stats' => 'Statistics', @@ -196,11 +196,11 @@ 'archiveORG' => 'archive.org', 'archivePH' => 'archive.ph', 'blogotext' => 'Blogotext', - 'buffer' => 'Buffer', // IGNORE + 'buffer' => 'Buffer', 'clipboard' => 'Clipboard', 'diaspora' => 'Diaspora*', 'email' => 'Email', - 'email-webmail-firefox-fix' => 'Email (webmail - fix for Firefox)', // TODO + 'email-webmail-firefox-fix' => 'Email (webmail - fix for Firefox)', 'facebook' => 'Facebook', 'gnusocial' => 'GNU social', 'jdh' => 'Journal du hacker', diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index 7e7f4a2471c..1783aedc37e 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -122,7 +122,7 @@ 'xpath' => 'XPath for:', ), 'rss' => 'RSS / Atom (default)', - 'xml_xpath' => 'XML + XPath', // TODO + 'xml_xpath' => 'XML + XPath', ), 'maintenance' => array( 'clear_cache' => 'Clear cache', diff --git a/app/i18n/es/admin.php b/app/i18n/es/admin.php index e9e4168cd99..51f91dcda97 100644 --- a/app/i18n/es/admin.php +++ b/app/i18n/es/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Actualizar sistema', 'apply' => 'Aplicar', + 'changelog' => 'Changelog', // TODO 'check' => 'Buscar actualizaciones', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Dispones de la versión %s de FreshRSS.', 'last' => 'Última comprobación: %s', + 'loading' => 'Updating…', // TODO 'none' => 'No hay actualizaciones disponibles', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Actualizar sistema', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrador', diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index 12392f7b2ba..93da9814903 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Système de mise à jour', 'apply' => 'Appliquer la mise à jour', + 'changelog' => 'Journal des modifications', 'check' => 'Vérifier les mises à jour', + 'copiedFromURL' => 'update.php copié depuis %s vers ./data', 'current_version' => 'Votre version actuelle de FreshRSS est la %s.', 'last' => 'Dernière vérification : %s', + 'loading' => 'Mise à jour en cours…', 'none' => 'Aucune mise à jour à appliquer', + 'releaseChannel' => array( + '_' => 'Canal de publication', + 'edge' => 'Publication continue (“edge”)', + 'latest' => 'Publication stable (“latest”)', + ), 'title' => 'Système de mise à jour', + 'viaGit' => 'Mise à jour via git et Github.com démarrée', ), 'user' => array( 'admin' => 'Administrateur', diff --git a/app/i18n/he/admin.php b/app/i18n/he/admin.php index 4cff1bcc1cd..1322c0b1d2d 100644 --- a/app/i18n/he/admin.php +++ b/app/i18n/he/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'מערכת העדכון', 'apply' => 'החלת העדכון', + 'changelog' => 'Changelog', // TODO 'check' => 'בדיקת עדכונים חדשים', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Your current version of FreshRSS is the %s.', 'last' => 'תאריך בדיקה אחרון: %s', + 'loading' => 'Updating…', // TODO 'none' => 'אין עדכון להחלה', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'מערכת העדכון', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrator', // TODO diff --git a/app/i18n/id/admin.php b/app/i18n/id/admin.php index b301840ae88..84029dee723 100644 --- a/app/i18n/id/admin.php +++ b/app/i18n/id/admin.php @@ -190,13 +190,22 @@ ), ), 'update' => array( - '_' => 'Update system', // TODO - 'apply' => 'Apply', // TODO + '_' => 'Update system', // DIRTY + 'apply' => 'Apply', // DIRTY + 'changelog' => 'Changelog', // TODO 'check' => 'Periksa pembaruan baru', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Versi FreshRSS saat ini adalah %s.', 'last' => 'Verifikasi terakhir: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Tidak ada pembaruan untuk diterapkan', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Perbarui Sistem', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrator', // TODO diff --git a/app/i18n/id/feedback.php b/app/i18n/id/feedback.php index 1eefb9cbf35..5f0a1050d07 100644 --- a/app/i18n/id/feedback.php +++ b/app/i18n/id/feedback.php @@ -120,11 +120,11 @@ 'renamed' => 'Label “%s”has been renamed to “%s”.', // DIRTY ), 'update' => array( - 'can_apply' => 'FreshRSS will now be updated to the version %s.', // TODO + 'can_apply' => 'An update of FreshRSS is available: Version %s.', // TODO 'error' => 'The update process has encountered an error: %s', // TODO - 'file_is_nok' => 'New version %s available, but check permissions on %s directory. HTTP server must have have write permission', // TODO + 'file_is_nok' => 'An update of FreshRSS is available (Version %s), but check permissions on %s directory. HTTP server must have have write permission', // TODO 'finished' => 'Update complete!', // TODO - 'none' => 'No update to apply', // TODO + 'none' => 'No update available', // TODO 'server_not_found' => 'Update server cannot be found. [%s]', // TODO ), 'user' => array( diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index ec944567934..b6e631bf7f7 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Aggiornamento sistema', 'apply' => 'Applica', + 'changelog' => 'Changelog', // TODO 'check' => 'Controlla la presenza di nuovi aggiornamenti', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'FreshRSS versione %s.', 'last' => 'Ultima verifica: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Nessun aggiornamento da applicare', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Aggiorna sistema', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Amministratore', diff --git a/app/i18n/ja/admin.php b/app/i18n/ja/admin.php index 4cabe6ca78e..2aa15477b57 100644 --- a/app/i18n/ja/admin.php +++ b/app/i18n/ja/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'システムアップデート', 'apply' => '適用', + 'changelog' => 'Changelog', // TODO 'check' => 'アップデートを確認する', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'FreshRSS の現在のバージョンは %s です。', 'last' => '最近の検証: %s', + 'loading' => 'Updating…', // TODO 'none' => '更新を適用できません', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'アップデートシステム', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => '管理者', diff --git a/app/i18n/ko/admin.php b/app/i18n/ko/admin.php index 729fe372038..db119ae6e83 100644 --- a/app/i18n/ko/admin.php +++ b/app/i18n/ko/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => '업데이트', 'apply' => '업데이트 적용하기', + 'changelog' => 'Changelog', // TODO 'check' => '새 업데이트 확인하기', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => '현재 FreshRSS 버전은 %s 입니다.', 'last' => '마지막 확인: %s', + 'loading' => 'Updating…', // TODO 'none' => '적용 가능한 업데이트가 없습니다', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => '업데이트', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => '관리자', diff --git a/app/i18n/lv/admin.php b/app/i18n/lv/admin.php index 1ae1e1f2ebb..5a6d0066bee 100644 --- a/app/i18n/lv/admin.php +++ b/app/i18n/lv/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Atjaunināt sistēmu', 'apply' => 'Pieteikties', + 'changelog' => 'Changelog', // TODO 'check' => 'Jaunu atjauninājumu pārbaude', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Jūsu pašreizējā FreshRSS versija ir %s.', 'last' => 'Pēdējā verifikācija: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Nav jāpiemēro atjauninājums', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Atjaunināt sistēmu', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrators', diff --git a/app/i18n/lv/conf.php b/app/i18n/lv/conf.php index 24e0c031afa..993667d8a26 100644 --- a/app/i18n/lv/conf.php +++ b/app/i18n/lv/conf.php @@ -208,7 +208,7 @@ 'scroll' => 'ritināšanas laikā', 'upon_gone' => 'kad tas vairs nav augšupējā ziņu barotnē', 'upon_reception' => 'pēc raksta saņemšanas', - 'when' => 'Atzīmēt rakstu kā izlasītu...', + 'when' => 'Atzīmēt rakstu kā izlasītu…', 'when_same_title' => 'ja identisks virsraksts jau ir jaunākajos n rakstos', ), 'show' => array( diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index edf2ca56395..96188137225 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Versie controle', 'apply' => 'Toepassen', + 'changelog' => 'Changelog', // TODO 'check' => 'Controleer op nieuwe versies', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Uw huidige versie van FreshRSS is %s.', 'last' => 'Laatste controle: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Geen nieuwe versie om toe te passen', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Vernieuw systeem', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Beheerder', diff --git a/app/i18n/oc/admin.php b/app/i18n/oc/admin.php index b90c03525f6..8f5df88ec40 100644 --- a/app/i18n/oc/admin.php +++ b/app/i18n/oc/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Sistèma de mesa a jorn', 'apply' => 'Aplicar', + 'changelog' => 'Changelog', // TODO 'check' => 'Verificar las mesas a jorn', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Vòstra version actuala de FreshRSS es %s.', 'last' => 'Darrièra verificacion : %s', + 'loading' => 'Updating…', // TODO 'none' => 'Cap d’actualizacion d’aplicar', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Sistèma de mesa a jorn', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrator', // IGNORE diff --git a/app/i18n/pl/admin.php b/app/i18n/pl/admin.php index ce667022455..30ec887189b 100644 --- a/app/i18n/pl/admin.php +++ b/app/i18n/pl/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Aktualizacja', 'apply' => 'Zastosuj', + 'changelog' => 'Changelog', // TODO 'check' => 'Szukaj uaktualnień', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Używana wersja FreshRSS to %s.', 'last' => 'Ostatnie sprawdzenie: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Brak nowych aktualizacji', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Aktualizacja', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrator', // IGNORE diff --git a/app/i18n/pt-br/admin.php b/app/i18n/pt-br/admin.php index d8de8b236e1..b9463d103f9 100644 --- a/app/i18n/pt-br/admin.php +++ b/app/i18n/pt-br/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Atualização do sistema', 'apply' => 'Aplicar', + 'changelog' => 'Changelog', // TODO 'check' => 'Buscar por novas atualizações', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Sua versão do FreshRSS é %s.', 'last' => 'Última verificação: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Nenhuma atualização para se aplicar', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Sistema de atualização', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrador', diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php index 0ddf851a1f4..c77bf5ec67a 100644 --- a/app/i18n/ru/admin.php +++ b/app/i18n/ru/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Обновление системы', 'apply' => 'Применить', + 'changelog' => 'Changelog', // TODO 'check' => 'Проверить обновления', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Ваша текущая версия FreshRSS: %s.', 'last' => 'Последняя проверка: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Нет обновлений', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Обновить систему', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Администратор', diff --git a/app/i18n/sk/admin.php b/app/i18n/sk/admin.php index 364bf1f06aa..445d02b2eba 100644 --- a/app/i18n/sk/admin.php +++ b/app/i18n/sk/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Aktualizácia systému', 'apply' => 'Použiť', + 'changelog' => 'Changelog', // TODO 'check' => 'Skontrolovať aktualizácie', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Vaša aktuálna verzia FreshRSS: %s', 'last' => 'Posledná kontrola: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Žiadna nová aktualizácia', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Aktualizácia systému', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Administrátor', diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php index 376ce5d472d..0626c840c51 100644 --- a/app/i18n/tr/admin.php +++ b/app/i18n/tr/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => 'Sistem güncelleme', 'apply' => 'Uygula', + 'changelog' => 'Changelog', // TODO 'check' => 'Güncelleme kontrolü', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => 'Mevcut FreshRSS sürümünüz %s.', 'last' => 'Son kontrol: %s', + 'loading' => 'Updating…', // TODO 'none' => 'Yeni güncelleme yok', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => 'Sistem güncelleme', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => 'Yönetici', diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index 0a8a35a8a3c..6010cb04741 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => '更新系统', 'apply' => '应用', + 'changelog' => 'Changelog', // TODO 'check' => '检查更新', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => '当前 FreshRSS 版本为 %s。', 'last' => '上次检查:%s', + 'loading' => 'Updating…', // TODO 'none' => '没有可用更新', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => '更新系统', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => '管理员', diff --git a/app/i18n/zh-tw/admin.php b/app/i18n/zh-tw/admin.php index e1c1e3eef07..a7c0b08318a 100644 --- a/app/i18n/zh-tw/admin.php +++ b/app/i18n/zh-tw/admin.php @@ -192,11 +192,20 @@ 'update' => array( '_' => '更新系統', 'apply' => '應用', + 'changelog' => 'Changelog', // TODO 'check' => '檢查更新', + 'copiedFromURL' => 'update.php copied from %s to ./data', // TODO 'current_version' => '當前 FreshRSS 版本為 %s。', 'last' => '上次檢查:%s', + 'loading' => 'Updating…', // TODO 'none' => '沒有可用更新', + 'releaseChannel' => array( + '_' => 'Release channel', // TODO + 'edge' => 'Rolling release (“edge”)', // TODO + 'latest' => 'Stable release (“latest”)', // TODO + ), 'title' => '系統更新', + 'viaGit' => 'Update via git and Github.com started', // TODO ), 'user' => array( 'admin' => '管理員', diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml index d2838a5a5a2..2210b952030 100644 --- a/app/views/update/index.phtml +++ b/app/views/update/index.phtml @@ -10,14 +10,6 @@

-

- -

- -

- last_update_time) ?> -

- message)) { ?>

- message['title'] ?> message['body'] ?>

+
+ +
+ () +
+
+ +
+ +
+ is_release_channel_stable) { ?> + + + + + + + + +
+
+ +
+ +
+ last_update_time ?> +
+
+ message) || $this->message['status'] !== 'good') { ?> -

- -

+
+
+ +
+
update_to_apply) { ?> - +
+
+ + +
+
diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 08037b1d21a..8fa0a5c5cd7 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -261,6 +261,17 @@ function data_leave_validation(parent, excludeForm = null) { return true; } +function init_2stateButton() { + const btns = document.getElementsByClassName('btn-state1'); + Array.prototype.forEach.call(btns, function (el) { + el.addEventListener('click', function () { + const btnState2 = document.getElementById(el.dataset.state2Id); + btnState2.classList.add('show'); + this.classList.add('hide'); + }); + }); +} + function init_configuration_alert() { window.onsubmit = function (e) { window.hasSubmit = data_leave_validation(document.body, e.submitter ? e.submitter.form : null); @@ -288,6 +299,7 @@ function init_extra_afterDOM() { init_password_observers(document.body); init_select_observers(); init_configuration_alert(); + init_2stateButton(); const slider = document.getElementById('slider'); if (slider) { diff --git a/p/themes/Origine/origine.css b/p/themes/Origine/origine.css index 1538bbce8dd..34d6ce4512d 100644 --- a/p/themes/Origine/origine.css +++ b/p/themes/Origine/origine.css @@ -283,6 +283,24 @@ form th { text-decoration: none; } +.btn-state1.hide { + display: none; +} + +.btn-state2 { + display: none; +} + +.btn-state2.show { + display: inline-block; +} + +#button-update-loading { + background: var(--frss-loading-image) 0.5rem center no-repeat; + background-size: 1rem; + padding-left: 2rem; +} + a:hover .icon { filter: brightness(1.5); transition: 0.1s linear; diff --git a/p/themes/Origine/origine.rtl.css b/p/themes/Origine/origine.rtl.css index f4e647ebb87..285c514c05f 100644 --- a/p/themes/Origine/origine.rtl.css +++ b/p/themes/Origine/origine.rtl.css @@ -283,6 +283,24 @@ form th { text-decoration: none; } +.btn-state1.hide { + display: none; +} + +.btn-state2 { + display: none; +} + +.btn-state2.show { + display: inline-block; +} + +#button-update-loading { + background: var(--frss-loading-image) 0.5rem center no-repeat; + background-size: 1rem; + padding-right: 2rem; +} + a:hover .icon { filter: brightness(1.5); transition: 0.1s linear;