From 9170166e93ef3fbe373ab40a5ef93578d9024beb Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 14 Aug 2013 16:40:12 -0400 Subject: [PATCH] Finish renaming blocked emails to screen emails --- .../admin_logs_blocked_emails_controller.js | 21 ---------------- .../admin_logs_screened_emails_controller.js | 21 ++++++++++++++++ .../javascripts/admin/models/blocked_email.js | 24 ------------------- .../admin/models/screened_email.js | 24 +++++++++++++++++++ .../admin/routes/admin_logs_routes.js | 8 +++---- .../javascripts/admin/routes/admin_routes.js | 2 +- .../admin/templates/logs.js.handlebars | 2 +- ...ndlebars => screened_emails.js.handlebars} | 10 ++++---- ...> screened_emails_list_item.js.handlebars} | 0 .../views/logs/blocked_emails_list_view.js | 5 ---- .../views/logs/screened_emails_list_view.js | 5 ++++ config/locales/client.en.yml | 4 ++-- 12 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 app/assets/javascripts/admin/controllers/admin_logs_blocked_emails_controller.js create mode 100644 app/assets/javascripts/admin/controllers/admin_logs_screened_emails_controller.js delete mode 100644 app/assets/javascripts/admin/models/blocked_email.js create mode 100644 app/assets/javascripts/admin/models/screened_email.js rename app/assets/javascripts/admin/templates/logs/{blocked_emails.js.handlebars => screened_emails.js.handlebars} (58%) rename app/assets/javascripts/admin/templates/logs/{blocked_emails_list_item.js.handlebars => screened_emails_list_item.js.handlebars} (100%) delete mode 100644 app/assets/javascripts/admin/views/logs/blocked_emails_list_view.js create mode 100644 app/assets/javascripts/admin/views/logs/screened_emails_list_view.js diff --git a/app/assets/javascripts/admin/controllers/admin_logs_blocked_emails_controller.js b/app/assets/javascripts/admin/controllers/admin_logs_blocked_emails_controller.js deleted file mode 100644 index 2ff1b165d..000000000 --- a/app/assets/javascripts/admin/controllers/admin_logs_blocked_emails_controller.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - This controller supports the interface for listing blocked email addresses in the admin section. - - @class AdminLogsBlockedEmailsController - @extends Ember.ArrayController - @namespace Discourse - @module Discourse -**/ -Discourse.AdminLogsBlockedEmailsController = Ember.ArrayController.extend(Discourse.Presence, { - loading: false, - content: [], - - show: function() { - var self = this; - this.set('loading', true); - Discourse.BlockedEmail.findAll().then(function(result) { - self.set('content', result); - self.set('loading', false); - }); - } -}); 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 new file mode 100644 index 000000000..2a38efc0a --- /dev/null +++ b/app/assets/javascripts/admin/controllers/admin_logs_screened_emails_controller.js @@ -0,0 +1,21 @@ +/** + This controller supports the interface for listing screened email addresses in the admin section. + + @class AdminLogsScreenedEmailsController + @extends Ember.ArrayController + @namespace Discourse + @module Discourse +**/ +Discourse.AdminLogsScreenedEmailsController = Ember.ArrayController.extend(Discourse.Presence, { + loading: false, + content: [], + + show: function() { + var self = this; + this.set('loading', true); + Discourse.ScreenedEmail.findAll().then(function(result) { + self.set('content', result); + self.set('loading', false); + }); + } +}); diff --git a/app/assets/javascripts/admin/models/blocked_email.js b/app/assets/javascripts/admin/models/blocked_email.js deleted file mode 100644 index 9d0bc2cc5..000000000 --- a/app/assets/javascripts/admin/models/blocked_email.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - Represents an email address that is watched for during account registration, - and an action is taken. - - @class BlockedEmail - @extends Discourse.Model - @namespace Discourse - @module Discourse -**/ -Discourse.BlockedEmail = Discourse.Model.extend({ - actionName: function() { - return I18n.t("admin.logs.blocked_emails.actions." + this.get('action')); - }.property('action') -}); - -Discourse.BlockedEmail.reopenClass({ - findAll: function(filter) { - return Discourse.ajax("/admin/logs/blocked_emails.json").then(function(blocked_emails) { - return blocked_emails.map(function(b) { - return Discourse.BlockedEmail.create(b); - }); - }); - } -}); diff --git a/app/assets/javascripts/admin/models/screened_email.js b/app/assets/javascripts/admin/models/screened_email.js new file mode 100644 index 000000000..21209ad43 --- /dev/null +++ b/app/assets/javascripts/admin/models/screened_email.js @@ -0,0 +1,24 @@ +/** + Represents an email address that is watched for during account registration, + and an action is taken. + + @class ScreenedEmail + @extends Discourse.Model + @namespace Discourse + @module Discourse +**/ +Discourse.ScreenedEmail = Discourse.Model.extend({ + actionName: function() { + return I18n.t("admin.logs.screened_emails.actions." + this.get('action')); + }.property('action') +}); + +Discourse.ScreenedEmail.reopenClass({ + findAll: function(filter) { + return Discourse.ajax("/admin/logs/screened_emails.json").then(function(screened_emails) { + return screened_emails.map(function(b) { + return Discourse.ScreenedEmail.create(b); + }); + }); + } +}); diff --git a/app/assets/javascripts/admin/routes/admin_logs_routes.js b/app/assets/javascripts/admin/routes/admin_logs_routes.js index b0a5b716b..da006a986 100644 --- a/app/assets/javascripts/admin/routes/admin_logs_routes.js +++ b/app/assets/javascripts/admin/routes/admin_logs_routes.js @@ -15,18 +15,18 @@ Discourse.AdminLogsIndexRoute = Discourse.Route.extend({ /** The route that lists blocked email addresses. - @class AdminLogsBlockedEmailsRoute + @class AdminLogsScreenedEmailsRoute @extends Discourse.Route @namespace Discourse @module Discourse **/ -Discourse.AdminLogsBlockedEmailsRoute = Discourse.Route.extend({ +Discourse.AdminLogsScreenedEmailsRoute = Discourse.Route.extend({ renderTemplate: function() { - this.render('admin/templates/logs/blocked_emails', {into: 'adminLogs'}); + this.render('admin/templates/logs/screened_emails', {into: 'adminLogs'}); }, setupController: function() { - return this.controllerFor('adminLogsBlockedEmails').show(); + return this.controllerFor('adminLogsScreenedEmails').show(); } }); diff --git a/app/assets/javascripts/admin/routes/admin_routes.js b/app/assets/javascripts/admin/routes/admin_routes.js index 517cca1a8..4622f6095 100644 --- a/app/assets/javascripts/admin/routes/admin_routes.js +++ b/app/assets/javascripts/admin/routes/admin_routes.js @@ -30,7 +30,7 @@ Discourse.Route.buildRoutes(function() { }); this.resource('adminLogs', { path: '/logs' }, function() { - this.route('blockedEmails', { path: '/blocked_emails' }); + this.route('screenedEmails', { path: '/screened_emails' }); this.route('staffActionLogs', { path: '/staff_action_logs' }); }); diff --git a/app/assets/javascripts/admin/templates/logs.js.handlebars b/app/assets/javascripts/admin/templates/logs.js.handlebars index f3f6f476c..f18bf8cc5 100644 --- a/app/assets/javascripts/admin/templates/logs.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs.js.handlebars @@ -2,7 +2,7 @@
diff --git a/app/assets/javascripts/admin/templates/logs/blocked_emails.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars similarity index 58% rename from app/assets/javascripts/admin/templates/logs/blocked_emails.js.handlebars rename to app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars index 80881573a..915eaf92f 100644 --- a/app/assets/javascripts/admin/templates/logs/blocked_emails.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars @@ -1,4 +1,4 @@ -

{{i18n admin.logs.blocked_emails.description}}

+

{{i18n admin.logs.screened_emails.description}}

{{#if loading}}
{{i18n loading}}
@@ -7,15 +7,15 @@
- +
{{i18n admin.logs.action}}
-
{{i18n admin.logs.blocked_emails.match_count}}
-
{{i18n admin.logs.blocked_emails.last_match_at}}
+
{{i18n admin.logs.screened_emails.match_count}}
+
{{i18n admin.logs.screened_emails.last_match_at}}
{{i18n admin.logs.created_at}}
- {{view Discourse.BlockedEmailsListView contentBinding="controller"}} + {{view Discourse.ScreenedEmailsListView contentBinding="controller"}}
{{else}} diff --git a/app/assets/javascripts/admin/templates/logs/blocked_emails_list_item.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars similarity index 100% rename from app/assets/javascripts/admin/templates/logs/blocked_emails_list_item.js.handlebars rename to app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars diff --git a/app/assets/javascripts/admin/views/logs/blocked_emails_list_view.js b/app/assets/javascripts/admin/views/logs/blocked_emails_list_view.js deleted file mode 100644 index 3779b9790..000000000 --- a/app/assets/javascripts/admin/views/logs/blocked_emails_list_view.js +++ /dev/null @@ -1,5 +0,0 @@ -Discourse.BlockedEmailsListView = Ember.ListView.extend({ - height: 700, - rowHeight: 32, - itemViewClass: Ember.ListItemView.extend({templateName: "admin/templates/logs/blocked_emails_list_item"}) -}); diff --git a/app/assets/javascripts/admin/views/logs/screened_emails_list_view.js b/app/assets/javascripts/admin/views/logs/screened_emails_list_view.js new file mode 100644 index 000000000..ea0f05050 --- /dev/null +++ b/app/assets/javascripts/admin/views/logs/screened_emails_list_view.js @@ -0,0 +1,5 @@ +Discourse.ScreenedEmailsListView = Ember.ListView.extend({ + height: 700, + rowHeight: 32, + itemViewClass: Ember.ListItemView.extend({templateName: "admin/templates/logs/screened_emails_list_item"}) +}); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index f32c27ac3..0110b69e7 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1181,8 +1181,8 @@ en: title: "Logs" action: "Action" created_at: "Created" - blocked_emails: - title: "Blocked Emails" + 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." email: "Email Address" last_match_at: "Last Matched"