Fixes many Ember 1.9.0 deprecations

This commit is contained in:
Robin Ward 2014-12-12 13:28:20 -05:00
parent 331bba4b6d
commit f3babdb319
48 changed files with 417 additions and 436 deletions

View File

@ -1,17 +0,0 @@
/**
Return the count of users at the given trust level.
@method valueAtTrustLevel
@for Handlebars
**/
Handlebars.registerHelper('valueAtTrustLevel', function(property, trustLevel) {
var data = Ember.Handlebars.get(this, property);
if( data ) {
var item = data.find( function(d) { return parseInt(d.x,10) === parseInt(trustLevel,10); } );
if( item ) {
return item.y;
} else {
return 0;
}
}
});

View File

@ -0,0 +1,13 @@
import registerUnbound from 'discourse/helpers/register-unbound';
registerUnbound('value-at-tl', function(data, params) {
var tl = parseInt(params.level, 10);
if (data) {
var item = data.find( function(d) { return parseInt(d.x, 10) === tl; } );
if (item) {
return item.y;
} else {
return 0;
}
}
});

View File

@ -9,16 +9,13 @@ Discourse.SiteSetting = Discourse.Model.extend({
**/ **/
enabled: function(key, value) { enabled: function(key, value) {
if (arguments.length === 1) { if (arguments.length > 1) {
// get the boolean value of the setting
if (this.blank('value')) return false;
return this.get('value') === 'true';
} else {
// set the boolean value of the setting
this.set('value', value ? 'true' : 'false'); this.set('value', value ? 'true' : 'false');
} }
if (this.blank('value')) return false;
return this.get('value') === 'true';
}.property('value'), }.property('value'),
/** /**

View File

@ -1,8 +1,3 @@
var _fieldTypes = [
Ember.Object.create({id: 'text', name: I18n.t('admin.user_fields.field_types.text') }),
Ember.Object.create({id: 'confirm', name: I18n.t('admin.user_fields.field_types.confirm') })
];
var UserField = Ember.Object.extend({ var UserField = Ember.Object.extend({
destroy: function() { destroy: function() {
var self = this; var self = this;
@ -43,11 +38,18 @@ UserField.reopenClass({
}, },
fieldTypes: function() { fieldTypes: function() {
return _fieldTypes; if (!this._fieldTypes) {
this._fieldTypes = [
Ember.Object.create({id: 'text', name: I18n.t('admin.user_fields.field_types.text') }),
Ember.Object.create({id: 'confirm', name: I18n.t('admin.user_fields.field_types.confirm') })
];
}
return this._fieldTypes;
}, },
fieldTypeById: function(id) { fieldTypeById: function(id) {
return _fieldTypes.findBy('id', id); return this.fieldTypes().findBy('id', id);
} }
}); });

View File

@ -1,13 +1,4 @@
/**
Handles email routes
@class AdminEmailRoute
@extends Discourse.Route
@namespace Discourse
@module Discourse
**/
Discourse.AdminEmailIndexRoute = Discourse.Route.extend({ Discourse.AdminEmailIndexRoute = Discourse.Route.extend({
model: function() { model: function() {
return Discourse.EmailSettings.find(); return Discourse.EmailSettings.find();
}, },

View File

@ -5,21 +5,21 @@
<th>{{i18n 'admin.api.user'}}</th> <th>{{i18n 'admin.api.user'}}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
{{#each model}} {{#each k in model}}
<tr> <tr>
<td class='key'>{{key}}</td> <td class='key'>{{k.key}}</td>
<td> <td>
{{#if user}} {{#if k.user}}
{{#link-to 'adminUser' user}} {{#link-to 'adminUser' k.user}}
{{avatar user imageSize="small"}} {{avatar k.user imageSize="small"}}
{{/link-to}} {{/link-to}}
{{else}} {{else}}
{{i18n 'admin.api.all_users'}} {{i18n 'admin.api.all_users'}}
{{/if}} {{/if}}
</td> </td>
<td> <td>
<button class='btn' {{action "regenerateKey" this}}><i class="fa fa-undo"></i>{{i18n 'admin.api.regenerate'}}</button> <button class='btn' {{action "regenerateKey" k}}><i class="fa fa-undo"></i>{{i18n 'admin.api.regenerate'}}</button>
<button class='btn' {{action "revokeKey" this}}><i class="fa fa-times"></i>{{i18n 'admin.api.revoke'}}</button> <button class='btn' {{action "revokeKey" k}}><i class="fa fa-times"></i>{{i18n 'admin.api.revoke'}}</button>
</td> </td>
</tr> </tr>
{{/each}} {{/each}}

View File

@ -26,21 +26,21 @@
<div> <div>
<label for="badge_type_id">{{i18n 'admin.badges.badge_type'}}</label> <label for="badge_type_id">{{i18n 'admin.badges.badge_type'}}</label>
{{view Ember.Select name="badge_type_id" {{view "select" name="badge_type_id"
value=buffered.badge_type_id value=buffered.badge_type_id
content=badgeTypes content=badgeTypes
optionValuePath="content.id" optionValuePath="content.id"
optionLabelPath="content.name" optionLabelPath="content.name"
disabled=readOnly}} disabled=readOnly}}
</div> </div>
<div> <div>
<label for="badge_grouping_id">{{i18n 'admin.badges.badge_grouping'}}</label> <label for="badge_grouping_id">{{i18n 'admin.badges.badge_grouping'}}</label>
{{view Ember.Select name="badge_grouping_id" {{view "select" name="badge_grouping_id"
value=buffered.badge_grouping_id value=buffered.badge_grouping_id
content=badgeGroupings content=badgeGroupings
optionValuePath="content.id" optionValuePath="content.id"
optionLabelPath="content.name"}} optionLabelPath="content.name"}}
&nbsp;<button {{action "editGroupings"}} class='btn'>{{fa-icon 'pencil'}}</button> &nbsp;<button {{action "editGroupings"}} class='btn'>{{fa-icon 'pencil'}}</button>
</div> </div>
@ -83,12 +83,12 @@
<div> <div>
<label for="trigger">{{i18n 'admin.badges.trigger'}}</label> <label for="trigger">{{i18n 'admin.badges.trigger'}}</label>
{{view Ember.Select name="trigger" {{view "select" name="trigger"
value=buffered.trigger value=buffered.trigger
content=badgeTriggers content=badgeTriggers
optionValuePath="content.id" optionValuePath="content.id"
optionLabelPath="content.name" optionLabelPath="content.name"
disabled=readOnly}} disabled=readOnly}}
</div> </div>
{{/if}} {{/if}}

View File

@ -3,11 +3,11 @@
<div class='content-list span6'> <div class='content-list span6'>
<h3>{{i18n 'admin.badges.title'}}</h3> <h3>{{i18n 'admin.badges.title'}}</h3>
<ul> <ul>
{{#each}} {{#each badge in model}}
<li> <li>
{{#link-to 'adminBadges.show' id}} {{#link-to 'adminBadges.show' badge.id}}
{{badge-button badge=this}} {{badge-button badge=badge}}
{{#if newBadge}} {{#if badge.newBadge}}
<span class="list-badge">{{i18n 'filters.new.lower_title'}}</span> <span class="list-badge">{{i18n 'filters.new.lower_title'}}</span>
{{/if}} {{/if}}
{{/link-to}} {{/link-to}}

View File

@ -1,9 +1,9 @@
<div class='content-list span6'> <div class='content-list span6'>
<h3>{{i18n 'admin.customize.colors.long_title'}}</h3> <h3>{{i18n 'admin.customize.colors.long_title'}}</h3>
<ul> <ul>
{{#each model}} {{#each scheme in model}}
{{#unless is_base}} {{#unless scheme.is_base}}
<li><a {{action "selectColorScheme" this}} {{bind-attr class="selected:active"}}>{{description}}</a></li> <li><a {{action "selectColorScheme" scheme}} {{bind-attr class="scheme.selected:active"}}>{{scheme.description}}</a></li>
{{/unless}} {{/unless}}
{{/each}} {{/each}}
</ul> </ul>
@ -13,23 +13,21 @@
{{#if selectedItem}} {{#if selectedItem}}
<div class="current-style color-scheme"> <div class="current-style color-scheme">
<div class="admin-container"> <div class="admin-container">
{{#with selectedItem}} <h1>{{text-field class="style-name" value=selectedItem.name}}</h1>
<h1>{{text-field class="style-name" value=name}}</h1>
<div class="controls"> <div class="controls">
<button {{action "save"}} {{bind-attr disabled="disableSave"}} class='btn'>{{i18n 'admin.customize.save'}}</button> <button {{action "save"}} {{bind-attr disabled="selectedItem.disableSave"}} class='btn'>{{i18n 'admin.customize.save'}}</button>
<button {{action "toggleEnabled"}} {{bind-attr disabled="disableEnable"}} class="btn"> <button {{action "toggleEnabled"}} {{bind-attr disabled="selectedItem.disableEnable"}} class="btn">
{{#if enabled}} {{#if selectedItem.enabled}}
{{i18n 'disable'}} {{i18n 'disable'}}
{{else}} {{else}}
{{i18n 'enable'}} {{i18n 'enable'}}
{{/if}} {{/if}}
</button> </button>
<button {{action "copy" this}} class='btn'><i class="fa fa-copy"></i> {{i18n 'admin.customize.copy'}}</button> <button {{action "copy" selectedItem}} class='btn'><i class="fa fa-copy"></i> {{i18n 'admin.customize.copy'}}</button>
<button {{action "destroy"}} class='btn btn-danger'><i class="fa fa-trash-o"></i> {{i18n 'admin.customize.delete'}}</button> <button {{action "destroy"}} class='btn btn-danger'><i class="fa fa-trash-o"></i> {{i18n 'admin.customize.delete'}}</button>
<span {{bind-attr class=":saving savingStatus::hidden" }}>{{savingStatus}}</span> <span {{bind-attr class=":saving selectedItem.savingStatus::hidden" }}>{{selectedItem.savingStatus}}</span>
</div> </div>
{{/with}}
<br/> <br/>
@ -52,17 +50,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#each colors}} {{#each c in colors}}
<tr {{bind-attr class="changed valid:valid:invalid"}}> <tr {{bind-attr class="c.changed c.valid:valid:invalid"}}>
<td class="name" {{bind-attr title="name"}}> <td class="name" {{bind-attr title="c.name"}}>
<b>{{translatedName}}</b> <b>{{c.translatedName}}</b>
<br/> <br/>
<span class="description">{{description}}</span> <span class="description">{{c.description}}</span>
</td> </td>
<td class="hex">{{color-input hexValue=hex brightnessValue=brightness valid=valid}}</td> <td class="hex">{{color-input hexValue=c.hex brightnessValue=c.brightness valid=c.valid}}</td>
<td class="actions"> <td class="actions">
<button {{bind-attr class=":btn :revert savedIsOverriden::invisible"}} {{action "revert" this}} title="{{i18n 'admin.customize.colors.revert_title'}}">{{i18n 'revert'}}</button> <button {{bind-attr class=":btn :revert c.savedIsOverriden::invisible"}} {{action "revert" c}} title="{{i18n 'admin.customize.colors.revert_title'}}">{{i18n 'revert'}}</button>
<button {{bind-attr class=":btn :undo changed::invisible"}} {{action "undo" this}} title="{{i18n 'admin.customize.colors.undo_title'}}">{{i18n 'undo'}}</button> <button {{bind-attr class=":btn :undo c.changed::invisible"}} {{action "undo" c}} title="{{i18n 'admin.customize.colors.undo_title'}}">{{i18n 'undo'}}</button>
</td> </td>
</tr> </tr>
{{/each}} {{/each}}

View File

@ -1,8 +1,8 @@
<div class='content-list span6'> <div class='content-list span6'>
<h3>{{i18n 'admin.customize.css_html.long_title'}}</h3> <h3>{{i18n 'admin.customize.css_html.long_title'}}</h3>
<ul> <ul>
{{#each model}} {{#each style in model}}
<li><a {{action "selectStyle" this}} {{bind-attr class="this.selected:active"}}>{{this.description}}</a></li> <li><a {{action "selectStyle" style}} {{bind-attr class="style.selected:active"}}>{{style.description}}</a></li>
{{/each}} {{/each}}
</ul> </ul>
<button {{action "newCustomization"}} class='btn'> <button {{action "newCustomization"}} class='btn'>
@ -12,33 +12,31 @@
{{#if selectedItem}} {{#if selectedItem}}
<div class='current-style'> <div class='current-style'>
{{#with selectedItem}} {{text-field class="style-name" value=selectedItem.name}}
{{text-field class="style-name" value=name}}
<div class='admin-controls'> <div class='admin-controls'>
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li><a {{bind-attr class="view.stylesheetActive:active"}} {{action "selectStylesheet" target="view"}}>{{i18n 'admin.customize.css'}}</a></li> <li><a {{bind-attr class="view.stylesheetActive:active"}} {{action "selectStylesheet" target="view"}}>{{i18n 'admin.customize.css'}}</a></li>
<li><a {{bind-attr class="view.headerActive:active"}} {{action "selectHeader" target="view"}}>{{i18n 'admin.customize.header'}}</a></li> <li><a {{bind-attr class="view.headerActive:active"}} {{action "selectHeader" target="view"}}>{{i18n 'admin.customize.header'}}</a></li>
<li><a {{bind-attr class="view.footerActive:active"}} {{action "selectFooter" target="view"}}>{{i18n 'admin.customize.footer'}}</a></li> <li><a {{bind-attr class="view.footerActive:active"}} {{action "selectFooter" target="view"}}>{{i18n 'admin.customize.footer'}}</a></li>
<li><a {{bind-attr class="view.mobileStylesheetActive:active"}} {{action "selectMobileStylesheet" target="view"}}>{{fa-icon "mobile"}}&nbsp;{{i18n 'admin.customize.css'}}</a></li> <li><a {{bind-attr class="view.mobileStylesheetActive:active"}} {{action "selectMobileStylesheet" target="view"}}>{{fa-icon "mobile"}}&nbsp;{{i18n 'admin.customize.css'}}</a></li>
<li><a {{bind-attr class="view.mobileHeaderActive:active"}} {{action "selectMobileHeader" target="view"}}>{{fa-icon "mobile"}}&nbsp;{{i18n 'admin.customize.header'}}</a></li> <li><a {{bind-attr class="view.mobileHeaderActive:active"}} {{action "selectMobileHeader" target="view"}}>{{fa-icon "mobile"}}&nbsp;{{i18n 'admin.customize.header'}}</a></li>
<li><a {{bind-attr class="view.mobileFooterActive:active"}} {{action "selectMobileFooter" target="view"}}>{{fa-icon "mobile"}}&nbsp;{{i18n 'admin.customize.footer'}}</a></li> <li><a {{bind-attr class="view.mobileFooterActive:active"}} {{action "selectMobileFooter" target="view"}}>{{fa-icon "mobile"}}&nbsp;{{i18n 'admin.customize.footer'}}</a></li>
</ul> </ul>
</div> </div>
<div class="admin-container"> <div class="admin-container">
{{#if view.stylesheetActive}}{{aceEditor content=stylesheet mode="scss"}}{{/if}} {{#if view.stylesheetActive}}{{aceEditor content=selectedItem.stylesheet mode="scss"}}{{/if}}
{{#if view.headerActive}}{{aceEditor content=header mode="html"}}{{/if}} {{#if view.headerActive}}{{aceEditor content=selectedItem.header mode="html"}}{{/if}}
{{#if view.footerActive}}{{aceEditor content=footer mode="html"}}{{/if}} {{#if view.footerActive}}{{aceEditor content=selectedItem.footer mode="html"}}{{/if}}
{{#if view.mobileStylesheetActive}}{{aceEditor content=mobile_stylesheet mode="scss"}}{{/if}} {{#if view.mobileStylesheetActive}}{{aceEditor content=selectedItem.mobile_stylesheet mode="scss"}}{{/if}}
{{#if view.mobileHeaderActive}}{{aceEditor content=mobile_header mode="html"}}{{/if}} {{#if view.mobileHeaderActive}}{{aceEditor content=selectedItem.mobile_header mode="html"}}{{/if}}
{{#if view.mobileFooterActive}}{{aceEditor content=mobile_footer mode="html"}}{{/if}} {{#if view.mobileFooterActive}}{{aceEditor content=selectedItem.mobile_footer mode="html"}}{{/if}}
</div> </div>
{{/with}}
<br> <br>
<div class='status-actions'> <div class='status-actions'>
<span>{{i18n 'admin.customize.override_default'}} {{view Ember.Checkbox checkedBinding="selectedItem.override_default_style"}}</span> <span>{{i18n 'admin.customize.override_default'}} {{input type="checkbox" checked=selectedItem.override_default_style}}</span>
<span>{{i18n 'admin.customize.enabled'}} {{view Ember.Checkbox checkedBinding="selectedItem.enabled"}}</span> <span>{{i18n 'admin.customize.enabled'}} {{input type="checkbox" checked=selectedItem.enabled}}</span>
{{#unless selectedItem.changed}} {{#unless selectedItem.changed}}
<a class='preview-link' {{bind-attr href="selectedItem.previewUrl"}} target='_blank' title="{{i18n 'admin.customize.explain_preview'}}">{{i18n 'admin.customize.preview'}}</a> <a class='preview-link' {{bind-attr href="selectedItem.previewUrl"}} target='_blank' title="{{i18n 'admin.customize.explain_preview'}}">{{i18n 'admin.customize.preview'}}</a>
| |

View File

@ -176,12 +176,12 @@
</tr> </tr>
</thead> </thead>
{{#unless loading}} {{#unless loading}}
{{#each top_traffic_sources.data}} {{#each s in top_traffic_sources.data}}
<tbody> <tbody>
<tr> <tr>
<td class="title">{{domain}}</td> <td class="title">{{s.domain}}</td>
<td class="value">{{num_clicks}}</td> <td class="value">{{s.num_clicks}}</td>
<td class="value">{{num_topics}}</td> <td class="value">{{s.num_topics}}</td>
</tr> </tr>
</tbody> </tbody>
{{/each}} {{/each}}
@ -199,12 +199,12 @@
</tr> </tr>
</thead> </thead>
{{#unless loading}} {{#unless loading}}
{{#each top_referrers.data}} {{#each r in top_referrers.data}}
<tbody> <tbody>
<tr> <tr>
<td class="title">{{#link-to 'adminUser' this}}{{unbound username}}{{/link-to}}</td> <td class="title">{{#link-to 'adminUser' r}}{{unbound r.username}}{{/link-to}}</td>
<td class="value">{{num_clicks}}</td> <td class="value">{{r.num_clicks}}</td>
<td class="value">{{num_topics}}</td> <td class="value">{{r.num_topics}}</td>
</tr> </tr>
</tbody> </tbody>
{{/each}} {{/each}}

View File

@ -17,20 +17,20 @@
<td>{{text-field value=filter.skipped_reason placeholderKey="admin.email.logs.filters.skipped_reason_placeholder"}}</td> <td>{{text-field value=filter.skipped_reason placeholderKey="admin.email.logs.filters.skipped_reason_placeholder"}}</td>
</tr> </tr>
{{#each model}} {{#each l in model}}
<tr> <tr>
<td>{{format-date created_at}}</td> <td>{{format-date l.created_at}}</td>
<td> <td>
{{#if user}} {{#if l.user}}
{{#link-to 'adminUser' user}}{{avatar user imageSize="tiny"}}{{/link-to}} {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}}
{{#link-to 'adminUser' user}}{{user.username}}{{/link-to}} {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}}
{{else}} {{else}}
&mdash; &mdash;
{{/if}} {{/if}}
</td> </td>
<td><a href='mailto:{{unbound to_address}}'>{{to_address}}</a></td> <td><a href='mailto:{{unbound l.to_address}}'>{{l.to_address}}</a></td>
<td>{{email_type}}</td> <td>{{l.email_type}}</td>
<td>{{skipped_reason}}</td> <td>{{l.skipped_reason}}</td>
</tr> </tr>
{{else}} {{else}}
<tr><td colspan="5">{{i18n 'admin.email.logs.none'}}</td></tr> <tr><td colspan="5">{{i18n 'admin.email.logs.none'}}</td></tr>

View File

@ -1,13 +1,13 @@
<table class="table"> <table class="table">
<tr> <tr>
<th>{{i18n 'admin.email.delivery_method'}}</th> <th>{{i18n 'admin.email.delivery_method'}}</th>
<td>{{model.delivery_method}}</td> <td>{{delivery_method}}</td>
</tr> </tr>
{{#each model.settings}} {{#each s in model.settings}}
<tr> <tr>
<th style='width: 25%'>{{name}}</th> <th style='width: 25%'>{{s.name}}</th>
<td>{{value}}</td> <td>{{s.value}}</td>
</tr> </tr>
{{/each}} {{/each}}
</table> </table>

View File

@ -17,20 +17,20 @@
<td>{{text-field value=filter.reply_key placeholderKey="admin.email.logs.filters.reply_key_placeholder"}}</td> <td>{{text-field value=filter.reply_key placeholderKey="admin.email.logs.filters.reply_key_placeholder"}}</td>
</tr> </tr>
{{#each model}} {{#each l in model}}
<tr> <tr>
<td>{{format-date created_at}}</td> <td>{{format-date l.created_at}}</td>
<td> <td>
{{#if user}} {{#if l.user}}
{{#link-to 'adminUser' user}}{{avatar user imageSize="tiny"}}{{/link-to}} {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}}
{{#link-to 'adminUser' user}}{{user.username}}{{/link-to}} {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}}
{{else}} {{else}}
&mdash; &mdash;
{{/if}} {{/if}}
</td> </td>
<td><a href='mailto:{{unbound to_address}}'>{{to_address}}</a></td> <td><a href='mailto:{{unbound l.to_address}}'>{{l.to_address}}</a></td>
<td>{{email_type}}</td> <td>{{l.email_type}}</td>
<td>{{reply_key}}</td> <td>{{l.reply_key}}</td>
</tr> </tr>
{{else}} {{else}}
<tr><td colspan="5">{{i18n 'admin.email.logs.none'}}</td></tr> <tr><td colspan="5">{{i18n 'admin.email.logs.none'}}</td></tr>

View File

@ -17,20 +17,20 @@
<td>{{text-field value=filter.skipped_reason placeholderKey="admin.email.logs.filters.skipped_reason_placeholder"}}</td> <td>{{text-field value=filter.skipped_reason placeholderKey="admin.email.logs.filters.skipped_reason_placeholder"}}</td>
</tr> </tr>
{{#each model}} {{#each l in model}}
<tr> <tr>
<td>{{format-date created_at}}</td> <td>{{format-date l.created_at}}</td>
<td> <td>
{{#if user}} {{#if l.user}}
{{#link-to 'adminUser' user}}{{avatar user imageSize="tiny"}}{{/link-to}} {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}}
{{#link-to 'adminUser' user}}{{user.username}}{{/link-to}} {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}}
{{else}} {{else}}
&mdash; &mdash;
{{/if}} {{/if}}
</td> </td>
<td><a href='mailto:{{unbound to_address}}'>{{to_address}}</a></td> <td><a href='mailto:{{unbound l.to_address}}'>{{l.to_address}}</a></td>
<td>{{email_type}}</td> <td>{{l.email_type}}</td>
<td>{{skipped_reason}}</td> <td>{{l.skipped_reason}}</td>
</tr> </tr>
{{else}} {{else}}
<tr><td colspan="5">{{i18n 'admin.email.logs.none'}}</td></tr> <tr><td colspan="5">{{i18n 'admin.email.logs.none'}}</td></tr>

View File

@ -42,20 +42,20 @@
<td class='flaggers'> <td class='flaggers'>
<table> <table>
<tbody> <tbody>
{{#each flaggedPost.flaggers}} {{#each flagger in flaggedPost.flaggers}}
<tr> <tr>
<td class='avatar'> <td class='avatar'>
{{#link-to 'adminUser' user}} {{#link-to 'adminUser' flagger.user}}
{{avatar user imageSize="small"}} {{avatar flagger.user imageSize="small"}}
{{/link-to}} {{/link-to}}
</td> </td>
<td> <td>
{{#link-to 'adminUser' user}} {{#link-to 'adminUser' flagger.user}}
{{user.username}} {{flagger.user.username}}
{{/link-to}} {{/link-to}}
{{format-age flaggedAt}} {{format-age flagger.flaggedAt}}
<br /> <br />
{{flagType}} {{flagger.flagType}}
</td> </td>
</tr> </tr>
{{/each}} {{/each}}
@ -67,17 +67,17 @@
{{#if adminOldFlagsView}} {{#if adminOldFlagsView}}
<table> <table>
<tbody> <tbody>
{{#each flaggedPost.flaggers}} {{#each flagger in flaggedPost.flaggers}}
<tr> <tr>
<td class='avatar'> <td class='avatar'>
{{#link-to 'adminUser' disposedBy}} {{#link-to 'adminUser' flagger.disposedBy}}
{{avatar disposedBy imageSize="small"}} {{avatar flagger.disposedBy imageSize="small"}}
{{/link-to}} {{/link-to}}
</td> </td>
<td> <td>
{{format-age disposedAt}} {{format-age flagger.disposedAt}}
{{{dispositionIcon}}} {{{flagger.dispositionIcon}}}
{{#if tookAction}} {{#if flagger.tookAction}}
<i class='fa fa-gavel' title='{{i18n 'admin.flags.took_action'}}'></i> <i class='fa fa-gavel' title='{{i18n 'admin.flags.took_action'}}'></i>
{{/if}} {{/if}}
</td> </td>
@ -101,24 +101,24 @@
</tr> </tr>
{{/if}} {{/if}}
{{#each flaggedPost.conversations}} {{#each c in flaggedPost.conversations}}
<tr class='message'> <tr class='message'>
<td></td> <td></td>
<td colspan="3"> <td colspan="3">
<div> <div>
{{#if response}} {{#if c.response}}
<p> <p>
{{#link-to 'adminUser' response.user}}{{avatar response.user imageSize="small"}}{{/link-to}}&nbsp;{{{response.excerpt}}} {{#link-to 'adminUser' c.response.user}}{{avatar c.response.user imageSize="small"}}{{/link-to}}&nbsp;{{{c.response.excerpt}}}
</p> </p>
{{#if reply}} {{#if c.reply}}
<p> <p>
{{#link-to 'adminUser' reply.user}}{{avatar reply.user imageSize="small"}}{{/link-to}}&nbsp;{{{reply.excerpt}}} {{#link-to 'adminUser' c.reply.user}}{{avatar c.reply.user imageSize="small"}}{{/link-to}}&nbsp;{{{c.reply.excerpt}}}
{{#if hasMore}} {{#if c.hasMore}}
<a href="{{unbound permalink}}">{{i18n 'admin.flags.more'}}</a> <a href="{{unbound c.permalink}}">{{i18n 'admin.flags.more'}}</a>
{{/if}} {{/if}}
</p> </p>
{{/if}} {{/if}}
<a href="{{unbound permalink}}"> <a href="{{unbound c.permalink}}">
<button class='btn btn-reply'><i class="fa fa-reply"></i>&nbsp;{{i18n 'admin.flags.reply_message'}}</button> <button class='btn btn-reply'><i class="fa fa-reply"></i>&nbsp;{{i18n 'admin.flags.reply_message'}}</button>
</a> </a>
{{/if}} {{/if}}

View File

@ -1,22 +1,21 @@
<div class="modal-body"> <div class="modal-body">
<div> <div>
<ul class='badge-groupings'> <ul class='badge-groupings'>
{{#each workingCopy}} {{#each wc in workingCopy}}
<li> <li>
{{#if editing}} {{#if wc.editing}}
{{input value=this.name}} {{input value=wc.name}}
<button {{action "save" this}}><i class="fa fa-check"></i></button> <button {{action "save" wc}}><i class="fa fa-check"></i></button>
{{else}} {{else}}
{{this.name}} {{wc.name}}
{{/if}} {{/if}}
<div class='actions'> <div class='actions'>
<button {{action "edit" this}}><i class="fa fa-pencil"></i></button> <button {{action "edit" wc}}><i class="fa fa-pencil"></i></button>
<button {{action "up" this}}><i class="fa fa-toggle-up"></i></button> <button {{action "up" wc}}><i class="fa fa-toggle-up"></i></button>
<button {{action "down" this}}><i class="fa fa-toggle-down"></i></button> <button {{action "down" wc}}><i class="fa fa-toggle-down"></i></button>
<button {{action "delete" this}}><i class="fa fa-times"></i></button> <button {{action "delete" wc}}><i class="fa fa-times"></i></button>
</div> </div>
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
</div> </div>

View File

@ -1,8 +1,8 @@
<tr> <tr>
<td class="title">{{title}}</td> <td class="title">{{title}}</td>
<td class="value">{{#link-to 'adminUsersList.show' 'newuser'}}{{valueAtTrustLevel data 0}}{{/link-to}}</td> <td class="value">{{#link-to 'adminUsersList.show' 'newuser'}}{{value-at-tl data level="0"}}{{/link-to}}</td>
<td class="value">{{#link-to 'adminUsersList.show' 'basic'}}{{valueAtTrustLevel data 1}}{{/link-to}}</td> <td class="value">{{#link-to 'adminUsersList.show' 'basic'}}{{value-at-tl data level="1"}}{{/link-to}}</td>
<td class="value">{{#link-to 'adminUsersList.show' 'regular'}}{{valueAtTrustLevel data 2}}{{/link-to}}</td> <td class="value">{{#link-to 'adminUsersList.show' 'regular'}}{{value-at-tl data level="2"}}{{/link-to}}</td>
<td class="value">{{#link-to 'adminUsersList.show' 'leader'}}{{valueAtTrustLevel data 3}}{{/link-to}}</td> <td class="value">{{#link-to 'adminUsersList.show' 'leader'}}{{value-at-tl data level="3"}}{{/link-to}}</td>
<td class="value">{{#link-to 'adminUsersList.show' 'elder'}}{{valueAtTrustLevel data 4}}{{/link-to}}</td> <td class="value">{{#link-to 'adminUsersList.show' 'elder'}}{{value-at-tl data level="4"}}{{/link-to}}</td>
</tr> </tr>

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<label> <label>
{{view Ember.Checkbox checkedBinding="enabled" value="true"}} {{input type="checkbox" checked=enabled}}
{{unbound description}} {{unbound description}}
</label> </label>
</div> </div>

View File

@ -1,9 +1,9 @@
<div class='row'> <div class='row'>
<div class='content-list span6'> <div class='content-list span6'>
<ul> <ul>
{{#each model}} {{#each c in model}}
<li> <li>
{{#link-to 'adminSiteText.edit' text_type}}{{title}}{{/link-to}} {{#link-to 'adminSiteText.edit' c.text_type}}{{c.title}}{{/link-to}}
</li> </li>
{{/each}} {{/each}}
</ul> </ul>

View File

@ -140,12 +140,12 @@
{{#if userFields}} {{#if userFields}}
<section class='details'> <section class='details'>
{{#each userFields}} {{#each uf in userFields}}
<div class='display-row'> <div class='display-row'>
<div class='field'>{{name}}</div> <div class='field'>{{uf.name}}</div>
<div class='value'> <div class='value'>
{{#if value}} {{#if uf.value}}
{{value}} {{uf.value}}
{{else}} {{else}}
&mdash; &mdash;
{{/if}} {{/if}}

View File

@ -12,94 +12,92 @@
<br/> <br/>
<p>{{i18n 'admin.user.tl3_requirements.table_title'}}</p> <p>{{i18n 'admin.user.tl3_requirements.table_title'}}</p>
{{#with tl3Requirements}} <table class="table" style="width: auto;">
<table class="table" style="width: auto;"> <thead>
<thead> <tr>
<tr> <th></th>
<th></th> <th></th>
<th></th> <th>{{i18n 'admin.user.tl3_requirements.value_heading'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.value_heading'}}</th> <th>{{i18n 'admin.user.tl3_requirements.requirement_heading'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.requirement_heading'}}</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.visits'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.visits'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.days_visited:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.days_visited:fa-check:fa-times"}}></i></td> <td>
<td> {{tl3Requirements.days_visited_percent}}% ({{tl3Requirements.days_visited}} / {{tl3Requirements.time_period}} {{i18n 'admin.user.tl3_requirements.days'}})
{{days_visited_percent}}% ({{days_visited}} / {{time_period}} {{i18n 'admin.user.tl3_requirements.days'}}) </td>
</td> <td>{{tl3Requirements.min_days_visited_percent}}%</td>
<td>{{min_days_visited_percent}}%</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.topics_replied_to'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.topics_replied_to'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.topics_replied_to:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.topics_replied_to:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_topics_replied_to}}</td>
<td>{{num_topics_replied_to}}</td> <td>{{tl3Requirements.min_topics_replied_to}}</td>
<td>{{min_topics_replied_to}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.topics_viewed'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.topics_viewed'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.topics_viewed:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.topics_viewed:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.topics_viewed}}</td>
<td>{{topics_viewed}}</td> <td>{{tl3Requirements.min_topics_viewed}}</td>
<td>{{min_topics_viewed}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.topics_viewed_all_time'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.topics_viewed_all_time'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.topics_viewed_all_time:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.topics_viewed_all_time:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.topics_viewed_all_time}}</td>
<td>{{topics_viewed_all_time}}</td> <td>{{tl3Requirements.min_topics_viewed_all_time}}</td>
<td>{{min_topics_viewed_all_time}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.posts_read'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.posts_read'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.posts_read:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.posts_read:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.posts_read}}</td>
<td>{{posts_read}}</td> <td>{{tl3Requirements.min_posts_read}}</td>
<td>{{min_posts_read}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.posts_read_all_time'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.posts_read_all_time'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.posts_read_all_time:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.posts_read_all_time:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.posts_read_all_time}}</td>
<td>{{posts_read_all_time}}</td> <td>{{tl3Requirements.min_posts_read_all_time}}</td>
<td>{{min_posts_read_all_time}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.flagged_posts'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.flagged_posts'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.flagged_posts:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.flagged_posts:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_flagged_posts}}</td>
<td>{{num_flagged_posts}}</td> <td>{{i18n 'max_of_count' count=tl3Requirements.max_flagged_posts}}</td>
<td>{{i18n 'max_of_count' count=max_flagged_posts}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.flagged_by_users'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.flagged_by_users'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.flagged_by_users:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.flagged_by_users:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_flagged_by_users}}</td>
<td>{{num_flagged_by_users}}</td> <td>{{i18n 'max_of_count' count=tl3Requirements.max_flagged_by_users}}</td>
<td>{{i18n 'max_of_count' count=max_flagged_by_users}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.likes_given'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.likes_given'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.likes_given:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.likes_given:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_likes_given}}</td>
<td>{{num_likes_given}}</td> <td>{{tl3Requirements.min_likes_given}}</td>
<td>{{min_likes_given}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.likes_received'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.likes_received'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.likes_received:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.likes_received:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_likes_received}}</td>
<td>{{num_likes_received}}</td> <td>{{tl3Requirements.min_likes_received}}</td>
<td>{{min_likes_received}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.likes_received_days'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.likes_received_days'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.likes_received_days:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.likes_received_days:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_likes_received_days}}</td>
<td>{{num_likes_received_days}}</td> <td>{{tl3Requirements.min_likes_received_days}}</td>
<td>{{min_likes_received_days}}</td> </tr>
</tr> <tr>
<tr> <th>{{i18n 'admin.user.tl3_requirements.likes_received_users'}}</th>
<th>{{i18n 'admin.user.tl3_requirements.likes_received_users'}}</th> <td><i {{bind-attr class=":fa tl3Requirements.met.likes_received_users:fa-check:fa-times"}}></i></td>
<td><i {{bind-attr class=":fa met.likes_received_users:fa-check:fa-times"}}></i></td> <td>{{tl3Requirements.num_likes_received_users}}</td>
<td>{{num_likes_received_users}}</td> <td>{{tl3Requirements.min_likes_received_users}}</td>
<td>{{min_likes_received_users}}</td> </tr>
</tr> </tbody>
</tbody> </table>
</table>
{{/with}}
<br/> <br/>
<p> <p>

View File

@ -1,24 +1,5 @@
import registerUnbound from 'discourse/helpers/register-unbound'; import registerUnbound from 'discourse/helpers/register-unbound';
var oldI18nlookup = I18n.lookup;
I18n.lookup = function(scope, options) {
return oldI18nlookup.apply(this, ["js." + scope, options]);
};
// Default format for storage units
var oldI18ntoHumanSize = I18n.toHumanSize;
I18n.toHumanSize = function(number, options) {
options = options || {};
options.format = I18n.t("number.human.storage_units.format");
return oldI18ntoHumanSize.apply(this, [number, options]);
};
if (Ember.EXTEND_PROTOTYPES) {
String.prototype.i18n = function(options) {
return I18n.t(String(this), options);
};
}
registerUnbound('i18n', function(key, params) { registerUnbound('i18n', function(key, params) {
return I18n.t(key, params); return I18n.t(key, params);
}); });

View File

@ -9,4 +9,3 @@ export default {
}); });
} }
}; };

View File

@ -8,8 +8,8 @@
<section class='about admins'> <section class='about admins'>
<h3>{{i18n 'about.our_admins'}}</h3> <h3>{{i18n 'about.our_admins'}}</h3>
{{#each admins}} {{#each a in admins}}
{{user-small user=this}} {{user-small user=a}}
{{/each}} {{/each}}
<div class='clearfix'></div> <div class='clearfix'></div>
@ -21,8 +21,8 @@
<h3>{{i18n 'about.our_moderators'}}</h3> <h3>{{i18n 'about.our_moderators'}}</h3>
<div class='users'> <div class='users'>
{{#each moderators}} {{#each m in moderators}}
{{user-small user=this}} {{user-small user=m}}
{{/each}} {{/each}}
</div> </div>
<div class='clearfix'></div> <div class='clearfix'></div>

View File

@ -8,14 +8,14 @@
{{#if view.noResults}} {{#if view.noResults}}
<p>{{i18n 'choose_topic.none_found'}}</p> <p>{{i18n 'choose_topic.none_found'}}</p>
{{else}} {{else}}
{{#each view.topics}} {{#each t in view.topics}}
<div class='controls'> <div class='controls'>
<label class='radio'> <label class='radio'>
<input type='radio' id="choose-topic-{{unbound id}}" name='choose_topic_id' {{action "chooseTopic" this target="view"}}>{{title}} <input type='radio' id="choose-topic-{{unbound t.id}}" name='choose_topic_id' {{action "chooseTopic" t target="view"}}>{{t.title}}
{{#if category.parentCategory}} {{#if t.category.parentCategory}}
{{bound-category-link category.parentCategory}} {{bound-category-link t.category.parentCategory}}
{{/if}} {{/if}}
{{bound-category-link category}} {{bound-category-link t.category}}
</label> </label>
</div> </div>
{{/each}} {{/each}}

View File

@ -60,13 +60,13 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#each other_accounts}} {{#each a in other_accounts}}
<tr> <tr>
<td>{{#link-to "adminUser" this}}{{avatar this usernamePath="user.username" imageSize="small"}}&nbsp;{{username}}{{/link-to}}</td> <td>{{#link-to "adminUser" a}}{{avatar a usernamePath="user.username" imageSize="small"}}&nbsp;{{username}}{{/link-to}}</td>
<td>{{trustLevel.id}}</td> <td>{{a.trustLevel.id}}</td>
<td>{{time_read}}</td> <td>{{a.time_read}}</td>
<td>{{topics_entered}}</td> <td>{{a.topics_entered}}</td>
<td>{{post_count}}</td> <td>{{a.post_count}}</td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>

View File

@ -1,3 +1,3 @@
{{#each buttons}} {{#each b in buttons}}
<button {{bind-attr class=":btn :btn-social name"}} {{action "externalLogin" this}}>{{title}}</button> <button {{bind-attr class=":btn :btn-social b.name"}} {{action "externalLogin" b}}>{{b.title}}</button>
{{/each}} {{/each}}

View File

@ -1,20 +1,20 @@
<h3><i class='fa fa-envelope'></i> {{i18n 'private_message_info.title'}}</h3> <h3><i class='fa fa-envelope'></i> {{i18n 'private_message_info.title'}}</h3>
<div class='participants clearfix'> <div class='participants clearfix'>
{{#each details.allowed_groups}} {{#each ag in details.allowed_groups}}
<div class='user group'> <div class='user group'>
#{{unbound name}} #{{unbound ag.name}}
</div> </div>
{{/each}} {{/each}}
{{#each details.allowed_users}} {{#each au in details.allowed_users}}
<div class='user'> <div class='user'>
{{#link-to 'user' this}} {{#link-to 'user' au}}
{{avatar this imageSize="small"}} {{avatar au imageSize="small"}}
{{/link-to}} {{/link-to}}
{{#link-to 'user' this}} {{#link-to 'user' au}}
{{unbound username}} {{unbound au.username}}
{{/link-to}} {{/link-to}}
{{#if details.can_remove_allowed_users}} {{#if au.details.can_remove_allowed_users}}
<a class='remove-invited' {{action "removeAllowedUser" this}}><i class="fa fa-times"></i></a> <a class='remove-invited' {{action "removeAllowedUser" au}}><i class="fa fa-times"></i></a>
{{/if}} {{/if}}
</div> </div>
{{/each}} {{/each}}

View File

@ -1,3 +1,3 @@
{{#each period.availablePeriods}} {{#each p in period.availablePeriods}}
{{top-title-button period=this}} {{top-title-button period=p}}
{{/each}} {{/each}}

View File

@ -3,8 +3,8 @@
<div id='period-popup' {{bind-attr class="showPeriods::hidden"}}> <div id='period-popup' {{bind-attr class="showPeriods::hidden"}}>
<ul> <ul>
{{#each period.availablePeriods}} {{#each p in period.availablePeriods}}
<li><a {{bind-attr href="showMoreUrl"}}>{{top-title tagName="span" period=this}}</a></li> <li><a {{bind-attr href="p.showMoreUrl"}}>{{top-title tagName="span" period=p}}</a></li>
{{/each}} {{/each}}
</ul> </ul>
</div> </div>

View File

@ -2,7 +2,7 @@
<h3>{{i18n 'composer.similar_topics'}}</h3> <h3>{{i18n 'composer.similar_topics'}}</h3>
<ul class='topics'> <ul class='topics'>
{{#each similarTopics}} {{#each t in similarTopics}}
<li>{{topic-link this}} <span class='posts-count'>({{{i18n 'topic.filters.n_posts' count="posts_count"}}})</span></li> <li>{{topic-link t}} <span class='posts-count'>({{{i18n 'topic.filters.n_posts' count=t.posts_count}}})</span></li>
{{/each}} {{/each}}
</ul> </ul>

View File

@ -1,21 +1,21 @@
<div class='user-stream'> <div class='user-stream'>
{{#each model itemController="group/post"}} {{#each p in model itemController="group/post"}}
<div class='item'> <div class='item'>
<div class='clearfix info'> <div class='clearfix info'>
{{#link-to 'user' user class="avatar-link"}}<div class='avatar-wrapper'>{{avatar user imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div>{{/link-to}} {{#link-to 'user' p.user class="avatar-link"}}<div class='avatar-wrapper'>{{avatar p.user imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div>{{/link-to}}
<span class='time'>{{format-date created_at leaveAgo="true"}}</span> <span class='time'>{{format-date p.created_at leaveAgo="true"}}</span>
<span class="title"> <span class="title">
<a href="{{unbound url}}">{{unbound title}}</a> <a href="{{unbound p.url}}">{{unbound p.title}}</a>
</span> </span>
<span class="category">{{category-link category}}</span> <span class="category">{{category-link p.category}}</span>
{{#if byName}} {{#if p.byName}}
<span class="name"> <span class="name">
{{unbound byName}} {{unbound p.byName}}
</span> </span>
{{/if}} {{/if}}
</div> </div>
<p class='excerpt'> <p class='excerpt'>
{{{unbound cooked}}} {{{unbound p.cooked}}}
</p> </p>
</div> </div>
{{/each}} {{/each}}

View File

@ -3,17 +3,17 @@
<tr> <tr>
<th colspan="3" class="seen">{{i18n 'last_seen'}}</th> <th colspan="3" class="seen">{{i18n 'last_seen'}}</th>
</tr> </tr>
{{#each model}} {{#each m in model}}
<tr> <tr>
<td class='avatar'> <td class='avatar'>
{{avatar this imageSize="large"}} {{avatar m imageSize="large"}}
</td> </td>
<td> <td>
<h3>{{#link-to 'user' this}}{{username}}{{/link-to}}</h3> <h3>{{#link-to 'user' m}}{{m.username}}{{/link-to}}</h3>
<p>{{name}}</p> <p>{{m.name}}</p>
</td> </td>
<td> <td>
<span class='last-seen-at'>{{bound-date last_seen_at}}</span> <span class='last-seen-at'>{{bound-date m.last_seen_at}}</span>
</td> </td>
</tr> </tr>
</div> </div>

View File

@ -2,43 +2,43 @@
{{#if topics}} {{#if topics}}
<table class="topic-list"> <table class="topic-list">
<tbody> <tbody>
{{#each topics}} {{#each t in topics}}
<tr {{bind-attr class="archived"}}> <tr {{bind-attr class="t.archived"}}>
<td> <td>
<div class='main-link clearfix'> <div class='main-link clearfix'>
{{topic-status topic=this}} {{topic-status topic=t}}
{{topic-link this}} {{topic-link t}}
{{topic-post-badges unread=unread {{topic-post-badges unread=t.unread
newPosts=new_posts newPosts=t.new_posts
unseen=unseen unseen=t.unseen
url=lastUnreadUrl}} url=t.lastUnreadUrl}}
{{#if hasExcerpt}} {{#if t.hasExcerpt}}
<div class="topic-excerpt"> <div class="topic-excerpt">
{{excerpt}} {{t.excerpt}}
{{#if excerptTruncated}} {{#if t.excerptTruncated}}
{{#unless canClearPin}}<a href="{{url}}">{{i18n 'read_more'}}</a>{{/unless}} {{#unless t.canClearPin}}<a href="{{t.url}}">{{i18n 'read_more'}}</a>{{/unless}}
{{/if}} {{/if}}
{{#if canClearPin}} {{#if t.canClearPin}}
<a href="#" {{action "clearPin" this}} title="{{i18n 'topic.clear_pin.help'}}">{{i18n 'topic.clear_pin.title'}}</a> <a href="#" {{action "clearPin" t}} title="{{i18n 'topic.clear_pin.help'}}">{{i18n 'topic.clear_pin.title'}}</a>
{{/if}} {{/if}}
</div> </div>
{{/if}} {{/if}}
</div> </div>
<div class="topic-item-stats clearfix"> <div class="topic-item-stats clearfix">
<div class="pull-right"> <div class="pull-right">
{{posts-count-column topic=this tagName="div" class="num posts" action="clickedPosts"}} {{posts-count-column topic=t tagName="div" class="num posts" action="clickedPosts"}}
{{raw "list/activity-column" topic=this tagName="div" class="num activity last"}} {{raw "list/activity-column" topic=t tagName="div" class="num activity last"}}
</div> </div>
{{#unless controller.hideCategory}} {{#unless controller.hideCategory}}
<div class='category'> <div class='category'>
{{category-link category showParent=true}} {{category-link t.category showParent=true}}
</div> </div>
{{/unless}} {{/unless}}
{{#if controller.showParticipants}} {{#if controller.showParticipants}}
<div class='participants'> <div class='participants'>
{{#each participants}} {{#each p in participants}}
<a href="{{unbound user.path}}" class="{{unbound extras}}">{{avatar this usernamePath="user.username" imageSize="small"}}</a> <a href="{{unbound p.user.path}}" class="{{unbound p.extras}}">{{avatar p usernamePath="user.username" imageSize="small"}}</a>
{{/each}} {{/each}}
</div> </div>
{{/if}} {{/if}}
@ -46,12 +46,12 @@
</div> </div>
</td> </td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>
</table> </table>
{{else}} {{else}}
<div class='alert alert-info'> <div class='alert alert-info'>
{{i18n 'choose_topic.none_found'}} {{i18n 'choose_topic.none_found'}}
</div> </div>
{{/if}} {{/if}}
{{/loading-spinner}} {{/loading-spinner}}

View File

@ -1,51 +1,51 @@
{{#each categories}} {{#each c in categories}}
<div class='category-list-item'> <div class='category-list-item'>
<table class='topic-list'> <table class='topic-list'>
<tr> <tr>
<th class="main-link"> <th class="main-link">
{{category-link this allowUncategorized=true}} {{category-link c allowUncategorized=true}}
</th> </th>
</tr> </tr>
{{#if description_excerpt}} {{#if c.description_excerpt}}
<tr class="category-description"> <tr class="category-description">
<td colspan="3"> <td colspan="3">
{{{description_excerpt}}} {{{c.description_excerpt}}}
</td> </td>
</tr> </tr>
{{/if}} {{/if}}
{{#each topics}} {{#each t in c.topics}}
<tr {{bind-attr class="archived :category-topic-link"}}> <tr {{bind-attr class="t.archived :category-topic-link"}}>
<td class='main-link'> <td class='main-link'>
<div class='topic-inset'> <div class='topic-inset'>
{{topic-status topic=this}} {{topic-status topic=t}}
{{topic-link this}} {{topic-link t}}
{{topic-post-badges unread=unread newPosts=new_posts unseen=unseen url=lastUnreadUrl}} {{topic-post-badges unread=t.unread newPosts=t.new_posts unseen=t.unseen url=t.lastUnreadUrl}}
{{#if hasExcerpt}} {{#if t.hasExcerpt}}
<div class="topic-excerpt"> <div class="topic-excerpt">
{{{excerpt}}} {{{t.excerpt}}}
{{#if excerptTruncated}} {{#if t.excerptTruncated}}
{{#unless canClearPin}}<a href="{{unbound url}}">{{i18n 'read_more'}}</a>{{/unless}} {{#unless t.canClearPin}}<a href="{{unbound t.url}}">{{i18n 'read_more'}}</a>{{/unless}}
{{/if}} {{/if}}
{{#if canClearPin}} {{#if t.canClearPin}}
<a href="#" {{action "clearPin" this}} title="{{unbound i18n topic.clear_pin.help}}">{{i18n 'topic.clear_pin.title'}}</a> <a href="#" {{action "clearPin" t}} title="{{unbound i18n topic.clear_pin.help}}">{{i18n 'topic.clear_pin.title'}}</a>
{{/if}} {{/if}}
</div> </div>
{{/if}} {{/if}}
</div> </div>
</td> </td>
<td class='num posts'>{{number posts_count}}</td> <td class='num posts'>{{number t.posts_count}}</td>
<td class='num age'><span class="{{cold-age-class created_at}}" title='{{raw-date created_at}}'>{{{format-age created_at}}}</span></td> <td class='num age'><span class="{{cold-age-class t.created_at}}" title='{{raw-date t.created_at}}'>{{{format-age t.created_at}}}</span></td>
</tr> </tr>
{{/each}} {{/each}}
{{#if subcategories}} {{#if c.subcategories}}
<tr> <tr>
<td> <td>
<div class='subcategories'> <div class='subcategories'>
{{#each subcategory in subcategories}} {{#each subcategory in c.subcategories}}
{{category-link subcategory showParent=true}} {{category-link subcategory showParent=true}}
{{/each}} {{/each}}
</div> </div>
@ -55,12 +55,12 @@
</table> </table>
<footer class="clearfix"> <footer class="clearfix">
<figure title="{{i18n 'year_desc'}}">{{number topics_year}} <figcaption>{{i18n 'category.this_year'}}</figcaption></figure> <figure title="{{i18n 'year_desc'}}">{{number c.topics_year}} <figcaption>{{i18n 'category.this_year'}}</figcaption></figure>
<figure title="{{i18n 'month_desc'}}">{{number topics_month}} <figcaption>{{i18n 'month'}}</figcaption></figure> <figure title="{{i18n 'month_desc'}}">{{number c.topics_month}} <figcaption>{{i18n 'month'}}</figcaption></figure>
<figure title="{{i18n 'week_desc'}}">{{number topics_week}} <figcaption>{{i18n 'week'}}</figcaption></figure> <figure title="{{i18n 'week_desc'}}">{{number c.topics_week}} <figcaption>{{i18n 'week'}}</figcaption></figure>
{{#if controller.canEdit}} {{#if controller.canEdit}}
<a href='#' {{action "editCategory" this}} class='btn btn-small'>{{i18n 'category.edit'}}</a> <a href='#' {{action "editCategory" c}} class='btn btn-small'>{{i18n 'category.edit'}}</a>
{{/if}} {{/if}}
</footer> </footer>

View File

@ -30,7 +30,7 @@
<div class="pull-right"> <div class="pull-right">
{{posts-count-column topic=this tagName="div" class="num posts" action="showTopicEntrance"}} {{posts-count-column topic=this tagName="div" class="num posts" action="showTopicEntrance"}}
<div class='num activity last'> <div class='num activity last'>
<a href="{{lastPostUrl}}" title='{{i18n 'last_post'}}: {{{raw-date bumped_at}}}'>{{last_poster_username}}</a> <a href="{{unbound lastPostUrl}}" title='{{i18n 'last_post'}}: {{{raw-date bumped_at}}}'>{{last_poster_username}}</a>
{{raw "list/activity-column" topic=this tagName="span" class="age"}} {{raw "list/activity-column" topic=this tagName="span" class="age"}}
</div> </div>
</div> </div>

View File

@ -74,8 +74,8 @@
{{#if userFields}} {{#if userFields}}
<div class='user-fields'> <div class='user-fields'>
{{#each userFields}} {{#each f in userFields}}
{{user-field field=field value=value}} {{user-field field=f.field value=value}}
{{/each}} {{/each}}
</div> </div>
{{/if}} {{/if}}

View File

@ -8,8 +8,8 @@
<section class='field'> <section class='field'>
{{#if subCategories}} {{#if subCategories}}
<label>{{i18n 'categories.subcategories'}}</label> <label>{{i18n 'categories.subcategories'}}</label>
{{#each subCategories}} {{#each s in subCategories}}
{{category-badge this}} {{category-badge s}}
{{/each}} {{/each}}
{{else}} {{else}}
<label>{{i18n 'category.parent'}}</label> <label>{{i18n 'category.parent'}}</label>

View File

@ -1,19 +1,19 @@
<section class='field'> <section class='field'>
<ul class='permission-list'> <ul class='permission-list'>
{{#each permissions}} {{#each p in permissions}}
<li> <li>
<span class="name"><span class="badge-group">{{group_name}}</span></span> <span class="name"><span class="badge-group">{{p.group_name}}</span></span>
{{{i18n "category.can"}}} {{{i18n "category.can"}}}
<span class="permission">{{permission.description}}</span> <span class="permission">{{p.permission.description}}</span>
{{#if controller.editingPermissions}} {{#if controller.editingPermissions}}
<a {{action "removePermission" this}}><i class="fa fa-times-circle"></i></a> <a {{action "removePermission" p}}><i class="fa fa-times-circle"></i></a>
{{/if}} {{/if}}
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
{{#if controller.editingPermissions}} {{#if controller.editingPermissions}}
{{view Ember.Select content=availableGroups value=selectedGroup}} {{view 'select' content=availableGroups value=selectedGroup}}
{{view Ember.Select class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" content=availablePermissions value=selectedPermission}} {{view 'select' class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" content=availablePermissions value=selectedPermission}}
<button {{action "addPermission" selectedGroup selectedPermission}} class="btn btn-small">{{i18n 'category.add_permission'}}</button> <button {{action "addPermission" selectedGroup selectedPermission}} class="btn btn-small">{{i18n 'category.add_permission'}}</button>
{{else}} {{else}}
<button {{action "editPermissions"}} class="btn btn-small">{{i18n 'category.edit_permissions'}}</button> <button {{action "editPermissions"}} class="btn btn-small">{{i18n 'category.edit_permissions'}}</button>

View File

@ -1,5 +1,5 @@
<label> <label>
{{view Ember.Checkbox checkedBinding="view.checked"}} {{input type="checkbox" checked=view.checked}}
{{title}} {{title}}
</label> </label>

View File

@ -5,7 +5,7 @@
</div> </div>
{{/if}} {{/if}}
{{{i18n 'topic.split_topic.instructions' count="selectedPostsCount"}}} {{{i18n 'topic.split_topic.instructions' count=selectedPostsCount}}}
<form> <form>
<label>{{i18n 'topic.split_topic.topic_name'}}</label> <label>{{i18n 'topic.split_topic.topic_name'}}</label>

View File

@ -1,28 +1,28 @@
{{#each model.content}} {{#each p in model.content}}
<div {{bind-attr class=":item hidden deleted moderator_action"}}> <div {{bind-attr class=":item p.hidden p.deleted moderator_action"}}>
<div class="clearfix info"> <div class="clearfix info">
<a href="{{unbound usernameUrl}}" class="avatar-link"> <a href="{{unbound p.usernameUrl}}" class="avatar-link">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
{{avatar this imageSize="large" extraClasses="actor" ignoreTitle="true"}} {{avatar p imageSize="large" extraClasses="actor" ignoreTitle="true"}}
</div> </div>
</a> </a>
<span class="time"> <span class="time">
{{format-date created_at leaveAgo="true"}} {{format-date p.created_at leaveAgo="true"}}
</span> </span>
<span class="title"> <span class="title">
<a href="{{unbound url}}">{{unbound topic_title}}</a> <a href="{{unbound p.url}}">{{unbound p.topic_title}}</a>
</span> </span>
<span class="category"> <span class="category">
{{category-link category}} {{category-link p.category}}
</span> </span>
{{#if deleted}} {{#if p.deleted}}
<span class="delete-info"> <span class="delete-info">
<i class="fa fa-trash-o"></i> {{avatar deleted_by imageSize="tiny" extraClasses="actor" ignoreTitle="true"}} {{format-date deleted_at leaveAgo="true"}} <i class="fa fa-trash-o"></i> {{avatar p.deleted_by imageSize="tiny" extraClasses="actor" ignoreTitle="true"}} {{format-date p.deleted_at leaveAgo="true"}}
</span> </span>
{{/if}} {{/if}}
</div> </div>
<p class="excerpt"> <p class="excerpt">
{{{excerpt}}} {{{p.excerpt}}}
</p> </p>
</div> </div>
{{/each}} {{/each}}

View File

@ -210,8 +210,8 @@
{{plugin-outlet "user_custom_preferences"}} {{plugin-outlet "user_custom_preferences"}}
</div> </div>
{{#each userFields}} {{#each uf in userFields}}
{{user-field field=field value=value}} {{user-field field=uf.field value=uf.value}}
{{/each}} {{/each}}
<div class="control-group category"> <div class="control-group category">

View File

@ -10,6 +10,7 @@
// //
// Stuff we need to load first // Stuff we need to load first
//= require ./discourse/helpers/i18n
//= require ./discourse/lib/ember_compat_handlebars //= require ./discourse/lib/ember_compat_handlebars
//= require ./discourse/helpers/register-unbound //= require ./discourse/helpers/register-unbound
//= require ./discourse/lib/computed //= require ./discourse/lib/computed

View File

@ -5,6 +5,7 @@
//= require handlebars.js //= require handlebars.js
//= require jquery_include.js //= require jquery_include.js
//= require ember_include.js //= require ember_include.js
//= require i18n-patches
//= require loader //= require loader
//= require message-bus //= require message-bus

View File

@ -1,13 +1,13 @@
<table> <table>
{{#each poll.options}} {{#each po poll.options}}
<tr {{bind-attr class=checked:active}} {{action "selectOption" option}}> <tr {{bind-attr class=po.checked:active}} {{action "selectOption" po.option}}>
<td class="radio"> <td class="radio">
<input type="radio" name="poll" {{bind-attr checked=checked disabled=controller.disableRadio}}> <input type="radio" name="poll" {{bind-attr checked=po.checked disabled=controller.disableRadio}}>
</td> </td>
<td class="option"> <td class="option">
<div class="option">{{{option}}}</div> <div class="option">{{{po.option}}}</div>
{{#if controller.showResults}} {{#if controller.showResults}}
<div class="result">{{i18n 'poll.voteCount' count=votes}}</div> <div class="result">{{i18n 'poll.voteCount' count=po.votes}}</div>
{{/if}} {{/if}}
</td> </td>
</tr> </tr>

View File

@ -0,0 +1,20 @@
(function() {
var oldI18nlookup = I18n.lookup;
I18n.lookup = function(scope, options) {
return oldI18nlookup.apply(this, ["js." + scope, options]);
};
// Default format for storage units
var oldI18ntoHumanSize = I18n.toHumanSize;
I18n.toHumanSize = function(number, options) {
options = options || {};
options.format = I18n.t("number.human.storage_units.format");
return oldI18ntoHumanSize.apply(this, [number, options]);
};
if (Ember.EXTEND_PROTOTYPES) {
String.prototype.i18n = function(options) {
return I18n.t(String(this), options);
};
}
})();