1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

filter enabled/disabled groups

This commit is contained in:
Sylvain 2017-10-05 17:12:22 +02:00
parent c5f0501df2
commit fb092afc8c
6 changed files with 52 additions and 7 deletions

View File

@ -3,6 +3,15 @@ Application.Controllers.controller "GroupsController", ["$scope", 'groupsPromise
## List of users groups
$scope.groups = groupsPromise
## Default: we show only enabled plans
$scope.groupFiltering = 'enabled'
## Available options for filtering plans by status
$scope.filterDisabled = [
'enabled',
'disabled',
'all',
]
##

View File

@ -1,13 +1,27 @@
<button type="button" class="btn btn-warning m-b m-t-lg" ng-click="addGroup()" translate>{{ 'group_form.add_a_group' }}</button>
<div class="m-t-lg m-b">
<button type="button" class="btn btn-warning" ng-click="addGroup()">
<i class="fa fa-plus m-r"></i>
<span translate>{{ 'group_form.add_a_group' }}</span>
</button>
<div class="form-group pull-right">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-filter"></i></span>
<select ng-model="groupFiltering" class="form-control">
<option ng-repeat="status in filterDisabled" value="{{status}}" translate>{{ 'group_form.status_'+status }}</option>
</select>
</div>
</div>
</div>
<table class="table">
<thead>
<tr>
<th style="width: 80%;" translate>{{ 'group_form.group_name' }}</th>
<th style="width: 20%"></th>
<th style="width: 75%;" translate>{{ 'group_form.group_name' }}</th>
<th style="width: 25%"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="group in groups">
<tr ng-repeat="group in groups | filterDisabled:groupFiltering" ng-class="{'disabled-line' : group.disabled && groupFiltering === 'all'}">
<td>
<span editable-text="group.name" e-cols="200" e-name="name" e-form="rowform" e-required>
{{group.name}}
@ -28,8 +42,8 @@
<i class="fa fa-edit"></i> <span class="hidden-xs hidden-sm" translate>{{ 'edit' }}</span>
</button>
<button class="btn btn-default" ng-click="toggleDisableGroup($index)">
<span ng-hide="group.disabled"><i class="fa fa-lock"></i> <span translate>{{ 'group_form.disable' }}</span></span>
<span ng-show="group.disabled"><i class="fa fa-unlock"></i> <span translate>{{ 'group_form.enable' }}</span></span>
<span ng-hide="group.disabled"><i class="fa fa-eye-slash"></i> <span translate>{{ 'group_form.disable' }}</span></span>
<span ng-show="group.disabled"><i class="fa fa-eye"></i> <span translate>{{ 'group_form.enable' }}</span></span>
</button>
<button class="btn btn-danger" ng-click="removeGroup($index)">
<i class="fa fa-trash-o"></i>

View File

@ -19,8 +19,8 @@
</select>
</div>
</div>
</div>
<table class="table">
<thead>
<tr>

View File

@ -430,6 +430,9 @@ en:
unable_to_delete_group_because_some_users_and_or_groups_are_still_linked_to_it: "Unable to delete group because some users and/or groups are still linked to it."
group_successfully_enabled_disabled: "Group successfully {STATUS, select, true{disabled} other{enabled}}." # messageFormat interpolation
unable_to_enable_disable_group: "Unable to {STATUS, select, true{disable} other{enable}} group." # messageFormat interpolation
status_enabled: "Enabled"
status_disabled: "Disabled"
status_all: "All"
members_new:
# add a member

View File

@ -430,6 +430,9 @@ fr:
unable_to_delete_group_because_some_users_and_or_groups_are_still_linked_to_it: "Le groupe n'a pas pu être supprimé car des utilisateurs et/ou des abonnements sont toujours associés à ce dernier."
group_successfully_enabled_disabled: "Le groupe a bien été {STATUS, select, true{désactivé} other{activé}}." # messageFormat interpolation
unable_to_enable_disable_group: "Impossible {STATUS, select, true{de désactiver} other{d'activer}} le groupe." # messageFormat interpolation
status_enabled: "Activés"
status_disabled: "Désactivés"
status_all: "Tous"
members_new:
# ajouter un membre

View File

@ -423,6 +423,22 @@ pt:
an_error_occurred_unable_to_delete_the_specified_provider: "Ocorreu um erro: não é possível excluir o provedor especificado."
local_database: "Database local"
o_auth2: "OAuth 2.0"
group_form:
add_a_group: "Adicionar grupo"
group_name: "Nome do grupo"
disable: "Desativar"
enable: "Habilitar"
changes_successfully_saved: "Mudanças salvas com sucesso."
an_error_occurred_while_saving_changes: "Um erro ocorreu ao salvar mudanças."
new_group_successfully_saved: "Novo grupo salvo com sucesso."
an_error_occurred_when_saving_the_new_group: "Um erro ocorreu ao salvar novo grupo."
group_successfully_deleted: "Grupo excluido com sucesso."
unable_to_delete_group_because_some_users_and_or_groups_are_still_linked_to_it: "Não é possível excluir o grupo porque alguns usuários e / ou grupos ainda estão vinculados a ele."
group_successfully_enabled_disabled: "Group successfully {STATUS, select, true{disabled} other{enabled}}." # messageFormat interpolation
unable_to_enable_disable_group: "Unable to {STATUS, select, true{disable} other{enable}} group." # messageFormat interpolation
status_enabled: "Ativos"
status_disabled: "Desabilitados"
status_all: "Todos"
members_new:
# add a member