diff --git a/ChangeLog b/ChangeLog index 87253b5d26..be04231cea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ phpMyAdmin - ChangeLog - issue Make database and web server info separately configurable on `$cfg['ShowServerInfo']` - issue Add a configuration option to (dis)allow shared bookmarks: `$cfg['AllowSharedBookmarks'] = true;` - issue Redesign the User Groups form page +- issue Redesign the database and table privileges pages 5.2.2 (not yet released) - issue #17028 Fix total count of rows in not accurate diff --git a/templates/database/privileges/index.twig b/templates/database/privileges/index.twig index 9c68d50feb..b3a38ad106 100644 --- a/templates/database/privileges/index.twig +++ b/templates/database/privileges/index.twig @@ -1,14 +1,14 @@ -{% if is_superuser %} -
- {{ get_hidden_inputs(db) }} +
+ {% if is_superuser %} +

+ {{ get_icon('b_usrcheck') }} + {{ 'Users having access to "%s"'|trans|format('' ~ db|escape('html') ~ '')|raw }} +

-
-
- - {{ get_icon('b_usrcheck') }} - {{ 'Users having access to "%s"'|trans|format('' ~ db|escape('html') ~ '')|raw }} - + + {{ get_hidden_inputs(db) }} +
@@ -92,10 +92,10 @@ - {% if privileges_amount > 1 %} - - {% endif %} - {% endfor %} + {% if privileges_amount > 1 %} + + {% endif %} + {% endfor %} {% else %}
@@ -107,7 +107,7 @@
-
+

             {%- trans 'With selected:' %} @@ -117,25 +117,20 @@ {{ get_icon('b_tblexport', 'Export'|trans) }}
-
-
- -{% else %} - {{ 'Not enough privilege to view users.'|trans|error }} -{% endif %} +
+ + {% else %} + {{ 'Not enough privilege to view users.'|trans|error }} + {% endif %} -{% if is_createuser %} -
-
-
- {% trans %}New{% context %}Create new user{% endtrans %} - - {{ get_icon('b_usradd', 'Add user account'|trans) }} - -
+ {% if is_createuser %} +
+ + {{ get_icon('b_usradd', 'Add user account'|trans) }} +
-
-{% endif %} + {% endif %} +
diff --git a/templates/table/privileges/index.twig b/templates/table/privileges/index.twig index 51e5e0d011..393f743ba3 100644 --- a/templates/table/privileges/index.twig +++ b/templates/table/privileges/index.twig @@ -1,145 +1,141 @@ -{% if is_superuser %} -
- {{ get_hidden_inputs(db, table) }} +
+ {% if is_superuser %} +

+ {{ get_icon('b_usrcheck') }} + {{ 'Users having access to "%s"'|trans|format('' ~ db|escape('html') ~ '.' ~ table|escape('html') ~ '')|raw }} +

