Merge pull request #52 from Gusted/close-register-page

Hide register page when registrations are closed
This commit is contained in:
Aravinth Manivannan 2022-11-07 13:39:34 +05:30 committed by GitHub
commit c1f6ce3ae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View file

@ -8,6 +8,16 @@
class="auth__logo" alt="mcaptcha logo" />
<. if !crate::SETTINGS.allow_registration { .>
<table class="reg-closed__table">
<thead class="reg-closed__table-heading">
<tr><th colspan="4" class="reg-closed__table-title-text">Registration closed</th></tr>
</thead>
<tbody class="reg-closed__body">
<tr><td class="reg-closed__body-text">This mCaptcha instance is closed for registrations.</td></tr>
</tbody>
</table>
<. } else {.>
<form
method="POST"
action="<.= crate::V1_API_ROUTES.auth.register .>"
@ -73,5 +83,6 @@
<a href="<.= crate::PAGES.auth.login .>" class="auth__secondary-action__link">Log in</a>
</p>
<. include!("../demo-user-banner.html"); .>
<. } .>
</div>
<. include!("../../components/footers.html"); .>

View file

@ -0,0 +1,32 @@
/*
* Copyright (C) 2022 Gusted <postmaster@gusted.xyz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
@import '../../components/table/main';
.reg-closed__table {
@include table;
margin: auto;
}
.reg-closed__table-title-text {
@include table__title-text;
}
.reg-closed__body-text {
display: block;
margin: 0.5em 0;
}