[Pkg-owncloud-commits] [owncloud] 83/172: hide input field if default expire date isn't activated

David Prévot taffit at moszumanska.debian.org
Sun May 18 20:09:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit ec045b251c5e42ce3762f3aefc0936581fd21030
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Fri May 9 14:58:33 2014 +0200

    hide input field if default expire date isn't activated
---
 settings/css/settings.css    |  3 ++-
 settings/js/admin.js         |  8 ++++++++
 settings/templates/admin.php | 44 ++++++++++++++++++++++----------------------
 3 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/settings/css/settings.css b/settings/css/settings.css
index 5d8f9a7..2056e56 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -132,7 +132,8 @@ table.grid td.date{
 span.securitywarning {color:#C33; font-weight:bold; }
 span.connectionwarning {color:#933; font-weight:bold; }
 table.shareAPI td { padding-bottom: 0.8em; }
-table.shareAPI input#shareapi_expire_after_n_days {width: 25px;}
+table.shareAPI input#shareapiExpireAfterNDays {width: 25px;}
+table.shareAPI .indent { padding-left: 2em; }
 
 #mail_settings p label:first-child {
 	display: inline-block;
diff --git a/settings/js/admin.js b/settings/js/admin.js
index c04c050..cd11e68 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -31,6 +31,14 @@ $(document).ready(function(){
 		OC.AppConfig.setValue('core', $(this).attr('name'), value);
 	});
 
+	$('#shareapiDefaultExpireDate').change(function() {
+		$("#setDefaultExpireDate").toggleClass('hidden', !this.checked);
+	});
+
+	$('#allowLinks').change(function() {
+		$("#publicLinkSettings").toggleClass('hidden', !this.checked);
+	});
+
 	$('#security').change(function(){
 		$.post(OC.filePath('settings','ajax','setsecurity.php'), { enforceHTTPS: $('#forcessl').val() },function(){} );
 	});
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index d8a800c..4d453b0 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -217,15 +217,31 @@ if (!$_['internetconnectionworking']) {
 				<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 links'));?></label><br/>
-				<em><?php p($l->t('Allow users to share items to the public with links')); ?></em>
-			</td>
-		</tr>
-		<tr>
-			<td <?php if ($_['shareAPIEnabled'] == 'no') print_unescaped('class="hidden"');?>>
+
+				<div <?php ($_['allowLinks'] === 'yes') ? print_unescaped('class="indent"') : print_unescaped('class="hidden indent"');?> id="publicLinkSettings">
+
 				<input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload"
 				       value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
 				<label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
-				<em><?php p($l->t('Allow users to enable others to upload into their publicly shared folders')); ?></em>
+
+				<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"');?>>
+					<?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"'); ?> />
+					<label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/>
+				</div>
+
+				</div>
+				<em><?php p($l->t('Allow users to share items to the public with links')); ?></em>
+
+
+
 			</td>
 		</tr>
 		<tr>
@@ -255,22 +271,6 @@ if (!$_['internetconnectionworking']) {
 			</td>
 		</tr>
 
-		<tr>
-			<td <?php if ($_['shareAPIEnabled'] == 'no') print_unescaped('class="hidden"');?>>
-				<input type="checkbox" name="shareapi_default_expire_date" id="shareapi_default_expire_date"
-				       value="1" <?php if ($_['shareDefaultExpireDateSet'] == 'yes') print_unescaped('checked="checked"'); ?> />
-				<label for="shareapi_default_expire_date"><?php p($l->t('Set default expiration date'));?></label><br/>
-				<?php p($l->t( 'Expire after ' )); ?>
-				<input type="text" name='shareapi_expire_after_n_days' id="shareapi_expire_after_n_days" placeholder="<?php p('7')?>"
-					   value='<?php p($_['shareExpireAfterNDays']) ?>' />
-				<?php p($l->t( 'days' )); ?>
-				<input type="checkbox" name="shareapi_enforce_expire_date" id="shareapi_enforce_expire_date"
-				       value="1" <?php if ($_['shareEnforceExpireDate'] == 'yes') print_unescaped('checked="checked"'); ?> />
-				<label for="shareapi_enforce_expire_date"><?php p($l->t('Enforce expiration date'));?></label><br/>
-				<em><?php p($l->t('Expire shares by default after N days')); ?></em>
-			</td>
-		</tr>
-
 	</table>
 </div>
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list