From f705e32a4747719e91388ea13b4bb74e12aaf790 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 20 Mar 2020 21:22:57 -0300 Subject: [PATCH] Replace fieldset with cards for db operations page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- .../Controllers/Database/OperationsController.php | 3 - templates/database/operations/index.twig | 430 +++++++++++---------- themes/metro/scss/_common.scss | 5 - 3 files changed, 233 insertions(+), 205 deletions(-) rewrite templates/database/operations/index.twig (74%) diff --git a/libraries/classes/Controllers/Database/OperationsController.php b/libraries/classes/Controllers/Database/OperationsController.php index cb35de73a5..11e84b3dc7 100644 --- a/libraries/classes/Controllers/Database/OperationsController.php +++ b/libraries/classes/Controllers/Database/OperationsController.php @@ -302,8 +302,6 @@ class OperationsController extends AbstractController $databaseComment = $this->relation->getDbComment($db); } - $createTable = CreateTable::getHtml($db); - $hasAdjustPrivileges = $GLOBALS['db_priv'] && $GLOBALS['table_priv'] && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] && $GLOBALS['is_reload_priv']; @@ -337,7 +335,6 @@ class OperationsController extends AbstractController 'db' => $db, 'has_comment' => $cfgRelation['commwork'], 'db_comment' => $databaseComment, - 'create_table' => $createTable, 'db_collation' => $db_collation, 'has_adjust_privileges' => $hasAdjustPrivileges, 'is_drop_database_allowed' => $isDropDatabaseAllowed, diff --git a/templates/database/operations/index.twig b/templates/database/operations/index.twig dissimilarity index 74% index 6da3958854..cb7cb320c8 100644 --- a/templates/database/operations/index.twig +++ b/templates/database/operations/index.twig @@ -1,197 +1,233 @@ -{{ message|raw }} - -{% if has_comment %} -
-
- {{ get_hidden_inputs(db) }} - -
- - {{ get_icon('b_comment', 'Database comment'|trans) }} - - -
- -
- -
-
-
-{% endif %} - -
- {{ create_table|raw }} -
- -{% if db != 'mysql' %} -
-
- {{ get_hidden_inputs(db) }} - - - - {% if db_collation is not empty %} - - {% endif %} - -
- - {{ get_icon('b_edit', 'Rename database to'|trans) }} - - -
- - {% if has_adjust_privileges %} - - {% else %} - - {% endif %} - - -
-
- -
- -
-
-
-{% endif %} - -{% if is_drop_database_allowed %} -
-
- - {{ get_icon('b_deltbl', 'Remove database'|trans) }} - -
    -
  • - {{ link_or_button( - url('/sql', { - 'sql_query': 'DROP DATABASE ' ~ backquote(db), - 'back': url('/database/operations'), - 'goto': url('/'), - 'reload': true, - 'purge': true, - 'message_to_show': 'Database %s has been dropped.'|trans|format(backquote(db))|e, - 'db': null - }), - 'Drop the database (DROP)'|trans, - { - 'id': 'drop_db_anchor', - 'class': 'ajax' - } - ) }} - {{ show_mysql_docu('DROP_DATABASE') }} -
  • -
-
-
-{% endif %} - -
-
- {{ get_hidden_inputs(db) }} - - - {% if db_collation is not empty %} - - {% endif %} - -
- - {{ get_icon('b_edit', 'Copy database to'|trans) }} - - - -
- {{ get_radio_fields('what', { - 'structure': 'Structure only'|trans, - 'data': 'Structure and data'|trans, - 'dataonly': 'Data only'|trans - }, 'data', true) }} -
- - - -
- - - -
- - - -
- - - -
- - {% if has_adjust_privileges %} - - {% else %} - - {% endif %} - - -
- - - -
- -
- -
-
-
- -
-
- {{ get_hidden_inputs(db) }} - -
- - - - - -
- - - -
- - - - - -
- -
- -
-
-
+
+ + {{ message|raw }} + + {% if has_comment %} +
+ {{ get_hidden_inputs(db) }} +
+
{{ get_icon('b_comment', 'Database comment'|trans) }}
+
+
+
+ + +
+
+
+ +
+
+ {% endif %} + +
+ {{ get_hidden_inputs(db) }} + +
+
{{ get_icon('b_table_add', 'Create table'|trans) }}
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + {% if db != 'mysql' %} +
+ {{ get_hidden_inputs(db) }} + + + + {% if db_collation is not empty %} + + {% endif %} + +
+
{{ get_icon('b_edit', 'Rename database to'|trans) }}
+
+
+
+ + +
+
+ +
+ + +
+
+ + +
+
+ {% endif %} + + {% if is_drop_database_allowed %} +
+
{{ get_icon('b_deltbl', 'Remove database'|trans) }}
+
+
+ {{ link_or_button( + url('/sql', { + 'sql_query': 'DROP DATABASE ' ~ backquote(db), + 'back': url('/database/operations'), + 'goto': url('/'), + 'reload': true, + 'purge': true, + 'message_to_show': 'Database %s has been dropped.'|trans|format(backquote(db))|e, + 'db': null + }), + 'Drop the database (DROP)'|trans, + { + 'id': 'drop_db_anchor', + 'class': 'ajax text-danger' + } + ) }} + {{ show_mysql_docu('DROP_DATABASE') }} +
+
+
+ {% endif %} + +
+ {{ get_hidden_inputs(db) }} + + + {% if db_collation is not empty %} + + {% endif %} + +
+
{{ get_icon('b_edit', 'Copy database to'|trans) }}
+
+
+
+ + +
+
+ +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ +
+ {{ get_hidden_inputs(db) }} + +
+
{{ get_icon('s_asci', 'Collation'|trans) }}
+
+
+
+ + +
+
+ +
+ + +
+
+ + +
+
+ + +
+
+ +
diff --git a/themes/metro/scss/_common.scss b/themes/metro/scss/_common.scss index 778361fac3..09ef44ad46 100644 --- a/themes/metro/scss/_common.scss +++ b/themes/metro/scss/_common.scss @@ -2285,11 +2285,6 @@ form { } } - &#formDatabaseComment .tblFooters, - &#create_table_form_minimal .tblFooters, - &#rename_db_form .tblFooters, - &#copy_db_form .tblFooters, - &#change_db_charset_form .tblFooters, &#alterTableOrderby .tblFooters, &#moveTableForm .tblFooters, &#copyTable .tblFooters, -- 2.11.4.GIT