ES6: Removed and renamed some admin views
This commit is contained in:
parent
5a7ae8c63f
commit
3f729438ad
|
@ -0,0 +1,3 @@
|
|||
export default Ember.Component.extend({
|
||||
tagName: 'tbody'
|
||||
});
|
|
@ -92,9 +92,9 @@ Discourse.Report = Discourse.Model.extend({
|
|||
icon: function() {
|
||||
switch( this.get('type') ) {
|
||||
case 'flags':
|
||||
return 'fa-flag';
|
||||
return 'flag';
|
||||
case 'likes':
|
||||
return 'fa-heart';
|
||||
return 'heart';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<tr>
|
||||
<td class="title">
|
||||
{{#if report.icon}}
|
||||
{{fa-icon report.icon}}
|
||||
{{/if}}
|
||||
<a {{bind-attr href="report.reportUrl"}}>{{report.title}}</a>
|
||||
</td>
|
||||
<td class="value">{{report.todayCount}}</td>
|
||||
<td {{bind-attr class=":value report.yesterdayTrend"}} {{bind-attr title="report.yesterdayCountTitle"}}>{{report.yesterdayCount}} {{fa-icon "caret-up" class="up"}} {{fa-icon "caret-down" class="down"}}</td>
|
||||
<td {{bind-attr class=":value report.sevenDayTrend"}} {{bind-attr title="report.sevenDayCountTitle"}}>{{report.lastSevenDaysCount}} {{fa-icon "caret-up" class="up"}} {{fa-icon "caret-down" class="down"}}</td>
|
||||
<td {{bind-attr class=":value report.thirtyDayTrend"}} {{bind-attr title="report.thirtyDayCountTitle"}}>{{report.lastThirtyDaysCount}} {{fa-icon "caret-up" class="up"}} {{fa-icon "caret-down" class="down"}}</td>
|
||||
<td class="value">{{report.total}}</td>
|
||||
</tr>
|
|
@ -52,13 +52,13 @@
|
|||
</thead>
|
||||
{{#unless loading}}
|
||||
{{ render 'admin/templates/reports/per_day_counts_report' visits tagName="tbody"}}
|
||||
{{ render 'admin_report_counts' signups }}
|
||||
{{ render 'admin_report_counts' topics }}
|
||||
{{ render 'admin_report_counts' posts }}
|
||||
{{ render 'admin_report_counts' likes }}
|
||||
{{ render 'admin_report_counts' flags }}
|
||||
{{ render 'admin_report_counts' bookmarks }}
|
||||
{{ render 'admin_report_counts' emails }}
|
||||
{{admin-report-counts report=signups}}
|
||||
{{admin-report-counts report=topics}}
|
||||
{{admin-report-counts report=posts}}
|
||||
{{admin-report-counts report=likes}}
|
||||
{{admin-report-counts report=flags}}
|
||||
{{admin-report-counts report=bookmarks}}
|
||||
{{admin-report-counts report=emails}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</div>
|
||||
|
@ -76,10 +76,10 @@
|
|||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
{{ render 'admin_report_counts' page_view_anon_reqs }}
|
||||
{{ render 'admin_report_counts' page_view_logged_in_reqs }}
|
||||
{{ render 'admin_report_counts' page_view_crawler_reqs }}
|
||||
{{ render 'admin_report_counts' page_view_total_reqs }}
|
||||
{{admin-report-counts report=page_view_anon_reqs}}
|
||||
{{admin-report-counts report=page_view_logged_in_reqs}}
|
||||
{{admin-report-counts report=page_view_crawler_reqs}}
|
||||
{{admin-report-counts report=page_view_total_reqs}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</div>
|
||||
|
@ -98,11 +98,11 @@
|
|||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
{{ render 'admin_report_counts' user_to_user_private_messages }}
|
||||
{{ render 'admin_report_counts' system_private_messages }}
|
||||
{{ render 'admin_report_counts' notify_moderators_private_messages }}
|
||||
{{ render 'admin_report_counts' notify_user_private_messages }}
|
||||
{{ render 'admin_report_counts' moderator_warning_private_messages }}
|
||||
{{admin-report-counts report=user_to_user_private_messages}}
|
||||
{{admin-report-counts report=system_private_messages}}
|
||||
{{admin-report-counts report=notify_moderators_private_messages}}
|
||||
{{admin-report-counts report=notify_user_private_messages}}
|
||||
{{admin-report-counts report=moderator_warning_private_messages}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</div>
|
||||
|
@ -145,12 +145,12 @@
|
|||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
{{ render 'admin_report_counts' http_2xx_reqs }}
|
||||
{{ render 'admin_report_counts' http_3xx_reqs}}
|
||||
{{ render 'admin_report_counts' http_4xx_reqs}}
|
||||
{{ render 'admin_report_counts' http_5xx_reqs}}
|
||||
{{ render 'admin_report_counts' http_background_reqs }}
|
||||
{{ render 'admin_report_counts' http_total_reqs }}
|
||||
{{admin-report-counts report=http_2xx_reqs}}
|
||||
{{admin-report-counts report=http_3xx_reqs}}
|
||||
{{admin-report-counts report=http_4xx_reqs}}
|
||||
{{admin-report-counts report=http_5xx_reqs}}
|
||||
{{admin-report-counts report=http_background_reqs}}
|
||||
{{admin-report-counts report=http_total_reqs}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<tr>
|
||||
<td class="title">
|
||||
{{#if icon}}
|
||||
<i {{bind-attr class=":fa icon"}}></i>
|
||||
{{/if}}
|
||||
<a {{bind-attr href="reportUrl"}}>{{title}}</a>
|
||||
</td>
|
||||
<td class="value">{{todayCount}}</td>
|
||||
<td {{bind-attr class=":value yesterdayTrend"}} {{bind-attr title="yesterdayCountTitle"}}>{{yesterdayCount}} <i class="fa up fa-caret-up"></i><i class="fa down fa-caret-down"></i></td>
|
||||
<td {{bind-attr class=":value sevenDayTrend"}} {{bind-attr title="sevenDayCountTitle"}}>{{lastSevenDaysCount}} <i class="fa up fa-caret-up"></i><i class="fa down fa-caret-down"></i></td>
|
||||
<td {{bind-attr class=":value thirtyDayTrend"}} {{bind-attr title="thirtyDayCountTitle"}}>{{lastThirtyDaysCount}} <i class="fa up fa-caret-up"></i><i class="fa down fa-caret-down"></i></td>
|
||||
<td class="value">{{total}}</td>
|
||||
</tr>
|
|
@ -1,4 +1,4 @@
|
|||
Discourse.AdminBackupsView = Discourse.View.extend({
|
||||
export default Discourse.View.extend({
|
||||
classNames: ["admin-backups"],
|
||||
|
||||
_hijackDownloads: function() {
|
|
@ -1,3 +0,0 @@
|
|||
Discourse.AdminApiView = Discourse.View.extend({
|
||||
templateName: 'admin/templates/api'
|
||||
});
|
|
@ -1,13 +0,0 @@
|
|||
/**
|
||||
The default view in the admin section
|
||||
|
||||
@class AdminDashboardView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminDashboardView = Discourse.View.extend({
|
||||
templateName: 'admin/templates/dashboard'
|
||||
});
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Discourse.AdminReportCountsView = Discourse.View.extend({
|
||||
templateName: 'admin/templates/reports/summed_counts_report',
|
||||
tagName: 'tbody'
|
||||
});
|
|
@ -1,12 +1,4 @@
|
|||
/**
|
||||
A view to display a site setting with edit controls
|
||||
|
||||
@class SiteSettingView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.SiteSettingView = Discourse.View.extend(Discourse.ScrollTop, {
|
||||
export default Discourse.View.extend(Discourse.ScrollTop, {
|
||||
classNameBindings: [':row', ':setting', 'content.overridden'],
|
||||
|
||||
preview: function() {
|
|
@ -1,24 +1,27 @@
|
|||
import registerUnbound from 'discourse/helpers/register-unbound';
|
||||
|
||||
function iconClasses(icon, modifier) {
|
||||
function iconClasses(icon, params) {
|
||||
var classes = "fa fa-" + icon;
|
||||
if (modifier) { classes += " fa-" + modifier; }
|
||||
if (params.modifier) { classes += " fa-" + params.modifier; }
|
||||
if (params['class']) { classes += ' ' + params['class']; }
|
||||
return classes;
|
||||
}
|
||||
|
||||
function iconHTML(icon, label, modifier) {
|
||||
var html = "<i class='" + iconClasses(icon, modifier) + "'";
|
||||
if (label) { html += " aria-hidden='true'"; }
|
||||
function iconHTML(icon, params) {
|
||||
params = params || {};
|
||||
|
||||
var html = "<i class='" + iconClasses(icon, params) + "'";
|
||||
if (params.label) { html += " aria-hidden='true'"; }
|
||||
html += "></i>";
|
||||
if (label) {
|
||||
html += "<span class='sr-only'>" + I18n.t(label) + "</span>";
|
||||
if (params.label) {
|
||||
html += "<span class='sr-only'>" + I18n.t(params.label) + "</span>";
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
registerUnbound('fa-icon', function(icon, params) {
|
||||
return new Handlebars.SafeString(iconHTML(icon, params.label, params.modifier));
|
||||
return new Handlebars.SafeString(iconHTML(icon, params));
|
||||
});
|
||||
|
||||
export { iconClasses, iconHTML };
|
||||
export { iconHTML };
|
||||
|
|
Loading…
Reference in New Issue