From 96708c65628851c784ad5829e1a673a32cfab1e6 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 30 Jun 2016 16:41:12 +0200 Subject: [PATCH] Replace tab based design with a scrollable design --- css/admin.css | 27 +++++++++++-- js/admin.js | 33 +++++++++++++++- templates/admin.php | 96 ++++++++++++++++++++++++++++----------------- 3 files changed, 115 insertions(+), 41 deletions(-) diff --git a/css/admin.css b/css/admin.css index fe38d77..5c53798 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1,11 +1,30 @@ #user-saml input[type="text"],textarea { + max-width: 600px; width: 100%; } -#user-saml input.required { - background-color: lightgoldenrodyellow; -} - #user-saml input[type="checkbox"] { vertical-align:middle; +} + +#user-saml h4 { + font-size: 14px; + font-weight: 300; + margin: 12px 0; +} + +#user-saml-settings > div { + margin-bottom: 10px; +} + +.indent { + padding-left: 14px; +} + +#user-saml-settings .toggle { + clear: both; + padding: 7px 0; + cursor: pointer; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + opacity: .5; } \ No newline at end of file diff --git a/js/admin.js b/js/admin.js index d10d5bc..0e561fa 100644 --- a/js/admin.js +++ b/js/admin.js @@ -6,7 +6,6 @@ function setSAMLConfigValue(category, setting, value) { $(function() { // Enable tabs - $('#user-saml-settings').tabs(); $('input:checkbox[value="1"]').attr('checked', true); $('#user-saml-sp input[type="text"], #user-saml-sp textarea').change(function(e) { @@ -70,4 +69,36 @@ $(function() { setSAMLConfigValue('security', key, $(this).val()); }); }); + + $('#user-saml-settings .toggle').on('click', function() { + var el = $(this), + nextSibling = el.parent().next(), + parentSettingId = el.closest('div').attr('id'), + text = ''; + switch(parentSettingId) { + case 'user-saml-security': + if (nextSibling.hasClass('hidden')) { + text = 'Hide security settings ...'; + } else { + text = 'Show security settings ...'; + } + break; + case 'user-saml-idp': + if (nextSibling.hasClass('hidden')) { + text = 'Hide optional Identity Provider settings ...'; + } else { + text = 'Show optional Identity Provider settings ...'; + } + break; + case 'user-saml-sp': + if (nextSibling.hasClass('hidden')) { + text = 'Hide Service Provider settings ...'; + } else { + text = 'Show Service Provider settings ...'; + } + break; + } + el.html(t('user_saml', text)); + nextSibling.toggleClass('hidden'); + }); }); diff --git a/templates/admin.php b/templates/admin.php index 2f751ae..d5282ba 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -9,51 +9,75 @@ style('user_saml', 'admin');
- -
-

t('If your Service Provider should use certificates you can optionally specify them here.')) ?>

- $text): ?> - - -
-
-

t('Configure your IdP settings here, all yellow input fields are required, others optional.')) ?>

- - - - -
-
-

t('For increased security we recommend enabling the following settings if supported by your environment.')) ?>

- -

t('Signatures and encryption offered')) ?>

- $text): ?> - -
- -

t('Signatures and encryption required')) ?>

- $text): ?> - -
- -
+

t('General')) ?>

$attribute): ?> - -
+

+ +
+

- class="required" placeholder=""/> +

+ class="required" placeholder=""/> +

+
+

t('Service Provider Data')) ?>

+

+ t('If your Service Provider should use certificates you can optionally specify them here.')) ?> + t('Show Service Provider settings ...')) ?> +

+ + +
+
+

t('Identity Provider Data')) ?>

+

+ t('Configure your IdP settings here.')) ?> +

+ +

+

+

t('Show optional Identity Provider settings ...')) ?>

+ +
+
+

t('Security settings')) ?>

+

+ t('For increased security we recommend enabling the following settings if supported by your environment.')) ?> + t('Show security settings ...')) ?> +

+ +
t('Download metadata XML')) ?>