diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-06-13 17:41:45 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-06-17 14:33:14 +0200 |
commit | 9e74787c8a4109177010578612c0746ac69a7f90 (patch) | |
tree | eec72cced73f7e940579075962110b39ee838165 /settings | |
parent | ce179dcdcb171aef4f7e84025706237b54f0340f (diff) | |
download | nextcloud-server-9e74787c8a4109177010578612c0746ac69a7f90.tar.gz nextcloud-server-9e74787c8a4109177010578612c0746ac69a7f90.zip |
Migrate table layout to p layout for share settings
ref #8906
Diffstat (limited to 'settings')
-rw-r--r-- | settings/css/settings.css | 11 | ||||
-rw-r--r-- | settings/js/admin.js | 3 | ||||
-rw-r--r-- | settings/templates/admin.php | 91 |
3 files changed, 49 insertions, 56 deletions
diff --git a/settings/css/settings.css b/settings/css/settings.css index bec8534aa48..906712a56ba 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -166,9 +166,14 @@ span.securitywarning, span.connectionwarning { color:#C33; font-weight:bold; } -table.shareAPI td { padding-bottom: 0.8em; } -table.shareAPI input#shareapiExpireAfterNDays {width: 25px;} -table.shareAPI .indent { padding-left: 2em; } +#shareAPI p { padding-bottom: 0.8em; } +#shareAPI input#shareapiExpireAfterNDays {width: 25px;} +#shareAPI .indent { + padding-left: 28px; +} +#shareAPI .double-indent { + padding-left: 56px; +} #mail_settings p label:first-child { display: inline-block; diff --git a/settings/js/admin.js b/settings/js/admin.js index bc95c6a3dc5..7036f6dbf2a 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -60,7 +60,7 @@ $(document).ready(function(){ }); $('#shareAPIEnabled').change(function() { - $('.shareAPI td:not(#enable)').toggle(); + $('#shareAPI p:not(#enable)').toggleClass('hidden', !this.checked); }); $('#shareAPI input').change(function() { @@ -82,6 +82,7 @@ $(document).ready(function(){ $('#allowLinks').change(function() { $("#publicLinkSettings").toggleClass('hidden', !this.checked); + $('#setDefaultExpireDate').toggleClass('hidden', !(this.checked && $('#shareapiDefaultExpireDate')[0].checked)); }); $('#security').change(function(){ diff --git a/settings/templates/admin.php b/settings/templates/admin.php index e1348916b69..1d75624d8c0 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -232,20 +232,18 @@ if (!$_['internetconnectionworking']) { <div class="section" id="shareAPI"> <h2><?php p($l->t('Sharing'));?></h2> - <table class="shareAPI"> - <tr> - <td id="enable"> - <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" - value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> - <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> - </td> - </tr> - <tr> - <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>> - <input type="checkbox" name="shareapi_allow_links" id="allowLinks" - value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> - <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> - <div <?php ($_['allowLinks'] === 'yes') ? print_unescaped('class="indent"') : print_unescaped('class="hidden indent"');?> id="publicLinkSettings"> + <p id="enable"> + <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" + value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_allow_links" id="allowLinks" + value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> + </p> + + <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> /> <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/> @@ -256,46 +254,38 @@ if (!$_['internetconnectionworking']) { <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/> - <div id="setDefaultExpireDate" <?php ($_['shareDefaultExpireDateSet'] === 'no') ? print_unescaped('class="hidden indent"') : print_unescaped('class="indent"');?>> + + </p> + <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> <?php p($l->t( 'Expire after ' )); ?> <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>" value='<?php p($_['shareExpireAfterNDays']) ?>' /> <?php p($l->t( 'days' )); ?> <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" - value="1" <?php if ($_['shareEnforceExpireDate'] == 'yes') print_unescaped('checked="checked"'); ?> /> + value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> - </div> - - </div> - </td> - </tr> - <tr> - <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>> - <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" - value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> - <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> - </td> - </tr> - <tr> - <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>> - <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" - value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> - <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> - </td> - </tr> - <tr> - <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>> - <input type="checkbox" name="shareapi_allow_mail_notification" id="allowMailNotification" - value="1" <?php if ($_['allowMailNotification'] === 'yes') print_unescaped('checked="checked"'); ?> /> - <label for="allowMailNotification"><?php p($l->t('Allow users to send mail notification for shared files'));?></label><br/> - </td> - </tr> - <tr> - <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>> - <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" - value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> - <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> - <div id="selectExcludedGroups" class="<?php ($_['shareExcludeGroups']) ? p('indent') : p('hidden indent'); ?>"> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" + value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" + value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> + <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_allow_mail_notification" id="allowMailNotification" + value="1" <?php if ($_['allowMailNotification'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowMailNotification"><?php p($l->t('Allow users to send mail notification for shared files'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" + value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> + <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> + </p> + <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> <select class="groupsselect" id="excludedGroups" data-placeholder="groups" @@ -306,10 +296,7 @@ if (!$_['internetconnectionworking']) { </select> <br /> <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em> - </div> - </td> - </tr> - </table> + </p> </div> <div class="section" id="security"> |