Removed many unnecessary paths that included `content.x` when just `x` would do.

This commit is contained in:
Robin Ward 2013-05-20 15:27:58 -04:00
parent 9544cfd7dc
commit 42248a7164
24 changed files with 167 additions and 173 deletions

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.AdminCustomizeController = Ember.Controller.extend({ Discourse.AdminCustomizeController = Ember.ArrayController.extend({
/** /**
Create a new customization style Create a new customization style
@ -15,8 +15,8 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
**/ **/
newCustomization: function() { newCustomization: function() {
var item = Discourse.SiteCustomization.create({name: Em.String.i18n("admin.customize.new_style")}); var item = Discourse.SiteCustomization.create({name: Em.String.i18n("admin.customize.new_style")});
this.get('content').pushObject(item); this.pushObject(item);
this.set('content.selectedItem', item); this.set('selectedItem', item);
}, },
/** /**
@ -26,7 +26,7 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
@param {Discourse.SiteCustomization} style The style we are selecting @param {Discourse.SiteCustomization} style The style we are selecting
**/ **/
selectStyle: function(style) { selectStyle: function(style) {
this.set('content.selectedItem', style); this.set('selectedItem', style);
}, },
/** /**
@ -35,7 +35,7 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
@method save @method save
**/ **/
save: function() { save: function() {
this.get('content.selectedItem').save(); this.get('selectedItem').save();
}, },
/** /**
@ -48,10 +48,10 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
return bootbox.confirm(Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), function(result) { return bootbox.confirm(Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), function(result) {
var selected; var selected;
if (result) { if (result) {
selected = _this.get('content.selectedItem'); selected = _this.get('selectedItem');
selected.destroy(); selected.destroy();
_this.set('content.selectedItem', null); _this.set('selectedItem', null);
return _this.get('content').removeObject(selected); return _this.removeObject(selected);
} }
}); });
} }

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.AdminFlagsController = Ember.Controller.extend({ Discourse.AdminFlagsController = Ember.ArrayController.extend({
/** /**
Clear all flags on a post Clear all flags on a post
@ -17,10 +17,10 @@ Discourse.AdminFlagsController = Ember.Controller.extend({
clearFlags: function(item) { clearFlags: function(item) {
var _this = this; var _this = this;
item.clearFlags().then((function() { item.clearFlags().then((function() {
_this.content.removeObject(item); _this.removeObject(item);
}), (function() { }), function() {
bootbox.alert(Em.String.i18n("admin.flags.error")); bootbox.alert(Em.String.i18n("admin.flags.error"));
})); });
}, },
/** /**
@ -32,10 +32,10 @@ Discourse.AdminFlagsController = Ember.Controller.extend({
deletePost: function(item) { deletePost: function(item) {
var _this = this; var _this = this;
item.deletePost().then((function() { item.deletePost().then((function() {
_this.content.removeObject(item); _this.removeObject(item);
}), (function() { }), function() {
bootbox.alert(Em.String.i18n("admin.flags.error")); bootbox.alert(Em.String.i18n("admin.flags.error"));
})); });
}, },
/** /**

View File

@ -8,7 +8,7 @@
**/ **/
Discourse.FlaggedPost = Discourse.Post.extend({ Discourse.FlaggedPost = Discourse.Post.extend({
flaggers: (function() { flaggers: function() {
var r, var r,
_this = this; _this = this;
r = []; r = [];
@ -16,9 +16,9 @@ Discourse.FlaggedPost = Discourse.Post.extend({
return r.push(_this.userLookup[a.user_id]); return r.push(_this.userLookup[a.user_id]);
}); });
return r; return r;
}).property(), }.property(),
messages: (function() { messages: function() {
var r, var r,
_this = this; _this = this;
r = []; r = [];
@ -32,7 +32,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
} }
}); });
return r; return r;
}).property(), }.property(),
lastFlagged: function() { lastFlagged: function() {
return this.post_actions[0].created_at; return this.post_actions[0].created_at;

View File

@ -7,14 +7,13 @@
@module Discourse @module Discourse
**/ **/
Discourse.AdminApiRoute = Discourse.Route.extend({ Discourse.AdminApiRoute = Discourse.Route.extend({
renderTemplate: function() {
this.render({into: 'admin/templates/admin'}); model: function() {
return Discourse.AdminApi.find();
}, },
setupController: function(controller, model) { renderTemplate: function() {
// in case you are wondering, model never gets called for link_to this.render({into: 'admin/templates/admin'});
Discourse.AdminApi.find().then(function(result){
controller.set('content', result);
});
} }
}); });

View File

@ -8,12 +8,12 @@
**/ **/
Discourse.AdminCustomizeRoute = Discourse.Route.extend({ Discourse.AdminCustomizeRoute = Discourse.Route.extend({
renderTemplate: function() { model: function() {
this.render({into: 'admin/templates/admin'}); return Discourse.SiteCustomization.findAll();
}, },
setupController: function(controller, model) { renderTemplate: function() {
// in case you are wondering, model never gets called for link_to this.render({into: 'admin/templates/admin'});
controller.set('content',Discourse.SiteCustomization.findAll());
} }
}); });

View File

@ -1,20 +1,16 @@
/** /**
Handles routes related to viewing active flags. Handles routes related to viewing active flags.
@class AdminFlagsActiveRoute @class AdminFlagsActiveRoute
@extends Discourse.Route @extends Discourse.Route
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.AdminFlagsActiveRoute = Discourse.Route.extend({ Discourse.AdminFlagsActiveRoute = Discourse.Route.extend({
model: function() { setupController: function() {
return Discourse.FlaggedPost.findAll('active');
},
setupController: function(controller, model) {
var adminFlagsController = this.controllerFor('adminFlags'); var adminFlagsController = this.controllerFor('adminFlags');
adminFlagsController.set('content', model); adminFlagsController.set('content', Discourse.FlaggedPost.findAll('active'));
adminFlagsController.set('query', 'active'); adminFlagsController.set('query', 'active');
} }

View File

@ -1,20 +1,16 @@
/** /**
Handles routes related to viewing old flags. Handles routes related to viewing old flags.
@class AdminFlagsOldRoute @class AdminFlagsOldRoute
@extends Discourse.Route @extends Discourse.Route
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.AdminFlagsOldRoute = Discourse.Route.extend({ Discourse.AdminFlagsOldRoute = Discourse.Route.extend({
model: function() {
return Discourse.FlaggedPost.findAll('old');
},
setupController: function(controller, model) { setupController: function(controller, model) {
var adminFlagsController = this.controllerFor('adminFlags'); var adminFlagsController = this.controllerFor('adminFlags');
adminFlagsController.set('content', model); adminFlagsController.set('content', Discourse.FlaggedPost.findAll('old'));
adminFlagsController.set('query', 'old'); adminFlagsController.set('query', 'old');
} }

View File

@ -1,9 +1,9 @@
<h3>{{i18n admin.api.long_title}}</h3> <h3>{{i18n admin.api.long_title}}</h3>
{{#if content.keyExists}} {{#if keyExists}}
<strong>{{i18n admin.api.key}}:</strong> {{content.key}} <strong>{{i18n admin.api.key}}:</strong> {{key}}
<button {{action regenerateKey target="content"}}>{{i18n admin.api.regenerate}}</button> <button {{action regenerateKey target="model"}}>{{i18n admin.api.regenerate}}</button>
<p>{{{i18n admin.api.note_html}}}</p> <p>{{{i18n admin.api.note_html}}}</p>
{{else}} {{else}}
<p>{{{i18n admin.api.info_html}}}</p> <p>{{{i18n admin.api.info_html}}}</p>
<button {{action generateKey target="content"}}>{{i18n admin.api.generate}}</button> <button {{action generateKey target="model"}}>{{i18n admin.api.generate}}</button>
{{/if}} {{/if}}

View File

@ -2,7 +2,7 @@
<div class='content-list span6'> <div class='content-list span6'>
<h3>{{i18n admin.customize.long_title}}</h3> <h3>{{i18n admin.customize.long_title}}</h3>
<ul> <ul>
{{#each content}} {{#each model}}
<li><a {{action selectStyle this}} {{bindAttr class="this.selected:active"}}>{{this.description}}</a></li> <li><a {{action selectStyle this}} {{bindAttr class="this.selected:active"}}>{{this.description}}</a></li>
{{/each}} {{/each}}
</ul> </ul>
@ -10,7 +10,7 @@
</div> </div>
{{#if content.selectedItem}} {{#if selectedItem}}
<div class='current-style'> <div class='current-style'>
<div class='admin-controls'> <div class='admin-controls'>
<ul class="nav nav-pills"> <ul class="nav nav-pills">
@ -23,7 +23,7 @@
</ul> </ul>
</div> </div>
{{#with content.selectedItem}} {{#with selectedItem}}
{{textField class="style-name" value=name}} {{textField class="style-name" value=name}}
{{#if view.headerActive}} {{#if view.headerActive}}
{{view Discourse.AceEditorView contentBinding="header" mode="html"}} {{view Discourse.AceEditorView contentBinding="header" mode="html"}}
@ -34,18 +34,18 @@
{{/with}} {{/with}}
<br> <br>
<div class='status-actions'> <div class='status-actions'>
<span>{{i18n admin.customize.override_default}} {{view Ember.Checkbox checkedBinding="content.selectedItem.override_default_style"}}</span> <span>{{i18n admin.customize.override_default}} {{view Ember.Checkbox checkedBinding="selectedItem.override_default_style"}}</span>
<span>{{i18n admin.customize.enabled}} {{view Ember.Checkbox checkedBinding="content.selectedItem.enabled"}}</span> <span>{{i18n admin.customize.enabled}} {{view Ember.Checkbox checkedBinding="selectedItem.enabled"}}</span>
{{#unless content.selectedItem.changed}} {{#unless selectedItem.changed}}
<a class='preview-link' {{bindAttr href="content.selectedItem.previewUrl"}} target='_blank'>{{i18n admin.customize.preview}}</a> <a class='preview-link' {{bindAttr href="selectedItem.previewUrl"}} target='_blank'>{{i18n admin.customize.preview}}</a>
| |
<a href="/?preview-style=" target='_blank'>{{i18n admin.customize.undo_preview}}</a><br> <a href="/?preview-style=" target='_blank'>{{i18n admin.customize.undo_preview}}</a><br>
{{/unless}} {{/unless}}
</div> </div>
<div class='buttons'> <div class='buttons'>
<button {{action save}} {{bindAttr disabled="content.selectedItem.disableSave"}} class='btn'>{{i18n admin.customize.save}}</button> <button {{action save}} {{bindAttr disabled="selectedItem.disableSave"}} class='btn'>{{i18n admin.customize.save}}</button>
<span class='saving'>{{content.selectedItem.savingStatus}}</span> <span class='saving'>{{selectedItem.savingStatus}}</span>
<a {{action destroy}} class='delete-link'>{{i18n admin.customize.delete}}</a> <a {{action destroy}} class='delete-link'>{{i18n admin.customize.delete}}</a>
</div> </div>

View File

@ -19,17 +19,17 @@
{{#if model.length}} {{#if model.length}}
{{#group}} {{#group}}
{{#collection contentBinding="model" tagName="tbody" itemTagName="tr"}} {{#collection contentBinding="model" tagName="tbody" itemTagName="tr"}}
<td>{{date view.content.created_at}}</td> <td>{{date created_at}}</td>
<td> <td>
{{#if view.content.user}} {{#if user}}
{{#linkTo 'adminUser' view.content.user}}{{avatar view.content.user imageSize="tiny"}}{{/linkTo}} {{#linkTo 'adminUser' user}}{{avatar user imageSize="tiny"}}{{/linkTo}}
{{#linkTo 'adminUser' view.content.user}}{{view.content.user.username}}{{/linkTo}} {{#linkTo 'adminUser' user}}{{user.username}}{{/linkTo}}
{{else}} {{else}}
&mdash; &mdash;
{{/if}} {{/if}}
</td> </td>
<td><a href='mailto:{{unbound view.content.to_address}}'>{{view.content.to_address}}</a></td> <td><a href='mailto:{{unbound to_address}}'>{{to_address}}</a></td>
<td>{{view.content.email_type}}</td> <td>{{email_type}}</td>
{{/collection}} {{/collection}}
{{/group}} {{/group}}
{{/if}} {{/if}}

View File

@ -27,8 +27,8 @@
<td class='last-flagged'>{{date lastFlagged}}</td> <td class='last-flagged'>{{date lastFlagged}}</td>
<td class='action'> <td class='action'>
{{#if adminActiveFlagsView}} {{#if adminActiveFlagsView}}
<button title='{{i18n admin.flags.clear_title}}' class='btn' {{action clearFlags this}}>{{i18n admin.flags.clear}}</button> <button title='{{i18n admin.flags.clear_title}}' class='btn' {{action clearFlags this}}>{{i18n admin.flags.clear}}</button>
<button title='{{i18n admin.flags.delete_title}}' class='btn' {{action deletePost this}}>{{i18n admin.flags.delete}}</button> <button title='{{i18n admin.flags.delete_title}}' class='btn' {{action deletePost this}}>{{i18n admin.flags.delete}}</button>
{{/if}} {{/if}}
</td> </td>
</tr> </tr>

View File

@ -3,19 +3,19 @@
<p class='description'>{{description}}</p> <p class='description'>{{description}}</p>
{{#if markdown}} {{#if markdown}}
{{view Discourse.PagedownEditor valueBinding="content.content"}} {{view Discourse.PagedownEditor valueBinding="model.content"}}
{{/if}} {{/if}}
{{#if plainText}} {{#if plainText}}
{{textarea value=content.content class="plain"}} {{textarea value=model.content class="plain"}}
{{/if}} {{/if}}
{{#if html}} {{#if html}}
{{view Discourse.AceEditorView contentBinding="content.content" mode="html"}} {{view Discourse.AceEditorView contentBinding="model.content" mode="html"}}
{{/if}} {{/if}}
{{#if css}} {{#if css}}
{{view Discourse.AceEditorView contentBinding="content.content" mode="css"}} {{view Discourse.AceEditorView contentBinding="model.content" mode="css"}}
{{/if}} {{/if}}

View File

@ -14,4 +14,4 @@
{{collection contentBinding="filteredContent" classNames="form-horizontal settings" itemViewClass="Discourse.SiteSettingView"}} {{collection contentBinding="filteredContent" classNames="form-horizontal settings" itemViewClass="Discourse.SiteSettingView"}}
<!-- will remove as soon as I figure out what is going on --> <!-- will remove as soon as I figure out what is going on -->
<p><small>Diagnostics: last_message_processed {{content.diags.last_message_processed}}</small></p> <p><small>Diagnostics: last_message_processed {{diags.last_message_processed}}</small></p>

View File

@ -2,13 +2,13 @@
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n user.username.title}}</div> <div class='field'>{{i18n user.username.title}}</div>
<div class='value'>{{content.username}}</div> <div class='value'>{{username}}</div>
<div class='controls'> <div class='controls'>
{{#linkTo 'user.activity' content class="btn"}} {{#linkTo 'user.activity' content class="btn"}}
<i class='icon icon-user'></i> <i class='icon icon-user'></i>
{{i18n admin.user.show_public_profile}} {{i18n admin.user.show_public_profile}}
{{/linkTo}} {{/linkTo}}
{{#if content.can_impersonate}} {{#if can_impersonate}}
<button class='btn' {{action impersonate target="content"}}> <button class='btn' {{action impersonate target="content"}}>
<i class='icon icon-screenshot'></i> <i class='icon icon-screenshot'></i>
{{i18n admin.user.impersonate}} {{i18n admin.user.impersonate}}
@ -19,7 +19,7 @@
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n user.email.title}}</div> <div class='field'>{{i18n user.email.title}}</div>
<div class='value'><a href="mailto:{{unbound content.email}}">{{content.email}}</a></div> <div class='value'><a href="mailto:{{unbound email}}">{{email}}</a></div>
</div> </div>
<div class='display-row' style='height: 50px'> <div class='display-row' style='height: 50px'>
@ -29,7 +29,7 @@
<div class='display-row' style='height: 50px'> <div class='display-row' style='height: 50px'>
<div class='field'>{{i18n user.ip_address.title}}</div> <div class='field'>{{i18n user.ip_address.title}}</div>
<div class='value'>{{content.ip_address}}</div> <div class='value'>{{ip_address}}</div>
<div class='controls'> <div class='controls'>
{{#if Discourse.currentUser.admin}} {{#if Discourse.currentUser.admin}}
<button class='btn' {{action refreshBrowsers target="content"}}> <button class='btn' {{action refreshBrowsers target="content"}}>
@ -48,18 +48,18 @@
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.users.approved}}</div> <div class='field'>{{i18n admin.users.approved}}</div>
<div class='value'> <div class='value'>
{{#if content.approved}} {{#if approved}}
{{i18n admin.user.approved_by}} {{i18n admin.user.approved_by}}
{{#linkTo 'adminUser' content.approved_by}}{{avatar approved_by imageSize="small"}}{{/linkTo}} {{#linkTo 'adminUser' approved_by}}{{avatar approved_by imageSize="small"}}{{/linkTo}}
{{#linkTo 'adminUser' content.approved_by}}{{content.approved_by.username}}{{/linkTo}} {{#linkTo 'adminUser' approved_by}}{{approved_by.username}}{{/linkTo}}
{{else}} {{else}}
{{i18n no_value}} {{i18n no_value}}
{{/if}} {{/if}}
</div> </div>
<div class='controls'> <div class='controls'>
{{#if content.can_approve}} {{#if can_approve}}
<button class='btn' {{action approve target="content"}}> <button class='btn' {{action approve target="content"}}>
<i class='icon icon-ok'></i> <i class='icon icon-ok'></i>
{{i18n admin.user.approve}} {{i18n admin.user.approve}}
@ -71,25 +71,25 @@
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.users.active}}</div> <div class='field'>{{i18n admin.users.active}}</div>
<div class='value'> <div class='value'>
{{#if content.active}} {{#if active}}
{{i18n yes_value}} {{i18n yes_value}}
{{else}} {{else}}
{{i18n no_value}} {{i18n no_value}}
{{/if}} {{/if}}
</div> </div>
<div class='controls'> <div class='controls'>
{{#if content.active}} {{#if active}}
{{#if content.can_deactivate}} {{#if can_deactivate}}
<button class='btn' {{action deactivate target="content"}}>{{i18n admin.user.deactivate_account}}</button> <button class='btn' {{action deactivate target="content"}}>{{i18n admin.user.deactivate_account}}</button>
{{/if}} {{/if}}
{{else}} {{else}}
{{#if content.can_send_activation_email}} {{#if can_send_activation_email}}
<button class='btn' {{action sendActivationEmail target="content"}}> <button class='btn' {{action sendActivationEmail target="content"}}>
<i class='icon icon-envelope-alt'></i> <i class='icon icon-envelope-alt'></i>
{{i18n admin.user.send_activation_email}} {{i18n admin.user.send_activation_email}}
</button> </button>
{{/if}} {{/if}}
{{#if content.can_activate}} {{#if can_activate}}
<button class='btn' {{action activate target="content"}}> <button class='btn' {{action activate target="content"}}>
<i class='icon icon-ok'></i> <i class='icon icon-ok'></i>
{{i18n admin.user.activate}} {{i18n admin.user.activate}}
@ -101,15 +101,15 @@
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.admin}}</div> <div class='field'>{{i18n admin.user.admin}}</div>
<div class='value'>{{content.admin}}</div> <div class='value'>{{admin}}</div>
<div class='controls'> <div class='controls'>
{{#if content.can_revoke_admin}} {{#if can_revoke_admin}}
<button class='btn' {{action revokeAdmin target="content"}}> <button class='btn' {{action revokeAdmin target="content"}}>
<i class='icon icon-trophy'></i> <i class='icon icon-trophy'></i>
{{i18n admin.user.revoke_admin}} {{i18n admin.user.revoke_admin}}
</button> </button>
{{/if}} {{/if}}
{{#if content.can_grant_admin}} {{#if can_grant_admin}}
<button class='btn' {{action grantAdmin target="content"}}> <button class='btn' {{action grantAdmin target="content"}}>
<i class='icon icon-trophy'></i> <i class='icon icon-trophy'></i>
{{i18n admin.user.grant_admin}} {{i18n admin.user.grant_admin}}
@ -120,15 +120,15 @@
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.moderator}}</div> <div class='field'>{{i18n admin.user.moderator}}</div>
<div class='value'>{{content.moderator}}</div> <div class='value'>{{moderator}}</div>
<div class='controls'> <div class='controls'>
{{#if content.can_revoke_moderation}} {{#if can_revoke_moderation}}
<button class='btn' {{action revokeModeration target="content"}}> <button class='btn' {{action revokeModeration target="content"}}>
<i class='icon icon-magic'></i> <i class='icon icon-magic'></i>
{{i18n admin.user.revoke_moderation}} {{i18n admin.user.revoke_moderation}}
</button> </button>
{{/if}} {{/if}}
{{#if content.can_grant_moderation}} {{#if can_grant_moderation}}
<button class='btn' {{action grantModeration target="content"}}> <button class='btn' {{action grantModeration target="content"}}>
<i class='icon icon-magic'></i> <i class='icon icon-magic'></i>
{{i18n admin.user.grant_moderation}} {{i18n admin.user.grant_moderation}}
@ -139,20 +139,20 @@
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n trust_level}}</div> <div class='field'>{{i18n trust_level}}</div>
<div class='value'>{{content.trustLevel.name}}</div> <div class='value'>{{trustLevel.name}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.banned}}</div> <div class='field'>{{i18n admin.user.banned}}</div>
<div class='value'>{{content.isBanned}}</div> <div class='value'>{{isBanned}}</div>
<div class='controls'> <div class='controls'>
{{#if content.isBanned}} {{#if isBanned}}
<button class='btn btn-danger' {{action unban target="content"}}> <button class='btn btn-danger' {{action unban target="content"}}>
<i class='icon icon-ban-circle'></i> <i class='icon icon-ban-circle'></i>
{{i18n admin.user.unban}} {{i18n admin.user.unban}}
</button> </button>
{{content.banDuration}} {{banDuration}}
{{else}} {{else}}
{{#if content.canBan}} {{#if canBan}}
<button class='btn btn-danger' {{action ban target="content"}}> <button class='btn btn-danger' {{action ban target="content"}}>
<i class='icon icon-ban-circle'></i> <i class='icon icon-ban-circle'></i>
{{i18n admin.user.ban}} {{i18n admin.user.ban}}
@ -168,29 +168,29 @@
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n created}}</div> <div class='field'>{{i18n created}}</div>
<div class='value'>{{{content.created_at_age}}}</div> <div class='value'>{{{created_at_age}}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.users.last_emailed}}</div> <div class='field'>{{i18n admin.users.last_emailed}}</div>
<div class='value'>{{{content.last_emailed_age}}}</div> <div class='value'>{{{last_emailed_age}}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n last_seen}}</div> <div class='field'>{{i18n last_seen}}</div>
<div class='value'>{{{content.last_seen_age}}}</div> <div class='value'>{{{last_seen_age}}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.like_count}}</div> <div class='field'>{{i18n admin.user.like_count}}</div>
<div class='value'>{{content.like_count}}</div> <div class='value'>{{like_count}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.topics_entered}}</div> <div class='field'>{{i18n admin.user.topics_entered}}</div>
<div class='value'>{{content.topics_entered}}</div> <div class='value'>{{topics_entered}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.post_count}}</div> <div class='field'>{{i18n admin.user.post_count}}</div>
<div class='value'>{{content.post_count}}</div> <div class='value'>{{post_count}}</div>
<div class='controls'> <div class='controls'>
{{#if content.can_delete_all_posts}} {{#if can_delete_all_posts}}
<button class='btn btn-danger' {{action deleteAllPosts target="content"}}> <button class='btn btn-danger' {{action deleteAllPosts target="content"}}>
<i class='icon icon-trash'></i> <i class='icon icon-trash'></i>
{{i18n admin.user.delete_all_posts}} {{i18n admin.user.delete_all_posts}}
@ -200,27 +200,27 @@
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.posts_read_count}}</div> <div class='field'>{{i18n admin.user.posts_read_count}}</div>
<div class='value'>{{content.posts_read_count}}</div> <div class='value'>{{posts_read_count}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.flags_given_count}}</div> <div class='field'>{{i18n admin.user.flags_given_count}}</div>
<div class='value'>{{content.flags_given_count}}</div> <div class='value'>{{flags_given_count}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.flags_received_count}}</div> <div class='field'>{{i18n admin.user.flags_received_count}}</div>
<div class='value'>{{content.flags_received_count}}</div> <div class='value'>{{flags_received_count}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.private_topics_count}}</div> <div class='field'>{{i18n admin.user.private_topics_count}}</div>
<div class='value'>{{content.private_topics_count}}</div> <div class='value'>{{private_topics_count}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n admin.user.time_read}}</div> <div class='field'>{{i18n admin.user.time_read}}</div>
<div class='value'>{{{content.time_read}}}</div> <div class='value'>{{{time_read}}}</div>
</div> </div>
<div class='display-row'> <div class='display-row'>
<div class='field'>{{i18n user.invited.days_visited}}</div> <div class='field'>{{i18n user.invited.days_visited}}</div>
<div class='value'>{{{content.days_visited}}}</div> <div class='value'>{{{days_visited}}}</div>
</div> </div>
</section> </section>

View File

@ -25,7 +25,7 @@
{{#if loading}} {{#if loading}}
<div class='admin-loading'>{{i18n loading}}</div> <div class='admin-loading'>{{i18n loading}}</div>
{{else}} {{else}}
{{#if content.length}} {{#if model.length}}
<table class='table'> <table class='table'>
<tr> <tr>
{{#if showApproval}} {{#if showApproval}}
@ -47,7 +47,7 @@
</tr> </tr>
{{#each content}} {{#each model}}
<tr {{bindAttr class="selected"}}> <tr {{bindAttr class="selected"}}>
{{#if showApproval}} {{#if showApproval}}
<td> <td>

View File

@ -462,6 +462,7 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
showHistory: function(post) { showHistory: function(post) {
var modalController = this.get('controllers.modal'); var modalController = this.get('controllers.modal');
if (modalController) { if (modalController) {
modalController.show(Discourse.HistoryView.create({ modalController.show(Discourse.HistoryView.create({
originalPost: post originalPost: post

View File

@ -3,40 +3,42 @@
{{#if view.loading}} {{#if view.loading}}
{{i18n loading}} {{i18n loading}}
{{else}} {{else}}
<div class='span8'> {{#if view.versions}}
<div class='span8'>
{{view Ember.Select {{view Ember.Select
contentBinding="view.versions" contentBinding="view.versions"
optionLabelPath="content.description" optionLabelPath="content.description"
optionValuePath="content.number" optionValuePath="content.number"
selectionBinding="view.versionLeft"}} selectionBinding="view.versionLeft"}}
<div class='contents'>
{{#if view.postLeft}}
{{{view.postLeft.cooked}}}
{{else}}
<div class='history-loading'>{{i18n loading}}</div>
{{/if}}
</div>
<div class='contents'>
{{#if view.postLeft}}
{{{view.postLeft.cooked}}}
{{else}}
<div class='history-loading'>{{i18n loading}}</div>
{{/if}}
</div> </div>
</div> <div class='span8 offset1'>
{{view Ember.Select
contentBinding="view.versions"
optionLabelPath="content.description"
optionValuePath="content.number"
selectionBinding="view.versionRight"}}
<div class='span8 offset1'> <div class='contents'>
{{view Ember.Select {{#if view.diff}}
contentBinding="view.versions" {{{view.diff}}}
optionLabelPath="content.description" {{else}}
optionValuePath="content.number" <div class='history-loading'>{{i18n loading}}</div>
selectionBinding="view.versionRight"}} {{/if}}
</div>
<div class='contents'>
{{#if view.diff}}
{{{view.diff}}}
{{else}}
<div class='history-loading'>{{i18n loading}}</div>
{{/if}}
</div> </div>
{{/if}}
</div>
{{/if}} {{/if}}
</div> </div>

View File

@ -58,7 +58,7 @@
<div class='span5 gutter'> <div class='span5 gutter'>
{{collection contentBinding="internalLinks" itemViewClass="Discourse.PostLinkView" tagName="ul" classNames="post-links"}} {{collection contentBinding="internalLinks" itemViewClass="Discourse.PostLinkView" tagName="ul" classNames="post-links"}}
{{#if controller.content.can_reply_as_new_topic}} {{#if controller.can_reply_as_new_topic}}
<a href='#' class='reply-new' {{action replyAsNewTopic this}}><i class='icon icon-plus'></i>{{i18n post.reply_as_new_topic}}</a> <a href='#' class='reply-new' {{action replyAsNewTopic this}}><i class='icon icon-plus'></i>{{i18n post.reply_as_new_topic}}</a>
{{/if}} {{/if}}
</div> </div>

View File

@ -58,7 +58,7 @@
<div class='spinner'>{{i18n loading}}</div> <div class='spinner'>{{i18n loading}}</div>
{{/if}} {{/if}}
{{collection itemViewClass="Discourse.PostView" contentBinding="content.posts" topicViewBinding="view"}} {{collection itemViewClass="Discourse.PostView" contentBinding="posts" topicViewBinding="view"}}
{{#if loadingBelow}} {{#if loadingBelow}}
<div class='spinner'>{{i18n loading}}</div> <div class='spinner'>{{i18n loading}}</div>

View File

@ -7,14 +7,14 @@
<button {{action toggleMultiSelect}} class='btn btn-admin'><i class='icon-tasks'></i> {{i18n topic.actions.multi_select}}</button> <button {{action toggleMultiSelect}} class='btn btn-admin'><i class='icon-tasks'></i> {{i18n topic.actions.multi_select}}</button>
</li> </li>
{{#if content.can_delete}} {{#if can_delete}}
<li> <li>
<button {{action deleteTopic}} class='btn btn-admin btn-danger'><i class='icon-trash'></i> {{i18n topic.actions.delete}}</button> <button {{action deleteTopic}} class='btn btn-admin btn-danger'><i class='icon-trash'></i> {{i18n topic.actions.delete}}</button>
</li> </li>
{{/if}} {{/if}}
<li> <li>
{{#if content.closed}} {{#if closed}}
<button {{action toggleClosed}} class='btn btn-admin'><i class='icon-unlock'></i> {{i18n topic.actions.open}}</button> <button {{action toggleClosed}} class='btn btn-admin'><i class='icon-unlock'></i> {{i18n topic.actions.open}}</button>
{{else}} {{else}}
<button {{action toggleClosed}} class='btn btn-admin'><i class='icon-lock'></i> {{i18n topic.actions.close}}</button> <button {{action toggleClosed}} class='btn btn-admin'><i class='icon-lock'></i> {{i18n topic.actions.close}}</button>
@ -23,7 +23,7 @@
</li> </li>
<li> <li>
{{#if content.pinned}} {{#if pinned}}
<button {{action togglePinned}} class='btn btn-admin'><i class='icon-pushpin'></i> {{i18n topic.actions.unpin}}</button> <button {{action togglePinned}} class='btn btn-admin'><i class='icon-pushpin'></i> {{i18n topic.actions.unpin}}</button>
{{else}} {{else}}
<button {{action togglePinned}} class='btn btn-admin'><i class='icon-pushpin'></i> {{i18n topic.actions.pin}}</button> <button {{action togglePinned}} class='btn btn-admin'><i class='icon-pushpin'></i> {{i18n topic.actions.pin}}</button>
@ -31,7 +31,7 @@
</li> </li>
<li> <li>
{{#if content.archived}} {{#if archived}}
<button {{action toggleArchived}} class='btn btn-admin'><i class='icon-folder-close'></i> {{i18n topic.actions.unarchive}}</button> <button {{action toggleArchived}} class='btn btn-admin'><i class='icon-folder-close'></i> {{i18n topic.actions.unarchive}}</button>
{{else}} {{else}}
<button {{action toggleArchived}} class='btn btn-admin'><i class='icon-folder-close'></i> {{i18n topic.actions.archive}}</button> <button {{action toggleArchived}} class='btn btn-admin'><i class='icon-folder-close'></i> {{i18n topic.actions.archive}}</button>
@ -39,7 +39,7 @@
</li> </li>
<li> <li>
{{#if content.visible}} {{#if visible}}
<button {{action toggleVisibility}} class='btn btn-admin'><i class='icon-eye-close'></i> {{i18n topic.actions.invisible}}</button> <button {{action toggleVisibility}} class='btn btn-admin'><i class='icon-eye-close'></i> {{i18n topic.actions.invisible}}</button>
{{else}} {{else}}
<button {{action toggleVisibility}} class='btn btn-admin'><i class='icon-eye-open'></i> {{i18n topic.actions.visible}}</button> <button {{action toggleVisibility}} class='btn btn-admin'><i class='icon-eye-open'></i> {{i18n topic.actions.visible}}</button>

View File

@ -82,10 +82,10 @@
<section class='links'> <section class='links'>
<ul class='topic-links'> <ul class='topic-links'>
{{#collection contentBinding="view.parentView.infoLinks" itemTagName="li"}} {{#collection contentBinding="view.parentView.infoLinks" itemTagName="li"}}
<span class='badge badge-notification clicks' title='{{i18n topic_summary.clicks}}'>{{view.content.clicks}}</span> <span class='badge badge-notification clicks' title='{{i18n topic_summary.clicks}}'>{{clicks}}</span>
<a href="{{unbound view.content.url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound view.content.user_id}}" data-ignore-post-id="true" title="{{unbound view.content.url}}"> <a href="{{unbound url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound user_id}}" data-ignore-post-id="true" title="{{unbound url}}">
{{#if view.content.title}}{{shorten view.content.title}}{{else}}{{shortenUrl view.content.url}}{{/if}} {{#if title}}{{shorten title}}{{else}}{{shortenUrl url}}{{/if}}
{{#if view.content.internal}}<i class='icon-arrow-right' title='{{i18n topic_summary.topic_link}}'></i>{{/if}} {{#if internal}}<i class='icon-arrow-right' title='{{i18n topic_summary.topic_link}}'></i>{{/if}}
</a> </a>
{{/collection}} {{/collection}}
</ul> </ul>

View File

@ -1,11 +1,11 @@
<div id='user-info'> <div id='user-info'>
<nav class='buttons'> <nav class='buttons'>
{{#if content.can_edit}} {{#if can_edit}}
{{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}} {{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}}
{{/if}} {{/if}}
<br/> <br/>
{{#if content.can_send_private_message_to_user}} {{#if can_send_private_message_to_user}}
<button class='btn create' {{action composePrivateMessage}}> <button class='btn create' {{action composePrivateMessage}}>
<i class='icon icon-envelope-alt'></i> <i class='icon icon-envelope-alt'></i>
{{i18n user.private_message}} {{i18n user.private_message}}
@ -22,27 +22,27 @@
</ul> </ul>
<div class='show'> <div class='show'>
<dl> <dl>
{{#if content.hasWebsite}} {{#if hasWebsite}}
<dt>{{i18n user.website}}:</dt><dd><a {{bindAttr href="content.website"}} target="_blank">{{content.websiteName}}</a></dd> <dt>{{i18n user.website}}:</dt><dd><a {{bindAttr href="website"}} target="_blank">{{websiteName}}</a></dd>
{{/if}} {{/if}}
<dt>{{i18n user.created}}:</dt><dd>{{date content.created_at}}</dd> <dt>{{i18n user.created}}:</dt><dd>{{date created_at}}</dd>
{{#if content.last_posted_at}} {{#if last_posted_at}}
<dt>{{i18n user.last_posted}}:</dt><dd>{{date content.last_posted_at}}</dd> <dt>{{i18n user.last_posted}}:</dt><dd>{{date last_posted_at}}</dd>
{{/if}} {{/if}}
{{#if content.last_seen_at}} {{#if last_seen_at}}
<dt>{{i18n user.last_seen}}:</dt><dd>{{date content.last_seen_at}}</dd> <dt>{{i18n user.last_seen}}:</dt><dd>{{date last_seen_at}}</dd>
{{/if}} {{/if}}
{{#if content.invited_by}} {{#if invited_by}}
<dt>{{i18n user.invited_by}}:</dt><dd>{{#linkTo user.activity content.invited_by}}{{content.invited_by.username}}{{/linkTo}}</dd> <dt>{{i18n user.invited_by}}:</dt><dd>{{#linkTo user.activity invited_by}}{{invited_by.username}}{{/linkTo}}</dd>
{{/if}} {{/if}}
{{#if content.email}} {{#if email}}
<dt>{{i18n user.email.title}}:</dt><dd {{bindAttr title="content.email"}}>{{content.email}}</dd> <dt>{{i18n user.email.title}}:</dt><dd {{bindAttr title="email"}}>{{email}}</dd>
{{/if}} {{/if}}
<dt>{{i18n user.trust_level}}:</dt><dd>{{content.trustLevel.name}}</dd> <dt>{{i18n user.trust_level}}:</dt><dd>{{trustLevel.name}}</dd>
</dl> </dl>
</div> </div>
{{#if content.can_edit}} {{#if can_edit}}
<div style='margin-top: 10px'> <div style='margin-top: 10px'>
<button class='btn' data-not-implemented='true' disabled title="{{i18n not_implemented}}">{{i18n user.download_archive}}</button> <button class='btn' data-not-implemented='true' disabled title="{{i18n not_implemented}}">{{i18n user.download_archive}}</button>
</div> </div>

View File

@ -1,10 +1,10 @@
<div id='invited-users'> <div id='invited-users'>
{{#if content.empty}} {{#if empty}}
<div id='no-invites' class='boxed white'> <div id='no-invites' class='boxed white'>
{{i18n user.invited.none username="content.user.username"}} {{i18n user.invited.none username="user.username"}}
</div> </div>
{{else}} {{else}}
{{#if content.redeemed}} {{#if redeemed}}
<div class='invites'> <div class='invites'>
<h2>{{i18n user.invited.redeemed}}</h2> <h2>{{i18n user.invited.redeemed}}</h2>
<div class='boxed white'> <div class='boxed white'>
@ -18,7 +18,7 @@
<th>{{i18n user.invited.time_read}}</th> <th>{{i18n user.invited.time_read}}</th>
<th>{{i18n user.invited.days_visited}}</th> <th>{{i18n user.invited.days_visited}}</th>
</tr> </tr>
{{#each content.redeemed}} {{#each redeemed}}
<tr> <tr>
<td> <td>
<a href="{{unbound user.path}}">{{avatar user imageSize="tiny"}}</a> <a href="{{unbound user.path}}">{{avatar user imageSize="tiny"}}</a>
@ -30,7 +30,7 @@
<td>{{number user.posts_read_count}}</td> <td>{{number user.posts_read_count}}</td>
<td>{{{unbound user.time_read}}}</td> <td>{{{unbound user.time_read}}}</td>
<td><span title="{{i18n user.invited.days_visited}}">{{{unbound user.days_visited}}}</span> <td><span title="{{i18n user.invited.days_visited}}">{{{unbound user.days_visited}}}</span>
/ /
<span title="{{i18n user.invited.account_age_days}}">{{{unbound user.days_since_created}}}</span></td> <span title="{{i18n user.invited.account_age_days}}">{{{unbound user.days_since_created}}}</span></td>
</tr> </tr>
{{/each}} {{/each}}
@ -39,7 +39,7 @@
</div> </div>
{{/if}} {{/if}}
{{#if content.pending}} {{#if pending}}
<div class='invites'> <div class='invites'>
<h2>{{i18n user.invited.pending}}</h2> <h2>{{i18n user.invited.pending}}</h2>
<div class='boxed white'> <div class='boxed white'>
@ -47,9 +47,9 @@
<tr> <tr>
<th style='width: 60%'>{{i18n user.email.title}}</th> <th style='width: 60%'>{{i18n user.email.title}}</th>
<th style='width: 20%'>{{i18n created}}</th> <th style='width: 20%'>{{i18n created}}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
{{#each content.pending}} {{#each pending}}
<tr> <tr>
<td>{{email}}</td> <td>{{email}}</td>
<td>{{date created_at}}</td> <td>{{date created_at}}</td>

View File

@ -1,10 +1,10 @@
<div id='user-info'> <div id='user-info'>
<nav class='buttons'> <nav class='buttons'>
{{#if content.can_edit}} {{#if can_edit}}
{{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}} {{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}}
{{/if}} {{/if}}
<br/> <br/>
{{#if content.can_send_private_message_to_user}} {{#if can_send_private_message_to_user}}
<button class='btn create' {{action composePrivateMessage}}> <button class='btn create' {{action composePrivateMessage}}>
<i class='icon icon-plus'></i> <i class='icon icon-plus'></i>
{{i18n user.private_message}} {{i18n user.private_message}}
@ -14,7 +14,7 @@
<div class='clearfix'></div> <div class='clearfix'></div>
<ul class='action-list nav-stacked side-nav'> <ul class='action-list nav-stacked side-nav'>
{{#each content.statsPmsOnly}} {{#each statsPmsOnly}}
{{view Discourse.ActivityFilterView contentBinding="this"}} {{view Discourse.ActivityFilterView contentBinding="this"}}
{{/each}} {{/each}}
</ul> </ul>