* Change: #621 登録時間帯制限で、制限時間中は登録を禁止ではなく承認制にする * 管理画面のUIを改善 * Fix test * Fix lint
This commit is contained in:
parent
4119b8713e
commit
941705be62
13 changed files with 52 additions and 33 deletions
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationHelper
|
||||
include RegistrationLimitationHelper
|
||||
|
||||
DANGEROUS_SCOPES = %w(
|
||||
read
|
||||
write
|
||||
|
@ -37,11 +39,11 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def open_registrations?
|
||||
Setting.registrations_mode == 'open'
|
||||
Setting.registrations_mode == 'open' && registrations_in_time?
|
||||
end
|
||||
|
||||
def approved_registrations?
|
||||
Setting.registrations_mode == 'approved'
|
||||
Setting.registrations_mode == 'approved' || (Setting.registrations_mode == 'open' && !registrations_in_time?)
|
||||
end
|
||||
|
||||
def closed_registrations?
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
module RegistrationLimitationHelper
|
||||
def reach_registrations_limit?
|
||||
return true unless registrations_in_time?
|
||||
|
||||
((Setting.registrations_limit.presence || 0).positive? && Setting.registrations_limit <= user_count_for_registration) ||
|
||||
((Setting.registrations_limit_per_day.presence || 0).positive? && Setting.registrations_limit_per_day <= today_increase_user_count)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue