mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 19:30:23 -06:00
Admin dashboard: use ember's class name binding
This commit is contained in:
parent
cd6c1de5b0
commit
4e15227fd0
@ -1,7 +1,7 @@
|
||||
<h3>{{i18n admin.dashboard.welcome}}</h3>
|
||||
|
||||
{{#if Discourse.SiteSettings.version_checks}}
|
||||
<p {{bindAttr class="view.priorityClass"}}>
|
||||
<p {{bindAttr class=":version-check versionCheck.critical_updates:critical:normal"}}>
|
||||
{{#if loading }}
|
||||
{{i18n loading}}
|
||||
{{else}}
|
||||
@ -15,7 +15,7 @@
|
||||
{{#if versionCheck.upToDate }}
|
||||
<i class='icon icon-ok update-to-date'></i> {{i18n admin.dashboard.up_to_date}}
|
||||
{{else}}
|
||||
<i {{bindAttr class="view.updateIconClasses"}}></i>
|
||||
<i {{bindAttr class=":icon :icon-warning-sign versionCheck.critical_updates:critical-updates-available:updates-available"}}></i>
|
||||
<span class="critical-note">{{i18n admin.dashboard.critical_available}}</span>
|
||||
<span class="normal-note">{{i18n admin.dashboard.updates_available}}</span>
|
||||
{{i18n admin.dashboard.please_upgrade}}
|
||||
|
@ -7,25 +7,7 @@
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminDashboardView = Discourse.View.extend({
|
||||
templateName: 'admin/templates/dashboard',
|
||||
|
||||
updateIconClasses: function() {
|
||||
var classes;
|
||||
classes = "icon icon-warning-sign ";
|
||||
if (this.get('controller.versionCheck.critical_updates')) {
|
||||
classes += "critical-updates-available";
|
||||
} else {
|
||||
classes += "updates-available";
|
||||
}
|
||||
return classes;
|
||||
}.property('controller.versionCheck.critical_updates'),
|
||||
|
||||
priorityClass: function() {
|
||||
if (this.get('controller.versionCheck.critical_updates')) {
|
||||
return 'version-check critical';
|
||||
}
|
||||
return 'version-check normal';
|
||||
}.property('controller.versionCheck.critical_updates')
|
||||
templateName: 'admin/templates/dashboard'
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user