]> source.dussan.org Git - nextcloud-server.git/commitdiff
Some ui work on user management, but it can still use a lot of improvement.
authorRobin Appelman <icewind1991@gmail.com>
Tue, 19 Jul 2011 23:18:43 +0000 (01:18 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Wed, 20 Jul 2011 13:51:19 +0000 (15:51 +0200)
admin/js/users.js
admin/templates/users.php
admin/users.php
core/css/styles.css
files/css/files.css

index 48f3b15e3b80b881885575ab5059dfd4f1300c39..994ce6f6cbd4942147609c163d5b9556600210b6 100644 (file)
@@ -112,7 +112,7 @@ $(document).ready(function(){
        //#########################################################################
 
        // Password (clicking on user name)
-       $("div[x-use='usernamediv']").live( "click", function(){
+       $("span[x-use='usernamediv']").live( "click", function(){
                if( togglepassword == "" || $(this).parent().parent().attr("x-uid") != togglepassword ){
                        togglepassword = $(this).parent().parent().attr("x-uid");
                        // Set the username!
@@ -167,6 +167,7 @@ $(document).ready(function(){
                                }
                        });
                        $("#changegroupuid").val(togglegroup);
+                       $(this).empty();
                        $(this).parent().append( $('#changegroups') );
                        $('#changegroups').show();
                }
@@ -205,13 +206,6 @@ $(document).ready(function(){
        // Clicking on buttons
        //#########################################################################
 
-       // Show the create user form
-       $( "#createuseroptionbutton" )
-               .click(function(){
-                       $("#createuserform").show();
-                       $("#createuseroption").hide();
-                       return false;
-               });
 
        // Create a new user
        $( "#createuserbutton" )
index 133028c4e274d3cad76eff8ee185b9aeda31871c..147db7c7aa4190926c65103a3b0de549e206aeda 100644 (file)
-<h2><?php echo $l->t( 'Users' ); ?></h2>
-
-<table id="usertable">
-       <thead>
-               <tr>
-                       <th><?php echo $l->t( 'Name' ); ?></th>
-                       <th><?php echo $l->t( 'Groups' ); ?></th>
-                       <th></th>
-               </tr>
-       </thead>
-       <tfoot>
-               <tr id="createuseroption">
-                       <td><button id="createuseroptionbutton"><?php echo $l->t( 'Add user' ); ?></button></td>
-                       <td>&nbsp;</td>
-                       <td>&nbsp;</td>
-               </tr>
-               <form id="createuserdata">
-                       <tr id="createuserform" style="display:none;">
-                               <td>
-                                       <?php echo $l->t( 'Name' ); ?> <input x-use="createuserfield" type="text" name="username" /><br>
-                                       <?php echo $l->t( 'Password' ); ?> <input x-use="createuserfield" type="password" name="password" />
-                               </td>
-                               <td id="createusergroups">
-                                       <?php foreach($_["groups"] as $i): ?>
-                                               <input x-use="createusercheckbox" x-gid="<?php echo $i["name"]; ?>" type="checkbox" name="groups[]" value="<?php echo $i["name"]; ?>" />
-                                               <span x-gid="<?php echo $i["name"]; ?>"><?php echo $i["name"]; ?><br></span>
-                                       <?php endforeach; ?>
-                               </td>
-                               <td>
-                                       <button id="createuserbutton"><?php echo $l->t( 'Create user' ); ?></button>
-                               </td>
+<fieldset>
+       <legend><?php echo $l->t( 'Users' ); ?></legend>
+       <table id="usertable">
+               <thead>
+                       <tr>
+                               <th><?php echo $l->t( 'Name' ); ?></th>
+                               <th><?php echo $l->t( 'Groups' ); ?></th>
+                               <th></th>
                        </tr>
-               </form>
-       </tfoot>
-       <tbody>
-               <?php foreach($_["users"] as $user): ?>
-                       <tr x-uid="<?php echo $user["name"] ?>">
-                               <td x-use="username"><div x-use="usernamediv"><?php echo $user["name"]; ?></div></td>
-                               <td x-use="usergroups"><div x-use="usergroupsdiv"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo "&nbsp";} ?></div></td>
-                               <td><a  class="removeuserbutton" href=""><?php echo $l->t( 'remove' ); ?></a></td>
+               </thead>
+               <tfoot>
+                       <tr id="createuserform">
+                               <form id="createuserdata">
+                                       <td>
+                                               <input x-use="createuserfield" type="text" name="username" placeholder='<?php echo $l->t( 'Name' ); ?>' />
+                                               <input x-use="createuserfield" type="password" name="password" placeholder='<?php echo $l->t( 'Password' ); ?>' />
+                                       </td>
+                                       <td id="createusergroups">
+                                               <?php foreach($_["groups"] as $i): ?>
+                                                       <input id='newuser_group_<?php echo $i["name"]; ?>' x-use="createusercheckbox" x-gid="<?php echo $i["name"]; ?>" type="checkbox" name="groups[]" value="<?php echo $i["name"]; ?>" />
+                                                       <span x-gid="<?php echo $i["name"]; ?>"><label for='newuser_group_<?php echo $i["name"]; ?>'><?php echo $i["name"]; ?></label></span>
+                                               <?php endforeach; ?>
+                                       </td>
+                                       <td>
+                                               <button id="createuserbutton"><?php echo $l->t( 'Create' ); ?></button>
+                                       </td>
+                               </form>
                        </tr>
-               <?php endforeach; ?>
-       </tbody>
-</table>
+               </tfoot>
+               <tbody>
+                       <?php foreach($_["users"] as $user): ?>
+                               <tr x-uid="<?php echo $user["name"] ?>">
+                                       <td x-use="username"><span x-use="usernamediv"><?php echo $user["name"]; ?></span></td>
+                                       <td x-use="usergroups"><div x-use="usergroupsdiv"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo "&nbsp";} ?></div></td>
+                                       <td>
+                                               <?php if($user['name']!=OC_USER::getUser()):?>
+                                                       <a  class="removeuserbutton" href=""><?php echo $l->t( 'remove' ); ?></a>
+                                               <?php endif;?>
+                                       </td>
+                               </tr>
+                       <?php endforeach; ?>
+               </tbody>
+       </table>
+</fieldset>
 
-<h2><?php echo $l->t( 'Groups' ); ?></h2>
-<table id="grouptable">
-       <thead>
-               <tr>
-                       <th><?php echo $l->t( 'Name' ); ?></th>
-                       <th></th>
-               </tr>
-       </thead>
-       <tfoot>
-               <form id="creategroupdata">
+<fieldset>
+               <legend><?php echo $l->t( 'Groups' ); ?></legend>
+       <table id="grouptable">
+               <thead>
                        <tr>
-                               <td><input x-use="creategroupfield" type="text" name="groupname" /></td>
-                               <td><button id="creategroupbutton"><?php echo $l->t( 'Create group' ); ?></button></td>
-                       </tr>
-               </form>
-       </tfoot>
-       <tbody>
-               <?php foreach($_["groups"] as $group): ?>
-                       <tr x-gid="<?php echo $group["name"]; ?>">
-                               <td><?php echo $group["name"] ?></td>
-                               <td>
-                                       <?php if( $group["name"] != "admin" ): ?>
-                                               <a class="removegroupbutton" href=""><?php echo $l->t( 'remove' ); ?></a>
-                                       <?php else: ?>
-                                               &nbsp;
-                                       <?php endif; ?>
-                               </td>
+                               <th><?php echo $l->t( 'Name' ); ?></th>
+                               <th></th>
                        </tr>
-               <?php endforeach; ?>
-       </tbody>
-</table>
-
+               </thead>
+               <tfoot>
+                       <form id="creategroupdata">
+                               <tr>
+                                       <td><input x-use="creategroupfield" type="text" name="groupname" /></td>
+                                       <td><button id="creategroupbutton"><?php echo $l->t( 'Create group' ); ?></button></td>
+                               </tr>
+                       </form>
+               </tfoot>
+               <tbody>
+                       <?php foreach($_["groups"] as $group): ?>
+                               <tr x-gid="<?php echo $group["name"]; ?>">
+                                       <td><?php echo $group["name"] ?></td>
+                                       <td>
+                                               <?php if( $group["name"] != "admin" ): ?>
+                                                       <a class="removegroupbutton" href=""><?php echo $l->t( 'remove' ); ?></a>
+                                               <?php else: ?>
+                                                       &nbsp;
+                                               <?php endif; ?>
+                                       </td>
+                               </tr>
+                       <?php endforeach; ?>
+               </tbody>
+       </table>
+</fieldset>
 
 
-<div id="changegroups" style="display:none">
+<span id="changegroups" style="display:none">
        <form id="changegroupsform">
                <input id="changegroupuid" type="hidden" name="username" value="" />
                <input id="changegroupgid" type="hidden" name="group" value="" />
                <?php foreach($_["groups"] as $i): ?>
                        <input x-use="togglegroup" x-gid="<?php echo $i["name"]; ?>" type="checkbox" name="groups[]" value="<?php echo $i["name"]; ?>" />
-                       <span x-use="togglegroup" x-gid="<?php echo $i["name"]; ?>"><?php echo $i["name"]; ?><br></span>
+                       <span x-use="togglegroup" x-gid="<?php echo $i["name"]; ?>"><?php echo $i["name"]; ?></span>
                <?php endforeach; ?>
        </form>
-</div>
+</span>
 
-<div id="changepassword" style="display:none">
+<span id="changepassword" style="display:none">
        <form id="changepasswordform">
                <input id="changepassworduid" type="hidden" name="username" value="" />
                <?php echo $l->t( 'Force new password:' ); ?>
                <input id="changepasswordpwd" type="password" name="password" value="" />
                <button id="changepasswordbutton"><?php echo $l->t( 'Set' ); ?></button>
        </form>
-</div>
+</span>
 
 <div id="removeuserform" title="Remove user">
        <form id="removeuserdata">
index 0848d57162a16b8cd2d7b41c3f7403626222e614..8237d06da0b86e022379cef26838ea999f5879de 100644 (file)
@@ -30,6 +30,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
 
 // We have some javascript foo!
 OC_UTIL::addScript( "admin", "users" );
+OC_UTIL::addStyle( "admin", "users" );
 OC_APP::setActiveNavigationEntry( "core_users" );
 
 $users = array();
index 678ad009d1a1392e4de8c899c17ae7b501cba7c6..f9b536a2b0442b9d50a84913be40bca50c8a0e33 100644 (file)
@@ -7,8 +7,6 @@ h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercas
 p.center { text-align:center; }
 a { color:#000; text-decoration:none; }
 
-form { margin:2em 2em 2em 3em; }
-form#quota { max-width:600px; }
 form#user_settings { max-width:600px; }
 form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; }
 form p { padding:0.5em 4em 0.5em 0.5em; text-align:left; }
@@ -19,8 +17,8 @@ form input[type="submit"] { padding:0.1em 1em; border:1px solid #999; font-weigh
 form input[type="submit"]:hover, form input[type="submit"]:focus { border:1px solid #999; background-color:#999; outline:0; }
 form input[type="submit"]:active { outline:0; }
 form input[type="button"], form input[type="text"] { font-size: 0.9em; }
-fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; }
-legend { padding:0 0.5em; font-size:1.2em; }
+fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; }
+legend { padding: 0.5em; font-size:1.2em; }
 
 div.controls { width:91%; margin:1em 1em 1em 2em; padding:0.5em 0; background-color:#f7f7f7; border:1px solid #eee; }
 
index ed67755ab4abe005f0c33c9f12afe44e2a3ce679..40ce67c66fff0ce920fa79813992504efcc3a646 100644 (file)
@@ -22,6 +22,7 @@
 
 #file_upload_form, #file_newfolder_form {
        display: inline;
+       margin-left:3em;
 }
 
 #fileSelector, #file_upload_submit, #file_newfolder_submit {