From ed00bab80b95581357666bd0d9fcf103f95b77f0 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 13 Mar 2017 19:44:10 -0600 Subject: [PATCH] Fixed layout of bruteforcesettings Signed-off-by: Morris Jobke --- apps/bruteforcesettings/css/settings.css | 17 +++++++++++++++++ apps/bruteforcesettings/js/IPWhitelistView.js | 2 +- .../templates/ipwhitelist.php | 7 ++++--- lib/private/Settings/Manager.php | 2 +- tests/lib/Settings/ManagerTest.php | 8 ++++---- 5 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 apps/bruteforcesettings/css/settings.css diff --git a/apps/bruteforcesettings/css/settings.css b/apps/bruteforcesettings/css/settings.css new file mode 100644 index 0000000000..1d2837b00e --- /dev/null +++ b/apps/bruteforcesettings/css/settings.css @@ -0,0 +1,17 @@ + +#whitelist-list { + min-width: 262px; +} + +#whitelist-list td span { + padding: 10px 15px; + display: inline-block; +} + +#whitelist-list .action-column { + width: 46px; +} + +#whitelist-list .action-column a { + display: inline-block; +} \ No newline at end of file diff --git a/apps/bruteforcesettings/js/IPWhitelistView.js b/apps/bruteforcesettings/js/IPWhitelistView.js index da711ae122..7341c7d079 100644 --- a/apps/bruteforcesettings/js/IPWhitelistView.js +++ b/apps/bruteforcesettings/js/IPWhitelistView.js @@ -27,7 +27,7 @@ var TEMPLATE_WHITELIST = '' + '{{ip}}/{{mask}}' - + 'BAD CSS' + + '' + ''; OCA.BruteForceSettings.WhitelistView = OC.Backbone.View.extend({ diff --git a/apps/bruteforcesettings/templates/ipwhitelist.php b/apps/bruteforcesettings/templates/ipwhitelist.php index 6935495616..a4b0292e94 100644 --- a/apps/bruteforcesettings/templates/ipwhitelist.php +++ b/apps/bruteforcesettings/templates/ipwhitelist.php @@ -30,16 +30,17 @@ script('bruteforcesettings', [ 'IPWhitelistCollection', 'IPWhitelistView', ]); +style('bruteforcesettings', [ + 'settings' +]) /** @var \OCP\IL10N $l */ ?>

t('Brute force ip whitelist')); ?>

- - +
-
/ diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 2ae1e0682b..080b697b23 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -273,7 +273,7 @@ class Manager implements IManager { $sections = [ 0 => [new Section('server', $this->l->t('Server settings'), 0, $this->url->imagePath('settings', 'admin.svg'))], 5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))], - 10 => [new Section('security', $this->l->t('Security'), 0)], + 10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))], 45 => [new Section('encryption', $this->l->t('Encryption'), 0, $this->url->imagePath('core', 'actions/password.svg'))], 98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], 99 => [new Section('tips-tricks', $this->l->t('Tips & tricks'), 0, $this->url->imagePath('settings', 'help.svg'))], diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php index e6acafe9b8..497a0df9f4 100644 --- a/tests/lib/Settings/ManagerTest.php +++ b/tests/lib/Settings/ManagerTest.php @@ -146,7 +146,7 @@ class ManagerTest extends TestCase { ['class' => \OCA\WorkflowEngine\Settings\Section::class, 'priority' => 90] ])); - $this->url->expects($this->exactly(5)) + $this->url->expects($this->exactly(6)) ->method('imagePath') ->willReturnMap([ ['settings', 'admin.svg', '1'], @@ -159,7 +159,7 @@ class ManagerTest extends TestCase { $this->assertEquals([ 0 => [new Section('server', 'Server settings', 0, '1')], 5 => [new Section('sharing', 'Sharing', 0, '2')], - 10 => [new Section('security', 'Security', 0)], + 10 => [new Section('security', 'Security', 0, '3')], 45 => [new Section('encryption', 'Encryption', 0, '3')], 90 => [\OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class)], 98 => [new Section('additional', 'Additional settings', 0, '4')], @@ -178,7 +178,7 @@ class ManagerTest extends TestCase { ->will($this->returnValue([ ])); - $this->url->expects($this->exactly(5)) + $this->url->expects($this->exactly(6)) ->method('imagePath') ->willReturnMap([ ['settings', 'admin.svg', '1'], @@ -191,7 +191,7 @@ class ManagerTest extends TestCase { $this->assertEquals([ 0 => [new Section('server', 'Server settings', 0, '1')], 5 => [new Section('sharing', 'Sharing', 0, '2')], - 10 => [new Section('security', 'Security', 0)], + 10 => [new Section('security', 'Security', 0, '3')], 45 => [new Section('encryption', 'Encryption', 0, '3')], 98 => [new Section('additional', 'Additional settings', 0, '4')], 99 => [new Section('tips-tricks', 'Tips & tricks', 0, '5')],