-
- - {{ get_icon('b_usrcheck') }} - {{ 'Users having access to "%s"'|trans|format('' ~ db|escape('html') ~ '.' ~ table|escape('html') ~ '')|raw }} - - -
- - - - - - - - - - - - - - - {% for privilege in privileges %} - {% set privileges_amount = privilege.privileges|length %} + + {{ get_hidden_inputs(db, table) }} +
+
+
{% trans 'User name' %}{% trans 'Host name' %}{% trans 'Type' %}{% trans 'Privileges' %}{% trans 'Grant' %}{% trans 'Action' %}
+ - 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}> - - - 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}> - {% if privilege.user is empty %} - {% trans 'Any' %} - {% else %} - {{ privilege.user }} - {% endif %} - - 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}> - {{ privilege.host }} - - {% for priv in privilege.privileges %} - + + + + + + + + + + + {% for privilege in privileges %} + {% set privileges_amount = privilege.privileges|length %} + + 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}> + + + 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}> + {% if privilege.user is empty %} + {% trans 'Any' %} + {% else %} + {{ privilege.user }} {% endif %} - + {% for priv in privilege.privileges %} + - - + - - + + {% if privileges_amount > 1 %} {% endif %} {% endfor %} - {% else %} - - - - {% endfor %} - -
- {% if priv.type == 'g' %} - {% trans 'global' %} - {% elseif priv.type == 'd' %} - {% if priv.database == db|replace({'_': '\\_', '%': '\\%'}) %} - {% trans 'database-specific' %} - {% else %} - {% trans 'wildcard' %}: {{ priv.database }} - {% endif %} - {% elseif priv.type == 't' %} - {% trans 'table-specific' %} - {% elseif priv.type == 'r' %} - {% trans 'routine' %} + {% trans 'User name' %}{% trans 'Host name' %}{% trans 'Type' %}{% trans 'Privileges' %}{% trans 'Grant' %}{% trans 'Action' %}
- - {% if priv.type == 'r' %} - {{ priv.routine }} - ({{ priv.privileges|join(', ')|upper }}) - {% else %} - {{ priv.privileges|join(', ')|raw }} + 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}> + {{ privilege.host }} + + {% if priv.type == 'g' %} + {% trans 'global' %} + {% elseif priv.type == 'd' %} + {% if priv.database == db|replace({'_': '\\_', '%': '\\%'}) %} + {% trans 'database-specific' %} + {% else %} + {% trans 'wildcard' %}: {{ priv.database }} + {% endif %} + {% elseif priv.type == 't' %} + {% trans 'table-specific' %} + {% elseif priv.type == 'r' %} + {% trans 'routine' %} {% endif %} - - - {{ priv.has_grant ? 'Yes'|trans : 'No'|trans }} - - {% if is_grantuser %} - + {{ get_icon('b_usredit', 'Edit privileges'|trans) }} + + {% endif %} + + - {{ get_icon('b_usredit', 'Edit privileges'|trans) }} + {{ get_icon('b_tblexport', 'Export'|trans) }} - {% endif %} - - - {{ get_icon('b_tblexport', 'Export'|trans) }} - -
- {% trans 'No user found.' %} -
-
+ {% else %} + + + {% trans 'No user found.' %} + + + {% endfor %} + + +
-
- 
+        <div>
+          <img class= - - - {% trans 'With selected:' %} - + + + {% trans 'With selected:' %} + +
- -
-{% else %} - {{ 'Not enough privilege to view users.'|trans|error }} -{% endif %} + + {% else %} + {{ 'Not enough privilege to view users.'|trans|error }} + {% endif %} -{% if is_createuser %} -
-
-
- {% trans %}New{% context %}Create new user{% endtrans %} - - {{ get_icon('b_usradd', 'Add user account'|trans) }} - -
+ {% if is_createuser %} +
+ + {{ get_icon('b_usradd', 'Add user account'|trans) }} +
-
-{% endif %} + {% endif %} +
diff --git a/test/classes/Controllers/Database/PrivilegesControllerTest.php b/test/classes/Controllers/Database/PrivilegesControllerTest.php index 72c0c095b3..758b8f7711 100644 --- a/test/classes/Controllers/Database/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Database/PrivilegesControllerTest.php @@ -15,7 +15,6 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Url; use function __; -use function _pgettext; /** @covers \PhpMyAdmin\Controllers\Database\PrivilegesController */ class PrivilegesControllerTest extends AbstractTestCase @@ -106,12 +105,6 @@ class PrivilegesControllerTest extends AbstractTestCase __('Action'), $actual, ); - - //_pgettext('Create new user', 'New') - $this->assertStringContainsString( - _pgettext('Create new user', 'New'), - $actual, - ); } public function testWithInvalidDatabaseName(): void diff --git a/test/classes/Controllers/Table/PrivilegesControllerTest.php b/test/classes/Controllers/Table/PrivilegesControllerTest.php index 774dad85f0..3006137e5c 100644 --- a/test/classes/Controllers/Table/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Table/PrivilegesControllerTest.php @@ -13,7 +13,6 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Url; use function __; -use function _pgettext; /** @covers \PhpMyAdmin\Controllers\Table\PrivilegesController */ class PrivilegesControllerTest extends AbstractTestCase @@ -92,12 +91,6 @@ class PrivilegesControllerTest extends AbstractTestCase __('No user found'), $actual, ); - - //_pgettext('Create new user', 'New') - $this->assertStringContainsString( - _pgettext('Create new user', 'New'), - $actual, - ); } public function testWithInvalidDatabaseName(): void