From 7bdcda572011337d33bbe485f3fe10eae6bd21a5 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 19 Nov 2019 16:32:21 -0300 Subject: [PATCH] Basic roles listing using wordpress admin layout. #274. --- src/admin/js/wp-i18n-plugin.js | 6 +- src/admin/roles.vue | 157 ++++++++++++++++++++++++++++++++- 2 files changed, 158 insertions(+), 5 deletions(-) diff --git a/src/admin/js/wp-i18n-plugin.js b/src/admin/js/wp-i18n-plugin.js index a158c1798..e6e6c79cc 100644 --- a/src/admin/js/wp-i18n-plugin.js +++ b/src/admin/js/wp-i18n-plugin.js @@ -16,13 +16,13 @@ I18NPlugin.install = function (Vue, options = {}) { return __(key, 'tainacan'); }, getWithContext(key, keyContext) { - return __(key, keyContext, 'tainacan'); + return _x(key, keyContext, 'tainacan'); }, getWithNumber(keySingle, keyPlural, number) { - return __(keySingle, keyPlural, number, 'tainacan'); + return _n(keySingle, keyPlural, number, 'tainacan'); }, getWithNumberAndContext(keySingle, keyPlural, number, keyContext) { - return __(keySingle, keyPlural, number, keyContext, 'tainacan'); + return _nx(keySingle, keyPlural, number, keyContext, 'tainacan'); }, } diff --git a/src/admin/roles.vue b/src/admin/roles.vue index 9285236b4..af9ae9931 100644 --- a/src/admin/roles.vue +++ b/src/admin/roles.vue @@ -6,13 +6,166 @@ {{ $i18n.get('Add new role') }} -
+
+
+

{{ $i18n.get('Roles list') }}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + {{ $i18n.get('Name') }} + + + {{ $i18n.get('Slug') }} + + {{ $i18n.get('Number of Capabilities') }} +
+ + + + + {{ role.name }} + +
+ + +
+ {{ role.slug }} + + {{ Object.values(role.capabilities).length }} +
+ + + + + {{ $i18n.get('Name') }} + + + {{ $i18n.get('Slug') }} + + {{ $i18n.get('Number of Capabilities') }} +