mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-04 21:01:27 -05:00
FEATURE: admins can clear screend emails if needed
This commit is contained in:
parent
3f9a86a23a
commit
9e9c41ac52
8 changed files with 25 additions and 3 deletions
|
@ -10,6 +10,13 @@ Discourse.AdminLogsScreenedEmailsController = Ember.ArrayController.extend(Disco
|
||||||
loading: false,
|
loading: false,
|
||||||
content: [],
|
content: [],
|
||||||
|
|
||||||
|
clearBlock: function(row){
|
||||||
|
row.clearBlock().then(function(){
|
||||||
|
// feeling lazy
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.set('loading', true);
|
this.set('loading', true);
|
||||||
|
|
|
@ -10,7 +10,11 @@
|
||||||
Discourse.ScreenedEmail = Discourse.Model.extend({
|
Discourse.ScreenedEmail = Discourse.Model.extend({
|
||||||
actionName: function() {
|
actionName: function() {
|
||||||
return I18n.t("admin.logs.screened_actions." + this.get('action'));
|
return I18n.t("admin.logs.screened_actions." + this.get('action'));
|
||||||
}.property('action')
|
}.property('action'),
|
||||||
|
|
||||||
|
clearBlock: function() {
|
||||||
|
return Discourse.ajax('/admin/logs/screened_emails/' + this.get('id'), {method: 'DELETE'});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Discourse.ScreenedEmail.reopenClass({
|
Discourse.ScreenedEmail.reopenClass({
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<div class="col heading last_match_at">{{i18n admin.logs.last_match_at}}</div>
|
<div class="col heading last_match_at">{{i18n admin.logs.last_match_at}}</div>
|
||||||
<div class="col heading created_at">{{i18n admin.logs.created_at}}</div>
|
<div class="col heading created_at">{{i18n admin.logs.created_at}}</div>
|
||||||
<div class="col heading ip_address">{{i18n admin.logs.ip_address}}</div>
|
<div class="col heading ip_address">{{i18n admin.logs.ip_address}}</div>
|
||||||
|
<div class="col heading action"></div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,5 @@
|
||||||
<div class="col last_match_at">{{unboundAgeWithTooltip last_match_at}}</div>
|
<div class="col last_match_at">{{unboundAgeWithTooltip last_match_at}}</div>
|
||||||
<div class="col created_at">{{unboundAgeWithTooltip created_at}}</div>
|
<div class="col created_at">{{unboundAgeWithTooltip created_at}}</div>
|
||||||
<div class="col ip_address">{{ip_address}}</div>
|
<div class="col ip_address">{{ip_address}}</div>
|
||||||
|
<div class="col action"><button class="btn" {{action clearBlock this}}><i class='fa fa-check'></i> {{i18n admin.logs.screened_emails.actions.allow}}</button></div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
|
@ -5,4 +5,10 @@ class Admin::ScreenedEmailsController < Admin::AdminController
|
||||||
render_serialized(screened_emails, ScreenedEmailSerializer)
|
render_serialized(screened_emails, ScreenedEmailSerializer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
screen = ScreenedEmail.find(params[:id].to_i)
|
||||||
|
screen.destroy!
|
||||||
|
render json: success_json
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,8 @@ class ScreenedEmailSerializer < ApplicationSerializer
|
||||||
:match_count,
|
:match_count,
|
||||||
:last_match_at,
|
:last_match_at,
|
||||||
:created_at,
|
:created_at,
|
||||||
:ip_address
|
:ip_address,
|
||||||
|
:id
|
||||||
|
|
||||||
def action
|
def action
|
||||||
ScreenedEmail.actions.key(object.action_type).to_s
|
ScreenedEmail.actions.key(object.action_type).to_s
|
||||||
|
|
|
@ -1613,6 +1613,8 @@ en:
|
||||||
title: "Screened Emails"
|
title: "Screened Emails"
|
||||||
description: "When someone tries to create a new account, the following email addresses will be checked and the registration will be blocked, or some other action performed."
|
description: "When someone tries to create a new account, the following email addresses will be checked and the registration will be blocked, or some other action performed."
|
||||||
email: "Email Address"
|
email: "Email Address"
|
||||||
|
actions:
|
||||||
|
allow: "Allow"
|
||||||
screened_urls:
|
screened_urls:
|
||||||
title: "Screened URLs"
|
title: "Screened URLs"
|
||||||
description: "The URLs listed here were used in posts by users who have been identified as spammers."
|
description: "The URLs listed here were used in posts by users who have been identified as spammers."
|
||||||
|
|
|
@ -86,7 +86,7 @@ Discourse::Application.routes.draw do
|
||||||
|
|
||||||
scope "/logs" do
|
scope "/logs" do
|
||||||
resources :staff_action_logs, only: [:index]
|
resources :staff_action_logs, only: [:index]
|
||||||
resources :screened_emails, only: [:index]
|
resources :screened_emails, only: [:index, :destroy]
|
||||||
resources :screened_ip_addresses, only: [:index, :create, :update, :destroy]
|
resources :screened_ip_addresses, only: [:index, :create, :update, :destroy]
|
||||||
resources :screened_urls, only: [:index]
|
resources :screened_urls, only: [:index]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue