Преглед изворни кода

Move button to apply update outside the message

Marien Fressinaud пре 11 година
родитељ
комит
a3b5e72729
4 измењених фајлова са 11 додато и 3 уклоњено
  1. 3 1
      app/Controllers/updateController.php
  2. 2 1
      app/i18n/en.php
  3. 2 1
      app/i18n/fr.php
  4. 4 0
      app/views/update/index.phtml

+ 3 - 1
app/Controllers/updateController.php

@@ -11,6 +11,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 		}
 
 		Minz_View::prependTitle(_t('update_system') . ' · ');
+		$this->view->update_to_apply = false;
 		$this->view->last_update_time = 'unknown';
 		$this->view->check_last_hour = false;
 		$timestamp = (int)@file_get_contents(DATA_PATH . '/last_update.txt');
@@ -29,10 +30,11 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 			);
 		} elseif (file_exists(UPDATE_FILENAME)) {
 			// There is an update file to apply!
+			$this->view->update_to_apply = true;
 			$this->view->message = array(
 				'status' => 'good',
 				'title' => _t('ok'),
-				'body' => _t('update_can_apply', _url('update', 'apply'))
+				'body' => _t('update_can_apply')
 			);
 		}
 	}

+ 2 - 1
app/i18n/en.php

@@ -428,7 +428,8 @@ return array (
 	'update_system'			=> 'Update system',
 	'update_check'			=> 'Check for new updates',
 	'update_last'			=> 'Last verification: %s',
-	'update_can_apply'		=> 'There is an available update. <a class="btn" href="%s">Apply</a>',
+	'update_can_apply'		=> 'There is an available update.',
+	'update_apply'			=> 'Apply',
 	'update_server_not_found'	=> 'Update server cannot be found. [%s]',
 	'no_update'			=> 'No update to apply',
 	'update_problem'		=> 'Update has encountered an error: %s',

+ 2 - 1
app/i18n/fr.php

@@ -428,7 +428,8 @@ return array (
 	'update_system'			=> 'Système de mise à jour',
 	'update_check'			=> 'Vérifier les mises à jour',
 	'update_last'			=> 'Dernière vérification : %s',
-	'update_can_apply'		=> 'Il y’a une mise à jour à appliquer. <a class="btn" href="%s">Appliquer la mise à jour</a>',
+	'update_can_apply'		=> 'Il y’a une mise à jour à appliquer.',
+	'update_apply'			=> 'Appliquer la mise à jour',
 	'update_server_not_found'	=> 'Le serveur de mise à jour n’a pas été trouvé. [%s]',
 	'no_update'			=> 'Aucune mise à jour à appliquer',
 	'update_problem'		=> 'La mise à jour a rencontré un problème : %s',

+ 4 - 0
app/views/update/index.phtml

@@ -29,4 +29,8 @@
 		<a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('update_check'); ?></a>
 	</p>
 	<?php } ?>
+
+	<?php if ($this->update_to_apply) { ?>
+	<a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('update_apply'); ?></a>
+	<?php } ?>
 </div>