mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
Use Ember.ListView for blocked emails list
This commit is contained in:
parent
7fdaefcd86
commit
0d44313a4b
8 changed files with 1252 additions and 23 deletions
|
@ -1 +1,2 @@
|
||||||
|
//= require list_view.js
|
||||||
//= require_tree ./admin
|
//= require_tree ./admin
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
**/
|
**/
|
||||||
Discourse.AdminLogsBlockedEmailsController = Ember.ArrayController.extend(Discourse.Presence, {
|
Discourse.AdminLogsBlockedEmailsController = Ember.ArrayController.extend(Discourse.Presence, {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
content: [],
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
|
@ -2,27 +2,20 @@
|
||||||
<div class='admin-loading'>{{i18n loading}}</div>
|
<div class='admin-loading'>{{i18n loading}}</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if model.length}}
|
{{#if model.length}}
|
||||||
<table class='table blocked-emails'>
|
|
||||||
<thead>
|
|
||||||
<th class="email">{{i18n admin.logs.blocked_emails.email}}</th>
|
|
||||||
<th class="action">{{i18n admin.logs.action}}</th>
|
|
||||||
<th class="match_count">{{i18n admin.logs.blocked_emails.match_count}}</th>
|
|
||||||
<th class="last_match_at">{{i18n admin.logs.blocked_emails.last_match_at}}</th>
|
|
||||||
<th class="created_at">{{i18n admin.logs.created_at}}</th>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<div class='table blocked-emails'>
|
||||||
{{#each model}}
|
<div class="heading-container">
|
||||||
<tr>
|
<div class="col heading email">{{i18n admin.logs.blocked_emails.email}}</div>
|
||||||
<td class="email">{{email}}</td>
|
<div class="col heading action">{{i18n admin.logs.action}}</div>
|
||||||
<td class="action">{{actionName}}</td>
|
<div class="col heading match_count">{{i18n admin.logs.blocked_emails.match_count}}</div>
|
||||||
<td class="match_count">{{match_count}}</td>
|
<div class="col heading last_match_at">{{i18n admin.logs.blocked_emails.last_match_at}}</div>
|
||||||
<td class="last_match_at">{{unboundAgeWithTooltip last_match_at}}</td>
|
<div class="col heading created_at">{{i18n admin.logs.created_at}}</div>
|
||||||
<td class="created_at">{{unboundAgeWithTooltip created_at}}</td>
|
<div class="clearfix"></div>
|
||||||
</tr>
|
</div>
|
||||||
{{/each}}
|
|
||||||
</tbody>
|
{{view Discourse.BlockedEmailsListView contentBinding="controller"}}
|
||||||
</table>
|
</div>
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{i18n search.no_results}}
|
{{i18n search.no_results}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<div class="col email">{{email}}</div>
|
||||||
|
<div class="col action">{{actionName}}</div>
|
||||||
|
<div class="col match_count">{{match_count}}</div>
|
||||||
|
<div class="col last_match_at">{{unboundAgeWithTooltip last_match_at}}</div>
|
||||||
|
<div class="col created_at">{{unboundAgeWithTooltip created_at}}</div>
|
||||||
|
<div class="clearfix"></div>
|
|
@ -0,0 +1,5 @@
|
||||||
|
Discourse.BlockedEmailsListView = Ember.ListView.extend({
|
||||||
|
height: 500,
|
||||||
|
rowHeight: 32,
|
||||||
|
itemViewClass: Ember.ListItemView.extend({templateName: "admin/templates/logs/blocked_emails_list_item"})
|
||||||
|
});
|
|
@ -694,12 +694,35 @@ table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Logs */
|
// Logs
|
||||||
|
|
||||||
.blocked-emails {
|
.blocked-emails {
|
||||||
.match_count, .last_match_at, .created_at {
|
width: 900px;
|
||||||
|
margin-left: 5px;
|
||||||
|
border-bottom: dotted 1px #ddd;
|
||||||
|
.heading-container {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #e4e4e4;
|
||||||
|
}
|
||||||
|
.heading {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.col {
|
||||||
|
display: inline-block;
|
||||||
|
padding-top: 6px;
|
||||||
|
}
|
||||||
|
.email {
|
||||||
|
width: 400px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
.action, .match_count, .last_match_at, .created_at {
|
||||||
|
width: 110px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.ember-list-item-view {
|
||||||
|
width: 100%;
|
||||||
|
border-top: solid 1px #ddd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.staff-actions {
|
.staff-actions {
|
||||||
|
@ -719,3 +742,14 @@ table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ember.ListView
|
||||||
|
|
||||||
|
.ember-list-view {
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.ember-list-item-view {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Admin::BlockedEmailsController < Admin::AdminController
|
class Admin::BlockedEmailsController < Admin::AdminController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
blocked_emails = BlockedEmail.limit(50).order('last_match_at desc').to_a
|
blocked_emails = BlockedEmail.limit(200).order('last_match_at desc').to_a
|
||||||
render_serialized(blocked_emails, BlockedEmailSerializer)
|
render_serialized(blocked_emails, BlockedEmailSerializer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
1189
vendor/assets/javascripts/list_view.js
vendored
Executable file
1189
vendor/assets/javascripts/list_view.js
vendored
Executable file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue