Improve UX of Change Database block
Originally reported on Google Code with ID 16 ``` There are too many clicks to change a DB (3). It can be taken down to 1 click.
Here's how: if the DB list is smaller than say 10 items, don't show a drop down, but a flattened out list of the DB's.
There are two ways to implement: --------------- 1) As a list of links: Change the $_POST['database_switch'] to $_REQUEST['database_switch'] if (sizeof($databases) < 10) { for($i=0; $i<sizeof($databases); $i++) { if($i==$_SESSION['currentDB']) echo "<a href='?database_switch=".$i."'>".$databases[$i]['name']."</a>"; else echo "<a href='?database_switch=".$i."' style=\"text-decoration:underline;\">".$databases[$i]['name']."</a>";
echo '<br/>'; } } else { previous form code as per normal } ---------------
OR
2. set a size attribute on the <select box to make the dropdown "longer".
Great product BTW. ```
Reported by `jddcef` on 2011-04-29 18:59:09
Comments (3)
-
-
reporter ``` Hi, I didn't say it in words, but in the code it caters for the case when there are a lot databases, namely, by only flattening the list out when there are fewer than say 10 items. ```
Reported by `jddcef` on 2011-05-29 17:06:13
-
``` This has been implemented. When there are less than 10 databases, they are listed as links instead of in a drop down menu. ```
Reported by `diracleo` on 2011-06-01 21:41:00 - Status changed: `Fixed`
- Log in to comment
``` The problem with showing a list of links is that if there are a lot of databases, too much of the screen will be taken up unnecessarily. The 3 steps to switch databases is not a huge issue in my eyes because switching databases is not a common action.
```
Reported by `diracleo` on 2011-05-28 23:14:31