diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-10-16 11:11:37 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-10-16 11:11:37 +0200 |
| commit | 3aed9159d6601aa4db9822ec7d7bc8efe877b99f (patch) | |
| tree | c89ac542125d16dd7f213027a77e92bb43fb31bc | |
| parent | 609e0bf8fa3dc7981da685163f4dde2f53572ecb (diff) | |
use message box instead of notification and ensure that buttons are readable, fixes #5945
Closes #5945
Merge request studip/studip!4546
| -rw-r--r-- | app/controllers/start.php | 32 | ||||
| -rw-r--r-- | app/views/start/index.php | 3 | ||||
| -rw-r--r-- | resources/assets/stylesheets/scss/system-notifications.scss | 2 |
3 files changed, 26 insertions, 11 deletions
diff --git a/app/controllers/start.php b/app/controllers/start.php index 550120f..0bd3ca9 100644 --- a/app/controllers/start.php +++ b/app/controllers/start.php @@ -98,30 +98,42 @@ class StartController extends AuthenticatedController )->asDialog(); } } - if ($GLOBALS['perm']->get_perm() == 'user') { - PageLayout::postInfo(_('Sie haben noch nicht auf Ihre Bestätigungsmail geantwortet.'), [ - _('Bitte holen Sie dies nach, um Stud.IP Funktionen wie das Belegen von Veranstaltungen nutzen zu können.'), - sprintf(_('Bei Problemen wenden Sie sich an: %s'), '<a href="mailto:'.$GLOBALS['UNI_CONTACT'].'">'.$GLOBALS['UNI_CONTACT'].'</a>') - ]); + + $this->messages = []; + + if (User::findCurrent()->perms == 'user') { + $this->messages[] = MessageBox::info( + _('Sie haben noch nicht auf Ihre Bestätigungsmail geantwortet.'), + [ + _('Bitte holen Sie dies nach, um Stud.IP Funktionen wie das Belegen von Veranstaltungen nutzen zu können.'), + sprintf(_('Bei Problemen wenden Sie sich an: %s'), '<a href="mailto:'.$GLOBALS['UNI_CONTACT'].'">'.$GLOBALS['UNI_CONTACT'].'</a>') + ] + ); $details = Studip\LinkButton::create( _('Bestätigungsmail erneut verschicken'), - $this->url_for('start/resend_validation_mail') + $this->resend_validation_mailURL() ); - if (!StudipAuthAbstract::CheckField('auth_user_md5.Email', $GLOBALS['user']->auth_plugin) && !LockRules::check($GLOBALS['user']->id, 'email')) { + if ( + !StudipAuthAbstract::CheckField('auth_user_md5.Email', User::findCurrent()->auth_plugin) + && !LockRules::check(User::findCurrent()->id, 'email') + ) { $details .= ' '; $details .= Studip\LinkButton::create( _('E-Mail-Adresse ändern'), - $this->url_for('start/edit_mail_address'), + $this->edit_mail_addressURL(), [ 'data-dialog' => 'size=auto', 'title' => _('E-Mail-Adresse') ] ); } - PageLayout::postInfo( - sprintf(_('Haben Sie die Bestätigungsmail an Ihre Adresse "%s" nicht erhalten?'), htmlReady($GLOBALS['user']->Email)), + $this->messages[] = MessageBox::info( + sprintf( + _('Haben Sie die Bestätigungsmail an Ihre Adresse "%s" nicht erhalten?'), + htmlReady(User::findCurrent()->email) + ), [$details] ); } diff --git a/app/views/start/index.php b/app/views/start/index.php index 6a177f6..7d6cb1a 100644 --- a/app/views/start/index.php +++ b/app/views/start/index.php @@ -2,6 +2,7 @@ /** * @var array $columns * @var Flexi\Template $widget_layout + * @var MessageBox[] $messages */ ?> <h1 class="sr-only"> @@ -16,6 +17,8 @@ <? endif ?> </h1> +<?= implode('', $messages) ?> + <?php // display a random banner if the module is enabled if (Config::get()->BANNER_ADS_ENABLE) { diff --git a/resources/assets/stylesheets/scss/system-notifications.scss b/resources/assets/stylesheets/scss/system-notifications.scss index b1fbed1..24a15a7 100644 --- a/resources/assets/stylesheets/scss/system-notifications.scss +++ b/resources/assets/stylesheets/scss/system-notifications.scss @@ -141,7 +141,7 @@ display: none; } - a:not(.system-notification-message) { + a:not(.system-notification-message,.button) { color: var(--color--white); text-decoration-line: underline; |
