aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-10-31 04:25:42 -0700
committerMorris Jobke <morris.jobke@gmail.com>2013-10-31 04:25:42 -0700
commitea4dfa7e389c93c052ca2e496f58904da8967de6 (patch)
tree6295516a1f666aeb65fbaea833c10454feb0fe7f /settings
parentcb0ce90d01575af2e22cb203a56cafe32aea010b (diff)
parent680f4963dc13505e53a785bb7ee689fa4ffebe7d (diff)
downloadnextcloud-server-ea4dfa7e389c93c052ca2e496f58904da8967de6.tar.gz
nextcloud-server-ea4dfa7e389c93c052ca2e496f58904da8967de6.zip
Merge pull request #5638 from owncloud/admin-quotafield
Improve quota input field
Diffstat (limited to 'settings')
-rw-r--r--settings/js/users.js13
-rw-r--r--settings/templates/users.php4
2 files changed, 13 insertions, 4 deletions
diff --git a/settings/js/users.js b/settings/js/users.js
index 4c2ad5417ca..6222c0e70cd 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -147,7 +147,11 @@ var UserList = {
quotaSelect.on('change', function () {
var uid = $(this).parent().parent().attr('data-uid');
var quota = $(this).val();
- setQuota(uid, quota);
+ setQuota(uid, quota, function(returnedQuota){
+ if (quota !== returnedQuota) {
+ $(quotaSelect).find(':selected').text(returnedQuota);
+ }
+ });
});
},
// From http://my.opera.com/GreyWyvern/blog/show.dml/1671288
@@ -428,9 +432,14 @@ $(document).ready(function () {
});
$('select.quota, select.quota-user').singleSelect().on('change', function () {
+ var select = $(this);
var uid = $(this).parent().parent().attr('data-uid');
var quota = $(this).val();
- setQuota(uid, quota);
+ setQuota(uid, quota, function(returnedQuota){
+ if (quota !== returnedQuota) {
+ select.find(':selected').text(returnedQuota);
+ }
+ });
});
$('#newuser').submit(function (event) {
diff --git a/settings/templates/users.php b/settings/templates/users.php
index b556ef4b92e..f9d4f6ada5e 100644
--- a/settings/templates/users.php
+++ b/settings/templates/users.php
@@ -41,7 +41,7 @@ $_['subadmingroups'] = array_flip($items);
<div class="quota">
<span><?php p($l->t('Default Storage'));?></span>
<?php if((bool) $_['isadmin']): ?>
- <select class='quota'>
+ <select class='quota' data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>">
<option
<?php if($_['default_quota'] === 'none') print_unescaped('selected="selected"');?>
value='none'>
@@ -136,7 +136,7 @@ $_['subadmingroups'] = array_flip($items);
</td>
<?php endif;?>
<td class="quota">
- <select class='quota-user'>
+ <select class='quota-user' data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>">
<option
<?php if($user['quota'] === 'default') print_unescaped('selected="selected"');?>
value='default'>