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) {
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
if (arguments.length > 1) {
this.set('value', value ? 'true' : 'false');
}
if (this.blank('value')) return false;
return this.get('value') === 'true';
}.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({
destroy: function() {
var self = this;
@ -43,11 +38,18 @@ UserField.reopenClass({
},
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) {
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({
model: function() {
return Discourse.EmailSettings.find();
},

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,8 +1,8 @@
<tr>
<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' 'basic'}}{{valueAtTrustLevel data 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' 'leader'}}{{valueAtTrustLevel data 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' 'newuser'}}{{value-at-tl data level="0"}}{{/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'}}{{value-at-tl data level="2"}}{{/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'}}{{value-at-tl data level="4"}}{{/link-to}}</td>
</tr>

View file

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

View file

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

View file

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

View file

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

View file

@ -1,24 +1,5 @@
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) {
return I18n.t(key, params);
});

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,21 +1,21 @@
<div class='user-stream'>
{{#each model itemController="group/post"}}
{{#each p in model itemController="group/post"}}
<div class='item'>
<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}}
<span class='time'>{{format-date created_at leaveAgo="true"}}</span>
{{#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 p.created_at leaveAgo="true"}}</span>
<span class="title">
<a href="{{unbound url}}">{{unbound title}}</a>
<a href="{{unbound p.url}}">{{unbound p.title}}</a>
</span>
<span class="category">{{category-link category}}</span>
{{#if byName}}
<span class="category">{{category-link p.category}}</span>
{{#if p.byName}}
<span class="name">
{{unbound byName}}
{{unbound p.byName}}
</span>
{{/if}}
</div>
<p class='excerpt'>
{{{unbound cooked}}}
{{{unbound p.cooked}}}
</p>
</div>
{{/each}}

View file

@ -3,17 +3,17 @@
<tr>
<th colspan="3" class="seen">{{i18n 'last_seen'}}</th>
</tr>
{{#each model}}
{{#each m in model}}
<tr>
<td class='avatar'>
{{avatar this imageSize="large"}}
{{avatar m imageSize="large"}}
</td>
<td>
<h3>{{#link-to 'user' this}}{{username}}{{/link-to}}</h3>
<p>{{name}}</p>
<h3>{{#link-to 'user' m}}{{m.username}}{{/link-to}}</h3>
<p>{{m.name}}</p>
</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>
</tr>
</div>

View file

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

View file

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

View file

@ -30,7 +30,7 @@
<div class="pull-right">
{{posts-count-column topic=this tagName="div" class="num posts" action="showTopicEntrance"}}
<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"}}
</div>
</div>

View file

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

View file

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

View file

@ -1,19 +1,19 @@
<section class='field'>
<ul class='permission-list'>
{{#each permissions}}
{{#each p in permissions}}
<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"}}}
<span class="permission">{{permission.description}}</span>
<span class="permission">{{p.permission.description}}</span>
{{#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}}
</li>
{{/each}}
</ul>
{{#if controller.editingPermissions}}
{{view Ember.Select content=availableGroups value=selectedGroup}}
{{view Ember.Select class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" content=availablePermissions value=selectedPermission}}
{{view 'select' content=availableGroups value=selectedGroup}}
{{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>
{{else}}
<button {{action "editPermissions"}} class="btn btn-small">{{i18n 'category.edit_permissions'}}</button>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,13 +1,13 @@
<table>
{{#each poll.options}}
<tr {{bind-attr class=checked:active}} {{action "selectOption" option}}>
{{#each po poll.options}}
<tr {{bind-attr class=po.checked:active}} {{action "selectOption" po.option}}>
<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 class="option">
<div class="option">{{{option}}}</div>
<div class="option">{{{po.option}}}</div>
{{#if controller.showResults}}
<div class="result">{{i18n 'poll.voteCount' count=votes}}</div>
<div class="result">{{i18n 'poll.voteCount' count=po.votes}}</div>
{{/if}}
</td>
</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);
};
}
})();