diff --git a/app/assets/javascripts/admin/controllers/admin_logs_screened_emails_controller.js b/app/assets/javascripts/admin/controllers/admin_logs_screened_emails_controller.js
index 2a38efc0a8b..f81f632f0cc 100644
--- a/app/assets/javascripts/admin/controllers/admin_logs_screened_emails_controller.js
+++ b/app/assets/javascripts/admin/controllers/admin_logs_screened_emails_controller.js
@@ -10,6 +10,13 @@ Discourse.AdminLogsScreenedEmailsController = Ember.ArrayController.extend(Disco
loading: false,
content: [],
+ clearBlock: function(row){
+ row.clearBlock().then(function(){
+ // feeling lazy
+ window.location.reload();
+ });
+ },
+
show: function() {
var self = this;
this.set('loading', true);
diff --git a/app/assets/javascripts/admin/models/screened_email.js b/app/assets/javascripts/admin/models/screened_email.js
index c2a3065b24a..5e6a8ddf832 100644
--- a/app/assets/javascripts/admin/models/screened_email.js
+++ b/app/assets/javascripts/admin/models/screened_email.js
@@ -10,7 +10,11 @@
Discourse.ScreenedEmail = Discourse.Model.extend({
actionName: function() {
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({
diff --git a/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars
index 8ebe3cc0239..94e2e42677d 100644
--- a/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars
+++ b/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars
@@ -13,6 +13,7 @@
{{i18n admin.logs.last_match_at}}
{{i18n admin.logs.created_at}}
{{i18n admin.logs.ip_address}}
+
diff --git a/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars
index 367a2090fa1..cfffc7fd545 100644
--- a/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars
+++ b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars
@@ -6,4 +6,5 @@
{{unboundAgeWithTooltip last_match_at}}
{{unboundAgeWithTooltip created_at}}
{{ip_address}}
+
diff --git a/app/controllers/admin/screened_emails_controller.rb b/app/controllers/admin/screened_emails_controller.rb
index 92847e39e7e..014a3844aae 100644
--- a/app/controllers/admin/screened_emails_controller.rb
+++ b/app/controllers/admin/screened_emails_controller.rb
@@ -5,4 +5,10 @@ class Admin::ScreenedEmailsController < Admin::AdminController
render_serialized(screened_emails, ScreenedEmailSerializer)
end
+ def destroy
+ screen = ScreenedEmail.find(params[:id].to_i)
+ screen.destroy!
+ render json: success_json
+ end
+
end
diff --git a/app/serializers/screened_email_serializer.rb b/app/serializers/screened_email_serializer.rb
index 79c03345b2b..44d28af23d5 100644
--- a/app/serializers/screened_email_serializer.rb
+++ b/app/serializers/screened_email_serializer.rb
@@ -4,7 +4,8 @@ class ScreenedEmailSerializer < ApplicationSerializer
:match_count,
:last_match_at,
:created_at,
- :ip_address
+ :ip_address,
+ :id
def action
ScreenedEmail.actions.key(object.action_type).to_s
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index d0f6e84b91a..7d6de959270 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1613,6 +1613,8 @@ en:
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."
email: "Email Address"
+ actions:
+ allow: "Allow"
screened_urls:
title: "Screened URLs"
description: "The URLs listed here were used in posts by users who have been identified as spammers."
diff --git a/config/routes.rb b/config/routes.rb
index 8b347cf5083..5972ff254e3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -86,7 +86,7 @@ Discourse::Application.routes.draw do
scope "/logs" do
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_urls, only: [:index]
end