Setting registrations remaining

merge-requests/30/head
Bob Mottram 2022-12-05 20:19:19 +00:00
parent 210400a38b
commit 2d5047c125
28 changed files with 75 additions and 26 deletions

View File

@ -6382,6 +6382,19 @@ class PubServer(BaseHTTPRequestHandler):
'closed') 'closed')
self.server.registration = False self.server.registration = False
# change registrations remaining
reg_str = "registrationsRemaining"
remaining = get_config_param(base_dir, reg_str)
if fields.get('regRemaining'):
if fields['regRemaining'] != remaining:
remaining = fields['regRemaining']
if remaining < 0:
remaining = 0
elif remaining > 10:
remaining = 10
set_config_param(base_dir, reg_str,
remaining)
# libretranslate URL # libretranslate URL
curr_libretranslate_url = \ curr_libretranslate_url = \
get_config_param(base_dir, get_config_param(base_dir,

View File

@ -606,5 +606,6 @@
"Moved": "انتقل", "Moved": "انتقل",
"Move": "يتحرك", "Move": "يتحرك",
"Inactive": "غير نشط", "Inactive": "غير نشط",
"Registrations open": "التسجيلات مفتوحة" "Registrations open": "التسجيلات مفتوحة",
"Registrations remaining": "التسجيلات المتبقية"
} }

View File

@ -606,5 +606,6 @@
"Moved": "সরানো হয়েছে", "Moved": "সরানো হয়েছে",
"Move": "সরান", "Move": "সরান",
"Inactive": "নিষ্ক্রিয়", "Inactive": "নিষ্ক্রিয়",
"Registrations open": "রেজিস্ট্রেশন খোলা" "Registrations open": "রেজিস্ট্রেশন খোলা",
"Registrations remaining": "রেজিস্ট্রেশন বাকি"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Mogut", "Moved": "Mogut",
"Move": "Moure's", "Move": "Moure's",
"Inactive": "Inactiu", "Inactive": "Inactiu",
"Registrations open": "Inscripcions obertes" "Registrations open": "Inscripcions obertes",
"Registrations remaining": "Inscripcions restants"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Wedi symud", "Moved": "Wedi symud",
"Move": "Symud", "Move": "Symud",
"Inactive": "Anactif", "Inactive": "Anactif",
"Registrations open": "Cofrestriadau yn agor" "Registrations open": "Cofrestriadau yn agor",
"Registrations remaining": "Cofrestriadau ar ôl"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Gerührt", "Moved": "Gerührt",
"Move": "Bewegen", "Move": "Bewegen",
"Inactive": "Inaktiv", "Inactive": "Inaktiv",
"Registrations open": "Anmeldungen geöffnet" "Registrations open": "Anmeldungen geöffnet",
"Registrations remaining": "Anmeldungen verbleiben"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Μετακινήθηκε", "Moved": "Μετακινήθηκε",
"Move": "Κίνηση", "Move": "Κίνηση",
"Inactive": "Αδρανής", "Inactive": "Αδρανής",
"Registrations open": "Οι εγγραφές ανοίγουν" "Registrations open": "Οι εγγραφές ανοίγουν",
"Registrations remaining": "Απομένουν οι εγγραφές"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Moved", "Moved": "Moved",
"Move": "Move", "Move": "Move",
"Inactive": "Inactive", "Inactive": "Inactive",
"Registrations open": "Registrations open" "Registrations open": "Registrations open",
"Registrations remaining": "Registrations remaining"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Movida", "Moved": "Movida",
"Move": "Muevete", "Move": "Muevete",
"Inactive": "Αδρανής", "Inactive": "Αδρανής",
"Registrations open": "Inscripciones abiertas" "Registrations open": "Inscripciones abiertas",
"Registrations remaining": "Registros restantes"
} }

View File

@ -606,5 +606,6 @@
"Moved": "منتقل شد", "Moved": "منتقل شد",
"Move": "حرکت", "Move": "حرکت",
"Inactive": "غیر فعال", "Inactive": "غیر فعال",
"Registrations open": "ثبت نام ها باز شد" "Registrations open": "ثبت نام ها باز شد",
"Registrations remaining": "ثبت نام باقی مانده است"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Déplacée", "Moved": "Déplacée",
"Move": "Déplacer", "Move": "Déplacer",
"Inactive": "Inactive", "Inactive": "Inactive",
"Registrations open": "Inscriptions ouvertes" "Registrations open": "Inscriptions ouvertes",
"Registrations remaining": "Inscriptions restantes"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Ar athraíodh a ionad", "Moved": "Ar athraíodh a ionad",
"Move": "Bog", "Move": "Bog",
"Inactive": "Neamhghníomhach", "Inactive": "Neamhghníomhach",
"Registrations open": "Clárúcháin oscailte" "Registrations open": "Clárúcháin oscailte",
"Registrations remaining": "Clárúcháin fágtha"
} }

View File

@ -606,5 +606,6 @@
"Moved": "ले जाया गया", "Moved": "ले जाया गया",
"Move": "कदम", "Move": "कदम",
"Inactive": "निष्क्रिय", "Inactive": "निष्क्रिय",
"Registrations open": "पंजीकरण खुले हैं" "Registrations open": "पंजीकरण खुले हैं",
"Registrations remaining": "रजिस्ट्रेशन बाकी हैं"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Mosso", "Moved": "Mosso",
"Move": "Spostare", "Move": "Spostare",
"Inactive": "Non attivo", "Inactive": "Non attivo",
"Registrations open": "Aperte le iscrizioni" "Registrations open": "Aperte le iscrizioni",
"Registrations remaining": "Iscrizioni rimanenti"
} }

