From 8dfabec920716aa6b866891f78e80d658f10946d Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 11 Apr 2022 01:48:01 +0200 Subject: [PATCH] Move registration button above login form, remove angeltype button from login page --- resources/views/pages/login.twig | 44 +++++++++++------------------- src/Controllers/AuthController.php | 2 +- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/resources/views/pages/login.twig b/resources/views/pages/login.twig index a96b41ad..2a6441c2 100644 --- a/resources/views/pages/login.twig +++ b/resources/views/pages/login.twig @@ -28,6 +28,22 @@ {% endfor %} +
+
+

{{ __('Register') }}

+ {% if has_permission_to('register') and config('registration_enabled') %} + {% if config('enable_password') %} +

{{ __('Please sign up, if you want to help us!') }}

+ {{ __('Register') }} » + {% else %} +

{{ __('Registration is only available via external login.') }}

+ {% endif %} + {% else %} + {{ m.alert(__('Registration is disabled.'), 'danger') }} + {% endif %} +
+
+
@@ -95,33 +111,5 @@
- -
-
-

{{ __('Register') }}

- {% if has_permission_to('register') and config('registration_enabled') %} - {% if config('enable_password') %} -

{{ __('Please sign up, if you want to help us!') }}

- {{ __('Register') }} » - {% else %} -

{{ __('Registration is only available via external login.') }}

- {% endif %} - {% else %} - {{ m.alert(__('Registration is disabled.'), 'danger') }} - {% endif %} -
- -
-

{{ __('What can I do?') }}

-

{{ __('Please read about the jobs you can do to help us.') }}

- - {{ __('Teams/Job description') }} » - -
- - -
{% endblock %} diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index 860d5679..0ac82841 100644 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -62,7 +62,7 @@ class AuthController extends BaseController */ public function login(): Response { - return $this->showLogin(); + return !$this->auth->user() ? $this->showLogin() : $this->redirect->to($this->config->get('home_site')); } /**