From 7611eb4e78fe25f0ee1911608f015a15ddc34b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 24 Nov 2014 11:26:29 +0100 Subject: [PATCH] UX: bold all the entries in the screened IP list that are more than a single IP --- .../controllers/admin-log-screened-ip-address.js.es6 | 4 ++++ .../templates/logs/screened_ip_addresses_list_item.hbs | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/controllers/admin-log-screened-ip-address.js.es6 b/app/assets/javascripts/admin/controllers/admin-log-screened-ip-address.js.es6 index edd2e09148a..786797f6651 100644 --- a/app/assets/javascripts/admin/controllers/admin-log-screened-ip-address.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-log-screened-ip-address.js.es6 @@ -2,6 +2,10 @@ export default Ember.ObjectController.extend({ editing: false, savedIpAddress: null, + isRange: function() { + return this.get("ip_address").indexOf("/") > 0; + }.property("ip_address"), + actions: { allow: function(record) { record.set('action_name', 'do_nothing'); diff --git a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs index 23a21becc64..ed9e7fe8b2d 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs +++ b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs @@ -2,7 +2,13 @@ {{#if editing}} {{text-field value=ip_address autofocus="autofocus"}} {{else}} - {{ip_address}} + + {{#if isRange}} + {{ip_address}} + {{else}} + {{ip_address}} + {{/if}} + {{/if}}