1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

Feature: add a filter in members list (admin) to show only "not validated" members

This commit is contained in:
Nicolas Florentin 2023-08-30 11:56:24 +02:00
parent 0f7f32f256
commit fcfa4f018b
6 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,7 @@
## next deploy
- Fix a bug: for project categories, if there is no category : do not show categories panel in show view, do not show categories input field in edit view
- Feature: add a filter in members list (admin) to show only "not validated" members
## v6.0.13 2023 August 28

View File

@ -163,6 +163,8 @@ Application.Controllers.controller('AdminMembersController', ['$scope', '$sce',
// is user validation required
$scope.enableUserValidationRequired = (settingsPromise.user_validation_required === 'true');
if ($scope.enableUserValidationRequired) { $scope.member.memberFilters.push('not_validated'); }
// should we display the username in the list?
$scope.displayUsername = (settingsPromise.show_username_in_admin_list === 'true');

View File

@ -89,6 +89,7 @@ class User < ApplicationRecord
scope :with_subscription, -> { joins(statistic_profile: [:subscriptions]) }
scope :not_confirmed, -> { where(confirmed_at: nil) }
scope :inactive_for_3_years, -> { where('users.last_sign_in_at < ?', 3.years.ago) }
scope :not_validated, -> { where(validated_at: nil) }
def to_json(*)
ApplicationController.new.view_context.render(

View File

@ -35,7 +35,7 @@ class Members::ListService
'plans.base_name ILIKE :search', search: "%#{params[:search]}%")
end
filter = params[:filter].presence_in(%w[inactive_for_3_years not_confirmed]) || nil
filter = params[:filter].presence_in(%w[inactive_for_3_years not_confirmed not_validated]) || nil
@query = @query.send(filter) if filter
@query

View File

@ -1192,6 +1192,7 @@ en:
member_filter_all: "All"
member_filter_not_confirmed: "Unconfirmed"
member_filter_inactive_for_3_years: "Inactive for 3 years"
member_filter_not_validated: "Not validated"
#add a member
members_new:
add_a_member: "Add a member"

View File

@ -1192,6 +1192,7 @@ fr:
member_filter_all: "Tous"
member_filter_not_confirmed: "Non confirmés"
member_filter_inactive_for_3_years: "Inactifs depuis 3 ans"
member_filter_not_validated: "Non validés"
#add a member
members_new:
add_a_member: "Ajouter un membre"