View File

@ -606,5 +606,6 @@
"Moved": "移動しました", "Moved": "移動しました",
"Move": "動く", "Move": "動く",
"Inactive": "非活性", "Inactive": "非活性",
"Registrations open": "登録開始" "Registrations open": "登録開始",
"Registrations remaining": "残りの登録数"
} }

View File

@ -606,5 +606,6 @@
"Moved": "움직이는", "Moved": "움직이는",
"Move": "이동하다", "Move": "이동하다",
"Inactive": "비활성", "Inactive": "비활성",
"Registrations open": "등록 시작" "Registrations open": "등록 시작",
"Registrations remaining": "남은 등록"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Moved", "Moved": "Moved",
"Move": "Barkirin", "Move": "Barkirin",
"Inactive": "Bêkar", "Inactive": "Bêkar",
"Registrations open": "Qeydkirin vedibin" "Registrations open": "Qeydkirin vedibin",
"Registrations remaining": "Registrations maye"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Verhuisd", "Moved": "Verhuisd",
"Move": "Beweging", "Move": "Beweging",
"Inactive": "Inactief", "Inactive": "Inactief",
"Registrations open": "Inschrijvingen geopend" "Registrations open": "Inschrijvingen geopend",
"Registrations remaining": "Resterende inschrijvingen"
} }

View File

@ -602,5 +602,6 @@
"Moved": "Moved", "Moved": "Moved",
"Move": "Move", "Move": "Move",
"Inactive": "Inactive", "Inactive": "Inactive",
"Registrations open": "Registrations open" "Registrations open": "Registrations open",
"Registrations remaining": "Registrations remaining"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Przeniósł", "Moved": "Przeniósł",
"Move": "Przenosić", "Move": "Przenosić",
"Inactive": "Nieaktywny", "Inactive": "Nieaktywny",
"Registrations open": "Rejestracje otwarte" "Registrations open": "Rejestracje otwarte",
"Registrations remaining": "Pozostały zapisy"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Mudou-se", "Moved": "Mudou-se",
"Move": "Jogada", "Move": "Jogada",
"Inactive": "Inativa", "Inactive": "Inativa",
"Registrations open": "inscrições abertas" "Registrations open": "inscrições abertas",
"Registrations remaining": "Inscrições restantes"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Взолнованный", "Moved": "Взолнованный",
"Move": "Шаг", "Move": "Шаг",
"Inactive": "Неактивный", "Inactive": "Неактивный",
"Registrations open": "Регистрация открыта" "Registrations open": "Регистрация открыта",
"Registrations remaining": "Осталось регистраций"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Imehamishwa", "Moved": "Imehamishwa",
"Move": "Sogeza", "Move": "Sogeza",
"Inactive": "Isiyotumika", "Inactive": "Isiyotumika",
"Registrations open": "Usajili umefunguliwa" "Registrations open": "Usajili umefunguliwa",
"Registrations remaining": "Usajili uliosalia"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Etkilenmiş", "Moved": "Etkilenmiş",
"Move": "Hareket", "Move": "Hareket",
"Inactive": "etkin değil", "Inactive": "etkin değil",
"Registrations open": "kayıtlar açık" "Registrations open": "kayıtlar açık",
"Registrations remaining": "kalan kayıtlar"
} }

View File

@ -606,5 +606,6 @@
"Moved": "Переїхав", "Moved": "Переїхав",
"Move": "рухатися", "Move": "рухатися",
"Inactive": "Неактивний", "Inactive": "Неактивний",
"Registrations open": "Реєстрація відкрита" "Registrations open": "Реєстрація відкрита",
"Registrations remaining": "Залишилось реєстрацій"
} }

View File

@ -606,5 +606,6 @@
"Moved": "אריבערגעפארן", "Moved": "אריבערגעפארן",
"Move": "מאַך", "Move": "מאַך",
"Inactive": "ינאַקטיוו", "Inactive": "ינאַקטיוו",
"Registrations open": "רעדזשיסטריישאַנז עפענען" "Registrations open": "רעדזשיסטריישאַנז עפענען",
"Registrations remaining": "רעדזשיסטריישאַנז רוען"
} }

View File

@ -606,5 +606,6 @@
"Moved": "אריבערגעפארן", "Moved": "אריבערגעפארן",
"Move": "移动", "Move": "移动",
"Inactive": "无效", "Inactive": "无效",
"Registrations open": "注册开放" "Registrations open": "注册开放",
"Registrations remaining": "剩余名额"
} }

View File

@ -1572,6 +1572,16 @@ def _html_edit_profile_instance(base_dir: str, translate: {},
instance_str += \ instance_str += \
edit_check_box(translate['Registrations open'], edit_check_box(translate['Registrations open'],
'regOpen', registrations_open) 'regOpen', registrations_open)
if registrations_open:
remaining_config_exists = \
get_config_param(base_dir, 'registrationsRemaining')
registrations_remaining = 0
if remaining_config_exists is not None:
registrations_remaining = int(remaining_config_exists)
instance_str += \
edit_number_field(translate['Registrations remaining'],
'regRemaining',
registrations_remaining, 0, 10, 10)
instance_str += \ instance_str += \
' <label class="labels">\n' + \ ' <label class="labels">\n' + \
translate['Security'] + '</label><br>\n' translate['Security'] + '</label><br>\n'