Removed many unnecessary paths that included `content.x` when just `x` would do.
This commit is contained in:
parent
9544cfd7dc
commit
42248a7164
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminCustomizeController = Ember.Controller.extend({
|
||||
Discourse.AdminCustomizeController = Ember.ArrayController.extend({
|
||||
|
||||
/**
|
||||
Create a new customization style
|
||||
|
@ -15,8 +15,8 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
|
|||
**/
|
||||
newCustomization: function() {
|
||||
var item = Discourse.SiteCustomization.create({name: Em.String.i18n("admin.customize.new_style")});
|
||||
this.get('content').pushObject(item);
|
||||
this.set('content.selectedItem', item);
|
||||
this.pushObject(item);
|
||||
this.set('selectedItem', item);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
|
|||
@param {Discourse.SiteCustomization} style The style we are selecting
|
||||
**/
|
||||
selectStyle: function(style) {
|
||||
this.set('content.selectedItem', style);
|
||||
this.set('selectedItem', style);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ Discourse.AdminCustomizeController = Ember.Controller.extend({
|
|||
@method save
|
||||
**/
|
||||
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) {
|
||||
var selected;
|
||||
if (result) {
|
||||
selected = _this.get('content.selectedItem');
|
||||
selected = _this.get('selectedItem');
|
||||
selected.destroy();
|
||||
_this.set('content.selectedItem', null);
|
||||
return _this.get('content').removeObject(selected);
|
||||
_this.set('selectedItem', null);
|
||||
return _this.removeObject(selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminFlagsController = Ember.Controller.extend({
|
||||
Discourse.AdminFlagsController = Ember.ArrayController.extend({
|
||||
|
||||
/**
|
||||
Clear all flags on a post
|
||||
|
@ -17,10 +17,10 @@ Discourse.AdminFlagsController = Ember.Controller.extend({
|
|||
clearFlags: function(item) {
|
||||
var _this = this;
|
||||
item.clearFlags().then((function() {
|
||||
_this.content.removeObject(item);
|
||||
}), (function() {
|
||||
_this.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
}));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -32,10 +32,10 @@ Discourse.AdminFlagsController = Ember.Controller.extend({
|
|||
deletePost: function(item) {
|
||||
var _this = this;
|
||||
item.deletePost().then((function() {
|
||||
_this.content.removeObject(item);
|
||||
}), (function() {
|
||||
_this.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
}));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
**/
|
||||
Discourse.FlaggedPost = Discourse.Post.extend({
|
||||
|
||||
flaggers: (function() {
|
||||
flaggers: function() {
|
||||
var r,
|
||||
_this = this;
|
||||
r = [];
|
||||
|
@ -16,9 +16,9 @@ Discourse.FlaggedPost = Discourse.Post.extend({
|
|||
return r.push(_this.userLookup[a.user_id]);
|
||||
});
|
||||
return r;
|
||||
}).property(),
|
||||
}.property(),
|
||||
|
||||
messages: (function() {
|
||||
messages: function() {
|
||||
var r,
|
||||
_this = this;
|
||||
r = [];
|
||||
|
@ -32,7 +32,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
|
|||
}
|
||||
});
|
||||
return r;
|
||||
}).property(),
|
||||
}.property(),
|
||||
|
||||
lastFlagged: function() {
|
||||
return this.post_actions[0].created_at;
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminApiRoute = Discourse.Route.extend({
|
||||
renderTemplate: function() {
|
||||
this.render({into: 'admin/templates/admin'});
|
||||
|
||||
model: function() {
|
||||
return Discourse.AdminApi.find();
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
// in case you are wondering, model never gets called for link_to
|
||||
Discourse.AdminApi.find().then(function(result){
|
||||
controller.set('content', result);
|
||||
});
|
||||
renderTemplate: function() {
|
||||
this.render({into: 'admin/templates/admin'});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
**/
|
||||
Discourse.AdminCustomizeRoute = Discourse.Route.extend({
|
||||
|
||||
renderTemplate: function() {
|
||||
this.render({into: 'admin/templates/admin'});
|
||||
model: function() {
|
||||
return Discourse.SiteCustomization.findAll();
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
// in case you are wondering, model never gets called for link_to
|
||||
controller.set('content',Discourse.SiteCustomization.findAll());
|
||||
renderTemplate: function() {
|
||||
this.render({into: 'admin/templates/admin'});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
/**
|
||||
Handles routes related to viewing active flags.
|
||||
|
||||
@class AdminFlagsActiveRoute
|
||||
@class AdminFlagsActiveRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminFlagsActiveRoute = Discourse.Route.extend({
|
||||
|
||||
model: function() {
|
||||
return Discourse.FlaggedPost.findAll('active');
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
setupController: function() {
|
||||
var adminFlagsController = this.controllerFor('adminFlags');
|
||||
adminFlagsController.set('content', model);
|
||||
adminFlagsController.set('content', Discourse.FlaggedPost.findAll('active'));
|
||||
adminFlagsController.set('query', 'active');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
/**
|
||||
Handles routes related to viewing old flags.
|
||||
|
||||
@class AdminFlagsOldRoute
|
||||
@class AdminFlagsOldRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminFlagsOldRoute = Discourse.Route.extend({
|
||||
|
||||
model: function() {
|
||||
return Discourse.FlaggedPost.findAll('old');
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
var adminFlagsController = this.controllerFor('adminFlags');
|
||||
adminFlagsController.set('content', model);
|
||||
adminFlagsController.set('content', Discourse.FlaggedPost.findAll('old'));
|
||||
adminFlagsController.set('query', 'old');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<h3>{{i18n admin.api.long_title}}</h3>
|
||||
{{#if content.keyExists}}
|
||||
<strong>{{i18n admin.api.key}}:</strong> {{content.key}}
|
||||
<button {{action regenerateKey target="content"}}>{{i18n admin.api.regenerate}}</button>
|
||||
{{#if keyExists}}
|
||||
<strong>{{i18n admin.api.key}}:</strong> {{key}}
|
||||
<button {{action regenerateKey target="model"}}>{{i18n admin.api.regenerate}}</button>
|
||||
<p>{{{i18n admin.api.note_html}}}</p>
|
||||
{{else}}
|
||||
<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}}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class='content-list span6'>
|
||||
<h3>{{i18n admin.customize.long_title}}</h3>
|
||||
<ul>
|
||||
{{#each content}}
|
||||
{{#each model}}
|
||||
<li><a {{action selectStyle this}} {{bindAttr class="this.selected:active"}}>{{this.description}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
@ -10,7 +10,7 @@
|
|||
</div>
|
||||
|
||||
|
||||
{{#if content.selectedItem}}
|
||||
{{#if selectedItem}}
|
||||
<div class='current-style'>
|
||||
<div class='admin-controls'>
|
||||
<ul class="nav nav-pills">
|
||||
|
@ -23,7 +23,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
{{#with content.selectedItem}}
|
||||
{{#with selectedItem}}
|
||||
{{textField class="style-name" value=name}}
|
||||
{{#if view.headerActive}}
|
||||
{{view Discourse.AceEditorView contentBinding="header" mode="html"}}
|
||||
|
@ -34,18 +34,18 @@
|
|||
{{/with}}
|
||||
<br>
|
||||
<div class='status-actions'>
|
||||
<span>{{i18n admin.customize.override_default}} {{view Ember.Checkbox checkedBinding="content.selectedItem.override_default_style"}}</span>
|
||||
<span>{{i18n admin.customize.enabled}} {{view Ember.Checkbox checkedBinding="content.selectedItem.enabled"}}</span>
|
||||
{{#unless content.selectedItem.changed}}
|
||||
<a class='preview-link' {{bindAttr href="content.selectedItem.previewUrl"}} target='_blank'>{{i18n admin.customize.preview}}</a>
|
||||
<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>
|
||||
{{#unless selectedItem.changed}}
|
||||
<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>
|
||||
{{/unless}}
|
||||
</div>
|
||||
|
||||
<div class='buttons'>
|
||||
<button {{action save}} {{bindAttr disabled="content.selectedItem.disableSave"}} class='btn'>{{i18n admin.customize.save}}</button>
|
||||
<span class='saving'>{{content.selectedItem.savingStatus}}</span>
|
||||
<button {{action save}} {{bindAttr disabled="selectedItem.disableSave"}} class='btn'>{{i18n admin.customize.save}}</button>
|
||||
<span class='saving'>{{selectedItem.savingStatus}}</span>
|
||||
<a {{action destroy}} class='delete-link'>{{i18n admin.customize.delete}}</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -19,17 +19,17 @@
|
|||
{{#if model.length}}
|
||||
{{#group}}
|
||||
{{#collection contentBinding="model" tagName="tbody" itemTagName="tr"}}
|
||||
<td>{{date view.content.created_at}}</td>
|
||||
<td>{{date created_at}}</td>
|
||||
<td>
|
||||
{{#if view.content.user}}
|
||||
{{#linkTo 'adminUser' view.content.user}}{{avatar view.content.user imageSize="tiny"}}{{/linkTo}}
|
||||
{{#linkTo 'adminUser' view.content.user}}{{view.content.user.username}}{{/linkTo}}
|
||||
{{#if user}}
|
||||
{{#linkTo 'adminUser' user}}{{avatar user imageSize="tiny"}}{{/linkTo}}
|
||||
{{#linkTo 'adminUser' user}}{{user.username}}{{/linkTo}}
|
||||
{{else}}
|
||||
—
|
||||
{{/if}}
|
||||
</td>
|
||||
<td><a href='mailto:{{unbound view.content.to_address}}'>{{view.content.to_address}}</a></td>
|
||||
<td>{{view.content.email_type}}</td>
|
||||
<td><a href='mailto:{{unbound to_address}}'>{{to_address}}</a></td>
|
||||
<td>{{email_type}}</td>
|
||||
{{/collection}}
|
||||
{{/group}}
|
||||
{{/if}}
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
<td class='last-flagged'>{{date lastFlagged}}</td>
|
||||
<td class='action'>
|
||||
{{#if adminActiveFlagsView}}
|
||||
<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.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>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
<p class='description'>{{description}}</p>
|
||||
|
||||
{{#if markdown}}
|
||||
{{view Discourse.PagedownEditor valueBinding="content.content"}}
|
||||
{{view Discourse.PagedownEditor valueBinding="model.content"}}
|
||||
{{/if}}
|
||||
|
||||
{{#if plainText}}
|
||||
{{textarea value=content.content class="plain"}}
|
||||
{{textarea value=model.content class="plain"}}
|
||||
{{/if}}
|
||||
|
||||
{{#if html}}
|
||||
{{view Discourse.AceEditorView contentBinding="content.content" mode="html"}}
|
||||
{{view Discourse.AceEditorView contentBinding="model.content" mode="html"}}
|
||||
{{/if}}
|
||||
|
||||
{{#if css}}
|
||||
{{view Discourse.AceEditorView contentBinding="content.content" mode="css"}}
|
||||
{{view Discourse.AceEditorView contentBinding="model.content" mode="css"}}
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
{{collection contentBinding="filteredContent" classNames="form-horizontal settings" itemViewClass="Discourse.SiteSettingView"}}
|
||||
|
||||
<!-- 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>
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n user.username.title}}</div>
|
||||
<div class='value'>{{content.username}}</div>
|
||||
<div class='value'>{{username}}</div>
|
||||
<div class='controls'>
|
||||
{{#linkTo 'user.activity' content class="btn"}}
|
||||
<i class='icon icon-user'></i>
|
||||
{{i18n admin.user.show_public_profile}}
|
||||
{{/linkTo}}
|
||||
{{#if content.can_impersonate}}
|
||||
{{#if can_impersonate}}
|
||||
<button class='btn' {{action impersonate target="content"}}>
|
||||
<i class='icon icon-screenshot'></i>
|
||||
{{i18n admin.user.impersonate}}
|
||||
|
@ -19,7 +19,7 @@
|
|||
|
||||
<div class='display-row'>
|
||||
<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 class='display-row' style='height: 50px'>
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
<div class='display-row' style='height: 50px'>
|
||||
<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'>
|
||||
{{#if Discourse.currentUser.admin}}
|
||||
<button class='btn' {{action refreshBrowsers target="content"}}>
|
||||
|
@ -48,18 +48,18 @@
|
|||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.users.approved}}</div>
|
||||
<div class='value'>
|
||||
{{#if content.approved}}
|
||||
{{#if approved}}
|
||||
{{i18n admin.user.approved_by}}
|
||||
|
||||
{{#linkTo 'adminUser' content.approved_by}}{{avatar approved_by imageSize="small"}}{{/linkTo}}
|
||||
{{#linkTo 'adminUser' content.approved_by}}{{content.approved_by.username}}{{/linkTo}}
|
||||
{{#linkTo 'adminUser' approved_by}}{{avatar approved_by imageSize="small"}}{{/linkTo}}
|
||||
{{#linkTo 'adminUser' approved_by}}{{approved_by.username}}{{/linkTo}}
|
||||
{{else}}
|
||||
{{i18n no_value}}
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
<div class='controls'>
|
||||
{{#if content.can_approve}}
|
||||
{{#if can_approve}}
|
||||
<button class='btn' {{action approve target="content"}}>
|
||||
<i class='icon icon-ok'></i>
|
||||
{{i18n admin.user.approve}}
|
||||
|
@ -71,25 +71,25 @@
|
|||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.users.active}}</div>
|
||||
<div class='value'>
|
||||
{{#if content.active}}
|
||||
{{#if active}}
|
||||
{{i18n yes_value}}
|
||||
{{else}}
|
||||
{{i18n no_value}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class='controls'>
|
||||
{{#if content.active}}
|
||||
{{#if content.can_deactivate}}
|
||||
{{#if active}}
|
||||
{{#if can_deactivate}}
|
||||
<button class='btn' {{action deactivate target="content"}}>{{i18n admin.user.deactivate_account}}</button>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if content.can_send_activation_email}}
|
||||
{{#if can_send_activation_email}}
|
||||
<button class='btn' {{action sendActivationEmail target="content"}}>
|
||||
<i class='icon icon-envelope-alt'></i>
|
||||
{{i18n admin.user.send_activation_email}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{#if content.can_activate}}
|
||||
{{#if can_activate}}
|
||||
<button class='btn' {{action activate target="content"}}>
|
||||
<i class='icon icon-ok'></i>
|
||||
{{i18n admin.user.activate}}
|
||||
|
@ -101,15 +101,15 @@
|
|||
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.user.admin}}</div>
|
||||
<div class='value'>{{content.admin}}</div>
|
||||
<div class='value'>{{admin}}</div>
|
||||
<div class='controls'>
|
||||
{{#if content.can_revoke_admin}}
|
||||
{{#if can_revoke_admin}}
|
||||
<button class='btn' {{action revokeAdmin target="content"}}>
|
||||
<i class='icon icon-trophy'></i>
|
||||
{{i18n admin.user.revoke_admin}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{#if content.can_grant_admin}}
|
||||
{{#if can_grant_admin}}
|
||||
<button class='btn' {{action grantAdmin target="content"}}>
|
||||
<i class='icon icon-trophy'></i>
|
||||
{{i18n admin.user.grant_admin}}
|
||||
|
@ -120,15 +120,15 @@
|
|||
</div>
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.user.moderator}}</div>
|
||||
<div class='value'>{{content.moderator}}</div>
|
||||
<div class='value'>{{moderator}}</div>
|
||||
<div class='controls'>
|
||||
{{#if content.can_revoke_moderation}}
|
||||
{{#if can_revoke_moderation}}
|
||||
<button class='btn' {{action revokeModeration target="content"}}>
|
||||
<i class='icon icon-magic'></i>
|
||||
{{i18n admin.user.revoke_moderation}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{#if content.can_grant_moderation}}
|
||||
{{#if can_grant_moderation}}
|
||||
<button class='btn' {{action grantModeration target="content"}}>
|
||||
<i class='icon icon-magic'></i>
|
||||
{{i18n admin.user.grant_moderation}}
|
||||
|
@ -139,20 +139,20 @@
|
|||
</div>
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n trust_level}}</div>
|
||||
<div class='value'>{{content.trustLevel.name}}</div>
|
||||
<div class='value'>{{trustLevel.name}}</div>
|
||||
</div>
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.user.banned}}</div>
|
||||
<div class='value'>{{content.isBanned}}</div>
|
||||
<div class='value'>{{isBanned}}</div>
|
||||
<div class='controls'>
|
||||
{{#if content.isBanned}}
|
||||
{{#if isBanned}}
|
||||
<button class='btn btn-danger' {{action unban target="content"}}>
|
||||
<i class='icon icon-ban-circle'></i>
|
||||
{{i18n admin.user.unban}}
|
||||
</button>
|
||||
{{content.banDuration}}
|
||||
{{banDuration}}
|
||||
{{else}}
|
||||
{{#if content.canBan}}
|
||||
{{#if canBan}}
|
||||
<button class='btn btn-danger' {{action ban target="content"}}>
|
||||
<i class='icon icon-ban-circle'></i>
|
||||
{{i18n admin.user.ban}}
|
||||
|
@ -168,29 +168,29 @@
|
|||
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n created}}</div>
|
||||
<div class='value'>{{{content.created_at_age}}}</div>
|
||||
<div class='value'>{{{created_at_age}}}</div>
|
||||
</div>
|
||||
<div class='display-row'>
|
||||
<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 class='display-row'>
|
||||
<div class='field'>{{i18n last_seen}}</div>
|
||||
<div class='value'>{{{content.last_seen_age}}}</div>
|
||||
<div class='value'>{{{last_seen_age}}}</div>
|
||||
</div>
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.user.like_count}}</div>
|
||||
<div class='value'>{{content.like_count}}</div>
|
||||
<div class='value'>{{like_count}}</div>
|
||||
</div>
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n admin.user.topics_entered}}</div>
|
||||
<div class='value'>{{content.topics_entered}}</div>
|
||||
<div class='value'>{{topics_entered}}</div>
|
||||
</div>
|
||||
<div class='display-row'>
|
||||
<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'>
|
||||
{{#if content.can_delete_all_posts}}
|
||||
{{#if can_delete_all_posts}}
|
||||
<button class='btn btn-danger' {{action deleteAllPosts target="content"}}>
|
||||
<i class='icon icon-trash'></i>
|
||||
{{i18n admin.user.delete_all_posts}}
|
||||
|
@ -200,27 +200,27 @@
|
|||
</div>
|
||||
<div class='display-row'>
|
||||
<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 class='display-row'>
|
||||
<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 class='display-row'>
|
||||
<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 class='display-row'>
|
||||
<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 class='display-row'>
|
||||
<div class='field'>{{i18n admin.user.time_read}}</div>
|
||||
<div class='value'>{{{content.time_read}}}</div>
|
||||
<div class='value'>{{{time_read}}}</div>
|
||||
</div>
|
||||
<div class='display-row'>
|
||||
<div class='field'>{{i18n user.invited.days_visited}}</div>
|
||||
<div class='value'>{{{content.days_visited}}}</div>
|
||||
<div class='value'>{{{days_visited}}}</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{{#if loading}}
|
||||
<div class='admin-loading'>{{i18n loading}}</div>
|
||||
{{else}}
|
||||
{{#if content.length}}
|
||||
{{#if model.length}}
|
||||
<table class='table'>
|
||||
<tr>
|
||||
{{#if showApproval}}
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
</tr>
|
||||
|
||||
{{#each content}}
|
||||
{{#each model}}
|
||||
<tr {{bindAttr class="selected"}}>
|
||||
{{#if showApproval}}
|
||||
<td>
|
||||
|
|
|
@ -462,6 +462,7 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
|||
|
||||
showHistory: function(post) {
|
||||
var modalController = this.get('controllers.modal');
|
||||
|
||||
if (modalController) {
|
||||
modalController.show(Discourse.HistoryView.create({
|
||||
originalPost: post
|
||||
|
|
|
@ -3,40 +3,42 @@
|
|||
{{#if view.loading}}
|
||||
{{i18n loading}}
|
||||
{{else}}
|
||||
<div class='span8'>
|
||||
{{#if view.versions}}
|
||||
<div class='span8'>
|
||||
|
||||
{{view Ember.Select
|
||||
contentBinding="view.versions"
|
||||
optionLabelPath="content.description"
|
||||
optionValuePath="content.number"
|
||||
selectionBinding="view.versionLeft"}}
|
||||
{{view Ember.Select
|
||||
contentBinding="view.versions"
|
||||
optionLabelPath="content.description"
|
||||
optionValuePath="content.number"
|
||||
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 class='span8 offset1'>
|
||||
{{view Ember.Select
|
||||
contentBinding="view.versions"
|
||||
optionLabelPath="content.description"
|
||||
optionValuePath="content.number"
|
||||
selectionBinding="view.versionRight"}}
|
||||
|
||||
<div class='span8 offset1'>
|
||||
{{view Ember.Select
|
||||
contentBinding="view.versions"
|
||||
optionLabelPath="content.description"
|
||||
optionValuePath="content.number"
|
||||
selectionBinding="view.versionRight"}}
|
||||
<div class='contents'>
|
||||
{{#if view.diff}}
|
||||
{{{view.diff}}}
|
||||
{{else}}
|
||||
<div class='history-loading'>{{i18n loading}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class='contents'>
|
||||
{{#if view.diff}}
|
||||
{{{view.diff}}}
|
||||
{{else}}
|
||||
<div class='history-loading'>{{i18n loading}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
</div>
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
<div class='span5 gutter'>
|
||||
{{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>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<div class='spinner'>{{i18n loading}}</div>
|
||||
{{/if}}
|
||||
|
||||
{{collection itemViewClass="Discourse.PostView" contentBinding="content.posts" topicViewBinding="view"}}
|
||||
{{collection itemViewClass="Discourse.PostView" contentBinding="posts" topicViewBinding="view"}}
|
||||
|
||||
{{#if loadingBelow}}
|
||||
<div class='spinner'>{{i18n loading}}</div>
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
<button {{action toggleMultiSelect}} class='btn btn-admin'><i class='icon-tasks'></i> {{i18n topic.actions.multi_select}}</button>
|
||||
</li>
|
||||
|
||||
{{#if content.can_delete}}
|
||||
{{#if can_delete}}
|
||||
<li>
|
||||
<button {{action deleteTopic}} class='btn btn-admin btn-danger'><i class='icon-trash'></i> {{i18n topic.actions.delete}}</button>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
<li>
|
||||
{{#if content.closed}}
|
||||
{{#if closed}}
|
||||
<button {{action toggleClosed}} class='btn btn-admin'><i class='icon-unlock'></i> {{i18n topic.actions.open}}</button>
|
||||
{{else}}
|
||||
<button {{action toggleClosed}} class='btn btn-admin'><i class='icon-lock'></i> {{i18n topic.actions.close}}</button>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</li>
|
||||
|
||||
<li>
|
||||
{{#if content.pinned}}
|
||||
{{#if pinned}}
|
||||
<button {{action togglePinned}} class='btn btn-admin'><i class='icon-pushpin'></i> {{i18n topic.actions.unpin}}</button>
|
||||
{{else}}
|
||||
<button {{action togglePinned}} class='btn btn-admin'><i class='icon-pushpin'></i> {{i18n topic.actions.pin}}</button>
|
||||
|
@ -31,7 +31,7 @@
|
|||
</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>
|
||||
{{else}}
|
||||
<button {{action toggleArchived}} class='btn btn-admin'><i class='icon-folder-close'></i> {{i18n topic.actions.archive}}</button>
|
||||
|
@ -39,7 +39,7 @@
|
|||
</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>
|
||||
{{else}}
|
||||
<button {{action toggleVisibility}} class='btn btn-admin'><i class='icon-eye-open'></i> {{i18n topic.actions.visible}}</button>
|
||||
|
|
|
@ -82,10 +82,10 @@
|
|||
<section class='links'>
|
||||
<ul class='topic-links'>
|
||||
{{#collection contentBinding="view.parentView.infoLinks" itemTagName="li"}}
|
||||
<span class='badge badge-notification clicks' title='{{i18n topic_summary.clicks}}'>{{view.content.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}}">
|
||||
{{#if view.content.title}}{{shorten view.content.title}}{{else}}{{shortenUrl view.content.url}}{{/if}}
|
||||
{{#if view.content.internal}}<i class='icon-arrow-right' title='{{i18n topic_summary.topic_link}}'></i>{{/if}}
|
||||
<span class='badge badge-notification clicks' title='{{i18n topic_summary.clicks}}'>{{clicks}}</span>
|
||||
<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 title}}{{shorten title}}{{else}}{{shortenUrl url}}{{/if}}
|
||||
{{#if internal}}<i class='icon-arrow-right' title='{{i18n topic_summary.topic_link}}'></i>{{/if}}
|
||||
</a>
|
||||
{{/collection}}
|
||||
</ul>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
<div id='user-info'>
|
||||
<nav class='buttons'>
|
||||
{{#if content.can_edit}}
|
||||
{{#if can_edit}}
|
||||
{{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}}
|
||||
{{/if}}
|
||||
<br/>
|
||||
{{#if content.can_send_private_message_to_user}}
|
||||
{{#if can_send_private_message_to_user}}
|
||||
<button class='btn create' {{action composePrivateMessage}}>
|
||||
<i class='icon icon-envelope-alt'></i>
|
||||
{{i18n user.private_message}}
|
||||
|
@ -22,27 +22,27 @@
|
|||
</ul>
|
||||
<div class='show'>
|
||||
<dl>
|
||||
{{#if content.hasWebsite}}
|
||||
<dt>{{i18n user.website}}:</dt><dd><a {{bindAttr href="content.website"}} target="_blank">{{content.websiteName}}</a></dd>
|
||||
{{#if hasWebsite}}
|
||||
<dt>{{i18n user.website}}:</dt><dd><a {{bindAttr href="website"}} target="_blank">{{websiteName}}</a></dd>
|
||||
{{/if}}
|
||||
<dt>{{i18n user.created}}:</dt><dd>{{date content.created_at}}</dd>
|
||||
{{#if content.last_posted_at}}
|
||||
<dt>{{i18n user.last_posted}}:</dt><dd>{{date content.last_posted_at}}</dd>
|
||||
<dt>{{i18n user.created}}:</dt><dd>{{date created_at}}</dd>
|
||||
{{#if last_posted_at}}
|
||||
<dt>{{i18n user.last_posted}}:</dt><dd>{{date last_posted_at}}</dd>
|
||||
{{/if}}
|
||||
{{#if content.last_seen_at}}
|
||||
<dt>{{i18n user.last_seen}}:</dt><dd>{{date content.last_seen_at}}</dd>
|
||||
{{#if last_seen_at}}
|
||||
<dt>{{i18n user.last_seen}}:</dt><dd>{{date last_seen_at}}</dd>
|
||||
{{/if}}
|
||||
{{#if content.invited_by}}
|
||||
<dt>{{i18n user.invited_by}}:</dt><dd>{{#linkTo user.activity content.invited_by}}{{content.invited_by.username}}{{/linkTo}}</dd>
|
||||
{{#if invited_by}}
|
||||
<dt>{{i18n user.invited_by}}:</dt><dd>{{#linkTo user.activity invited_by}}{{invited_by.username}}{{/linkTo}}</dd>
|
||||
{{/if}}
|
||||
{{#if content.email}}
|
||||
<dt>{{i18n user.email.title}}:</dt><dd {{bindAttr title="content.email"}}>{{content.email}}</dd>
|
||||
{{#if email}}
|
||||
<dt>{{i18n user.email.title}}:</dt><dd {{bindAttr title="email"}}>{{email}}</dd>
|
||||
{{/if}}
|
||||
<dt>{{i18n user.trust_level}}:</dt><dd>{{content.trustLevel.name}}</dd>
|
||||
<dt>{{i18n user.trust_level}}:</dt><dd>{{trustLevel.name}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{#if content.can_edit}}
|
||||
{{#if can_edit}}
|
||||
<div style='margin-top: 10px'>
|
||||
<button class='btn' data-not-implemented='true' disabled title="{{i18n not_implemented}}">{{i18n user.download_archive}}</button>
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<div id='invited-users'>
|
||||
{{#if content.empty}}
|
||||
{{#if empty}}
|
||||
<div id='no-invites' class='boxed white'>
|
||||
{{i18n user.invited.none username="content.user.username"}}
|
||||
{{i18n user.invited.none username="user.username"}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if content.redeemed}}
|
||||
{{#if redeemed}}
|
||||
<div class='invites'>
|
||||
<h2>{{i18n user.invited.redeemed}}</h2>
|
||||
<div class='boxed white'>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<th>{{i18n user.invited.time_read}}</th>
|
||||
<th>{{i18n user.invited.days_visited}}</th>
|
||||
</tr>
|
||||
{{#each content.redeemed}}
|
||||
{{#each redeemed}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{unbound user.path}}">{{avatar user imageSize="tiny"}}</a>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<td>{{number user.posts_read_count}}</td>
|
||||
<td>{{{unbound user.time_read}}}</td>
|
||||
<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>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
@ -39,7 +39,7 @@
|
|||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if content.pending}}
|
||||
{{#if pending}}
|
||||
<div class='invites'>
|
||||
<h2>{{i18n user.invited.pending}}</h2>
|
||||
<div class='boxed white'>
|
||||
|
@ -47,9 +47,9 @@
|
|||
<tr>
|
||||
<th style='width: 60%'>{{i18n user.email.title}}</th>
|
||||
<th style='width: 20%'>{{i18n created}}</th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
{{#each content.pending}}
|
||||
{{#each pending}}
|
||||
<tr>
|
||||
<td>{{email}}</td>
|
||||
<td>{{date created_at}}</td>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<div id='user-info'>
|
||||
<nav class='buttons'>
|
||||
{{#if content.can_edit}}
|
||||
{{#if can_edit}}
|
||||
{{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}}
|
||||
{{/if}}
|
||||
<br/>
|
||||
{{#if content.can_send_private_message_to_user}}
|
||||
{{#if can_send_private_message_to_user}}
|
||||
<button class='btn create' {{action composePrivateMessage}}>
|
||||
<i class='icon icon-plus'></i>
|
||||
{{i18n user.private_message}}
|
||||
|
@ -14,7 +14,7 @@
|
|||
<div class='clearfix'></div>
|
||||
|
||||
<ul class='action-list nav-stacked side-nav'>
|
||||
{{#each content.statsPmsOnly}}
|
||||
{{#each statsPmsOnly}}
|
||||
{{view Discourse.ActivityFilterView contentBinding="this"}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue