From 51d88264fc13735ab9e1b97436cb7c88a99fc3f8 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sat, 11 May 2013 12:06:27 +0100 Subject: [PATCH] Improved layout on db and table operations pages --- ChangeLog | 1 + db_operations.php | 3 +++ js/functions.js | 32 ++++++++++++++++++++++++++++++ libraries/operations.lib.php | 21 +++++++++++--------- tbl_operations.php | 7 ++++--- themes/original/css/common.css.php | 13 +++++++++++- themes/pmahomme/css/common.css.php | 13 +++++++++++- 7 files changed, 76 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffdd737ce6..06b86c28d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog + rfe #1414 Allow specifying controlport + PMA_DBI functions in database interface libraries renamed to be compliant with PEAR standards + rfe #1412 Creating a view from an empty set of results ++ Improved layout on db and table operations pages 4.0.1.0 (not yet released) - bug #3879 Import broken for CSV using LOAD DATA diff --git a/db_operations.php b/db_operations.php index 4f4d1b14a6..3c7dced6a1 100644 --- a/db_operations.php +++ b/db_operations.php @@ -208,6 +208,8 @@ if (empty($is_info)) { $_REQUEST['db_collation'] = PMA_getDbCollation($db); $is_information_schema = PMA_is_system_schema($db); +$response->addHTML('
'); + if (!$is_information_schema) { if ($cfgRelation['commwork']) { /** @@ -273,6 +275,7 @@ if (!$is_information_schema) { } // end if } // end if (!$is_information_schema) +$response->addHTML('
'); // not sure about displaying the PDF dialog in case db is information_schema if ($cfgRelation['pdfwork'] && $num_tables > 0) { diff --git a/js/functions.js b/js/functions.js index f07294a656..184e3cceb9 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3849,3 +3849,35 @@ $('a.login-link').live('click', function (e) { e.preventDefault(); window.location.reload(true); }); + +/** + * Dynamically adjust the width of the boxes + * on the table and db operations pages + */ +(function () { + function DynamicBoxes() { + var $boxContainer = $('#boxContainer'); + if ($boxContainer.length) { + var minWidth = $boxContainer.data('box-width'); + var viewport = $(window).width() - $('#pma_navigation').width(); + var slots = Math.floor(viewport / minWidth); + $boxContainer.children() + .each(function () { + if (viewport < minWidth) { + $(this).width(minWidth); + } else { + $(this).css('width', ((1 / slots) * 100) + "%"); + } + }) + .removeClass('clearfloat') + .filter(':nth-child(' + slots + 'n+1)') + .addClass('clearfloat'); + } + } + AJAX.registerOnload('functions.js', function () { + DynamicBoxes(); + }); + $(function () { + $(window).resize(DynamicBoxes); + }); +})(); \ No newline at end of file diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 13bb4e4dbd..f98ac93156 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -626,10 +626,13 @@ function PMA_getHtmlForOrderTheTable($columns) . htmlspecialchars($fieldname['Field']) . '' . "\n"; } $html_output .= ' ' . __('(singly)') . ' ' - . '' + . '
' + . '' + . '' + . '' + . '' . '' . '
' . '' @@ -666,12 +669,12 @@ function PMA_getHtmlForMoveTable() . 'name="target_db" value="' . htmlspecialchars($GLOBALS['db']) . '"/>'; } else { - $html_output .= '' . $GLOBALS['pma']->databases->getHtmlOptions(true, false) . ''; } $html_output .= ' . '; - $html_output .= '
'; @@ -996,16 +999,16 @@ function PMA_getHtmlForCopytable() . __('Copy table to (database.table):') . ''; if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) { - $html_output .= ''; } else { - $html_output .= '' . $GLOBALS['pma']->databases->getHtmlOptions(true, false) . ''; } $html_output .= ' . '; - $html_output .= '
'; diff --git a/tbl_operations.php b/tbl_operations.php index c284c7ef98..1b1b8e7844 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -230,6 +230,8 @@ $columns = PMA_DBI_getColumns($GLOBALS['db'], $GLOBALS['table']); /** * Displays the page */ +$response->addHTML('
'); + /** * Order the table */ @@ -278,8 +280,6 @@ $response->addHTML( */ $response->addHTML(PMA_getHtmlForCopytable()); -$response->addHTML('
'); - /** * Table maintenance */ @@ -344,7 +344,6 @@ if (! (isset($db_is_information_schema) && $db_is_information_schema)) { ) ); } -$response->addHTML('
'); if (PMA_Partition::havePartitioning()) { $partition_names = PMA_Partition::getPartitionNames($db, $table); @@ -375,4 +374,6 @@ if ($cfgRelation['relwork'] && ! $is_innodb) { } // end if (!empty($cfg['Server']['relation'])) +$response->addHTML('
'); + ?> diff --git a/themes/original/css/common.css.php b/themes/original/css/common.css.php index a2dceaf372..00186c5cd8 100644 --- a/themes/original/css/common.css.php +++ b/themes/original/css/common.css.php @@ -1316,7 +1316,18 @@ li.no_bullets { width: 48%; float: ; } - +.operations_half_width input[type=text], +.operations_half_width select { + width: 95%; +} +.operations_half_width input[type=text].halfWidth, +.operations_half_width select.halfWidth { + width: 40%; +} +.operations_half_width ul { + list-style-type: none; + padding: 0; +} .operations_full_width { width: 100%; clear: both; diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 27d3a70df3..756fc997ad 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -1693,7 +1693,18 @@ li.no_bullets { width: 48%; float: ; } - +.operations_half_width input[type=text], +.operations_half_width select { + width: 95%; +} +.operations_half_width input[type=text].halfWidth, +.operations_half_width select.halfWidth { + width: 40%; +} +.operations_half_width ul { + list-style-type: none; + padding: 0; +} .operations_full_width { width: 100%; clear: both;