diff --git a/.template-lintrc.js b/.template-lintrc.js index 29bf4202984..801225fd338 100644 --- a/.template-lintrc.js +++ b/.template-lintrc.js @@ -12,6 +12,7 @@ module.exports = { "no-unused-block-params": true, "no-unbound": true, "simple-unless": true, - "no-triple-curlies": true + "no-triple-curlies": true, + "no-partial": true } }; diff --git a/app/assets/javascripts/admin/templates/dashboard-problems.hbs b/app/assets/javascripts/admin/templates/components/dashboard-problems.hbs similarity index 84% rename from app/assets/javascripts/admin/templates/dashboard-problems.hbs rename to app/assets/javascripts/admin/templates/components/dashboard-problems.hbs index 5f95987e738..cb8311a4e3c 100644 --- a/app/assets/javascripts/admin/templates/dashboard-problems.hbs +++ b/app/assets/javascripts/admin/templates/components/dashboard-problems.hbs @@ -18,7 +18,7 @@

- {{d-button action=(action "refreshProblems") class="btn-default" icon="sync" label="admin.dashboard.refresh_problems"}} + {{d-button action=refreshProblems class="btn-default" icon="sync" label="admin.dashboard.refresh_problems"}} {{i18n 'admin.dashboard.last_checked'}}: {{problemsTimestamp}}

{{/conditional-loading-section}} diff --git a/app/assets/javascripts/admin/templates/components/version-checks.hbs b/app/assets/javascripts/admin/templates/components/version-checks.hbs new file mode 100644 index 00000000000..aa2fcc97c00 --- /dev/null +++ b/app/assets/javascripts/admin/templates/components/version-checks.hbs @@ -0,0 +1,135 @@ +
+

+ {{i18n "admin.dashboard.version"}} +

+
+ +
+
+

+ {{i18n "admin.dashboard.installed_version"}} +

+

+ {{dash-if-empty versionCheck.installed_version}} +

+ {{#if versionCheck.gitLink}} + + {{/if}} +
+ {{#if versionCheck.noCheckPerformed}} +
+

+ {{i18n "admin.dashboard.latest_version"}} +

+

+ — +

+
+
+
+ + {{d-icon "far-frown"}} + +
+
+ + {{i18n "admin.dashboard.no_check_performed"}} + +
+
+ {{else if versionCheck.stale_data}} +
+

+ {{i18n "admin.dashboard.latest_version"}} +

+

+ {{#if versionCheck.version_check_pending}} + {{dash-if-empty versionCheck.installed_version}} + {{/if}} +

+
+
+
+ {{#if versionCheck.version_check_pending}} + + {{d-icon "far-smile"}} + + {{else}} + + {{d-icon "far-frown"}} + + {{/if}} +
+
+ + {{#if versionCheck.version_check_pending}} + {{i18n "admin.dashboard.version_check_pending"}} + {{else}} + {{i18n "admin.dashboard.stale_data"}} + {{/if}} + +
+
+ {{else}} +
+

+ {{i18n "admin.dashboard.latest_version"}} +

+

+ {{dash-if-empty versionCheck.latest_version}} +

+
+
+
+ {{#if versionCheck.upToDate}} + + {{d-icon "far-smile"}} + + {{else}} + + {{#if versionCheck.behindByOneVersion}} + {{d-icon "meh-o"}} + {{else}} + {{d-icon "far-frown"}} + {{/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}} +
+
+ {{/if}} + {{custom-html + name="upgrade-header" + versionCheck=versionCheck + tagName="div" + classNames="upgrade-header" + }} +
diff --git a/app/assets/javascripts/admin/templates/dashboard.hbs b/app/assets/javascripts/admin/templates/dashboard.hbs index 8ca74d79b56..cbbd34b4b2e 100644 --- a/app/assets/javascripts/admin/templates/dashboard.hbs +++ b/app/assets/javascripts/admin/templates/dashboard.hbs @@ -3,12 +3,18 @@ {{#if showVersionChecks}}
- {{partial "admin/templates/version-checks"}} + {{version-checks versionCheck=versionCheck}}
{{/if}} -{{partial "admin/templates/dashboard-problems"}} +{{dashboard-problems + loadingProblems=loadingProblems + foundProblems=foundProblems + problems=problems + problemsTimestamp=problemsTimestamp + refreshProblems=(action "refreshProblems") +}}