Skip to content

Commit

Permalink
UI: update user icon to show inactive users (#4246)
Browse files Browse the repository at this point in the history
  • Loading branch information
schuer committed Jan 4, 2021
1 parent 1f78fbe commit 4813ecb
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 9 deletions.
Binary file modified .github/tests-visual/users_edit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion redaxo/src/addons/be_style/assets/css/styles.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions redaxo/src/addons/be_style/scss/_icon.scss
Expand Up @@ -295,6 +295,9 @@
.rex-icon-user-secret {
@extend .fa-user-secret;
}
.rex-icon-user-inactive {
@extend .fa-user-o;
}
.rex-icon-unstable-version {
@extend .fa-flask;
}
Expand Down
3 changes: 2 additions & 1 deletion redaxo/src/addons/users/lang/de_de.lang
Expand Up @@ -27,7 +27,8 @@ user_extras = Extras
last_login = Letzter Login
user_caption = Liste der angelegten Benutzer
user_password_change_required = Passwort muss nach Login ausgetauscht werden
user_status = User ist aktiv
user_status_active = Benutzer ist aktiv
user_status_inactive = Benutzer ist inaktiv
startpage = Startseite

user_role = Rolle(n)
Expand Down
3 changes: 2 additions & 1 deletion redaxo/src/addons/users/lang/en_gb.lang
Expand Up @@ -27,7 +27,8 @@ user_extras = Extras
last_login = Last login
user_caption = List of users
user_password_change_required = Password needs to be replaced after signing in
user_status = Status
user_status_active = User is active
user_status_inactive = User is inactive
startpage = Startpage

user_role = Role(s)
Expand Down
1 change: 0 additions & 1 deletion redaxo/src/addons/users/lang/es_es.lang
Expand Up @@ -27,7 +27,6 @@ user_extras = Extras
last_login = Último acceso
user_caption = Lista de usuarios
user_password_change_required = La contraseña debe cambiarse después de iniciar sesión
user_status = Estado
startpage = Página de inicio

user_role = Papel(es)
Expand Down
1 change: 0 additions & 1 deletion redaxo/src/addons/users/lang/pt_br.lang
Expand Up @@ -24,7 +24,6 @@ user_options = Opções
user_extras = Extras
last_login = Último login
user_caption = Lista de usuários
user_status = Status
startpage = Página inicial

user_role = Função/Funções
Expand Down
1 change: 0 additions & 1 deletion redaxo/src/addons/users/lang/sv_se.lang
Expand Up @@ -27,7 +27,6 @@ user_extras = Extras
last_login = Senase login
user_caption = Lista över sparade användare
user_password_change_required = Lösenord måste bytas ut efter inloggning
user_status = Användaren är aktiv
startpage = Startsida

user_role = Roll
Expand Down
9 changes: 6 additions & 3 deletions redaxo/src/addons/users/pages/users.php
Expand Up @@ -472,7 +472,7 @@
}

$n = [];
$n['label'] = '<label for="rex-user-status">' . rex_i18n::msg('user_status') . '</label>';
$n['label'] = '<label for="rex-user-status">' . rex_i18n::msg('user_status_active') . '</label>';
$n['field'] = $add_status_chkbox;
$formElements[] = $n;

Expand Down Expand Up @@ -563,13 +563,16 @@
');
$list->addTableAttribute('class', 'table-striped table-hover');

$tdIcon = '<i class="rex-icon rex-icon-user"></i>';
$tdIcon = '<i class="rex-icon rex-icon-user" title="'. rex_i18n::msg('user_status_active') . '"></i>';
$thIcon = '<a href="' . $list->getUrl(['FUNC_ADD' => '1']) . '"' . rex::getAccesskey(rex_i18n::msg('create_user'), 'add') . ' title="' . rex_i18n::msg('create_user') . '"><i class="rex-icon rex-icon-add-user"></i></a>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnParams($thIcon, ['user_id' => '###id###']);
$list->setColumnFormat($thIcon, 'custom', static function ($params) use ($thIcon, $tdIcon) {
$list = $params['list'];
$tdIcon = !$list->getValue('status') ? str_replace('rex-icon-user', 'rex-icon-user text-muted', $tdIcon) : $tdIcon;
if (!$list->getValue('status')) {
$tdIcon = str_replace('rex-icon-user', 'rex-icon-user-inactive text-muted', $tdIcon);
$tdIcon = str_replace(rex_i18n::msg('user_status_active'), rex_i18n::msg('user_status_inactive'), $tdIcon);
}
return !$list->getValue('admin') || rex::getUser()->isAdmin() ? $list->getColumnLink($thIcon, $tdIcon) : $tdIcon;
});

Expand Down

0 comments on commit 4813ecb

Please sign in to comment.