From 7c12aeb848fcb2aee00f27b5a12d8eed6c421df6 Mon Sep 17 00:00:00 2001 From: riking Date: Wed, 5 Feb 2014 17:22:10 -0800 Subject: [PATCH] Extract version check in dashboard to own template --- .../admin/templates/dashboard.js.handlebars | 74 +------------------ .../templates/version_checks.js.handlebars | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+), 73 deletions(-) create mode 100644 app/assets/javascripts/admin/templates/version_checks.js.handlebars diff --git a/app/assets/javascripts/admin/templates/dashboard.js.handlebars b/app/assets/javascripts/admin/templates/dashboard.js.handlebars index b42f0e4a02d..5ce21a49a51 100644 --- a/app/assets/javascripts/admin/templates/dashboard.js.handlebars +++ b/app/assets/javascripts/admin/templates/dashboard.js.handlebars @@ -34,79 +34,7 @@ {{/if}} {{#if Discourse.SiteSettings.version_checks}} -
- - - - - - - - - - - {{#unless loading}} - - - - - {{#if versionCheck.noCheckPerformed}} - - - - {{else}} - {{#if versionCheck.staleData}} - - - - {{else}} - - - - {{/if}} - {{/if}} - - {{/unless}} -
 {{i18n admin.dashboard.installed_version}}{{i18n admin.dashboard.latest_version}}  
{{i18n admin.dashboard.version}}{{ versionCheck.installed_version }}  - - - {{i18n admin.dashboard.no_check_performed}} -   - {{#if versionCheck.version_check_pending}} - - {{else}} - - {{/if}} - - - {{#if versionCheck.version_check_pending}} - {{i18n admin.dashboard.version_check_pending}} - {{else}} - {{i18n admin.dashboard.stale_data}} - {{/if}} - - {{ versionCheck.latest_version }} - {{#if versionCheck.upToDate }} - - {{else}} - - {{#if versionCheck.behindByOneVersion}} - ☺ - {{else}} - ☹ - {{/if}} - - {{/if}} - - {{#if versionCheck.upToDate }} - {{i18n admin.dashboard.up_to_date}} - {{else}} - {{i18n admin.dashboard.critical_available}} - {{i18n admin.dashboard.updates_available}} - {{i18n admin.dashboard.please_upgrade}} - {{/if}} -
-
+ {{ render 'admin/templates/version_checks' controller }} {{/if}}
diff --git a/app/assets/javascripts/admin/templates/version_checks.js.handlebars b/app/assets/javascripts/admin/templates/version_checks.js.handlebars new file mode 100644 index 00000000000..13055a3fe7d --- /dev/null +++ b/app/assets/javascripts/admin/templates/version_checks.js.handlebars @@ -0,0 +1,74 @@ + +
+ + + + + + + + + + + {{#unless loading}} + + + + + {{#if versionCheck.noCheckPerformed}} + + + + {{else}} + {{#if versionCheck.staleData}} + + + + {{else}} + + + + {{/if}} + {{/if}} + + {{/unless}} +
 {{i18n admin.dashboard.installed_version}}{{i18n admin.dashboard.latest_version}}  
{{i18n admin.dashboard.version}}{{ versionCheck.installed_version }}  + + + {{i18n admin.dashboard.no_check_performed}} +   + {{#if versionCheck.version_check_pending}} + + {{else}} + + {{/if}} + + + {{#if versionCheck.version_check_pending}} + {{i18n admin.dashboard.version_check_pending}} + {{else}} + {{i18n admin.dashboard.stale_data}} + {{/if}} + + {{ versionCheck.latest_version }} + {{#if versionCheck.upToDate }} + + {{else}} + + {{#if versionCheck.behindByOneVersion}} + ☺ + {{else}} + ☹ + {{/if}} + + {{/if}} + + {{#if versionCheck.upToDate }} + {{i18n admin.dashboard.up_to_date}} + {{else}} + {{i18n admin.dashboard.critical_available}} + {{i18n admin.dashboard.updates_available}} + {{i18n admin.dashboard.please_upgrade}} + {{/if}} +
+