diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2025-10-20 15:31:57 +0200 |
|---|---|---|
| committer | Rasmus Fuhse <fuhse@data-quest.de> | 2025-10-20 13:31:57 +0000 |
| commit | 93d6f8ea1adef72ddfe46e7508031938d172249a (patch) | |
| tree | 4508c11c16bdb86da9f151925b1786e1b331d32f /app | |
| parent | aa7e597f94d34d352551e6963014f9a26e3e03a0 (diff) | |
Resolve "Vue-Komponenten UserAvatar und UserAvatarDropdown als globale Komponenten registrieren"
Closes #5924
Merge request studip/studip!4526
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/admin/user/_results.php | 11 | ||||
| -rw-r--r-- | app/views/contact/index.php | 2 | ||||
| -rw-r--r-- | app/views/course/wiki/allpages.php | 7 | ||||
| -rw-r--r-- | app/views/course/wiki/newpages.php | 7 | ||||
| -rw-r--r-- | app/views/score/index.php | 122 |
5 files changed, 73 insertions, 76 deletions
diff --git a/app/views/admin/user/_results.php b/app/views/admin/user/_results.php index 3ea545b..5f0a47f 100644 --- a/app/views/admin/user/_results.php +++ b/app/views/admin/user/_results.php @@ -10,7 +10,7 @@ <form action="<?= $controller->link_for('admin/user/bulk') ?>" method="post" data-dialog="size=auto" class="default"> <?= CSRFProtection::tokenTag() ?> - <table class="default sortable-table" data-sortlist="[[0, 0]]"> + <table class="default users-table sortable-table" data-sortlist="[[0, 0]]"> <caption> <?= sprintf(_('Suchergebnis: es wurden %s Personen gefunden'), count($users)) ?> </caption> @@ -52,11 +52,10 @@ <? foreach ($users as $user) : ?> <tr> <td style="white-space:nowrap;"> - <input class="check_all" type="checkbox" name="user_ids[]" value="<?= htmlReady($user->id) ?>"> - <a href="<?= $controller->link_for("admin/user/edit/{$user->id}") ?>" - title="<?= _('Nutzer bearbeiten') ?>"> - <?= Avatar::getAvatar($user->id)->getImageTag(Avatar::SMALL) ?> - </a> + <div class="users-table__avatar-container"> + <input class="check_all" type="checkbox" name="user_ids[]" value="<?= htmlReady($user->id) ?>"> + <?= $user->getAvatarDropdownHTML() ?> + </div> </td> <td> <a href="<?= $controller->link_for("admin/user/edit/{$user->id}") ?>" diff --git a/app/views/contact/index.php b/app/views/contact/index.php index 0bcdcd3..bbb28a9 100644 --- a/app/views/contact/index.php +++ b/app/views/contact/index.php @@ -54,7 +54,7 @@ <? if (isset($flash['contacts']) && in_array($contact->id, $flash['contacts'])) echo 'checked'; ?>> </td> <td> - <?= ObjectdisplayHelper::avatarlink($contact) ?> + <?= $contact->getAvatarDropdownHTML(true) ?> </td> <td class="hidden-small-down"> <a data-dialog="button" diff --git a/app/views/course/wiki/allpages.php b/app/views/course/wiki/allpages.php index e60feee..c1402cc 100644 --- a/app/views/course/wiki/allpages.php +++ b/app/views/course/wiki/allpages.php @@ -55,8 +55,11 @@ <?= $page->chdate > 0 ? date('d.m.Y H:i:s', $page->chdate) : _('unbekannt') ?> </td> <td data-text="<?= htmlReady($page->user ? $page->user->getFullName() : _('unbekannt')) ?>"> - <?= Avatar::getAvatar($page->user_id)->getImageTag(Avatar::SMALL) ?> - <?= htmlReady($page->user ? $page->user->getFullName() : _('unbekannt')) ?> + <? if ($page->user): ?> + <?= $page->user->getAvatarDropdownHTML(true) ?> + <? else: ?> + <?= _('unbekannt') ?> + <? endif; ?> </td> <td class="actions"> <?= $controller->getActionMenu($page, 'allpages') ?> diff --git a/app/views/course/wiki/newpages.php b/app/views/course/wiki/newpages.php index 838eef9..7b22683 100644 --- a/app/views/course/wiki/newpages.php +++ b/app/views/course/wiki/newpages.php @@ -93,12 +93,7 @@ <? foreach ($authors as $user_id => $user) : ?> <li> <? if ($user): ?> - <a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => $user->username]) ?>" - class="with_avatar" - style="background-image: url(<?= Avatar::getAvatar($user->id)->getURL(Avatar::SMALL) ?>)" - > - <?= htmlReady($user->getFullName()) ?> - </a> + <?= $user->getAvatarDropdownHTML(true) ?> <? else: ?> <?= _('unbekannt') ?> <? endif; ?> diff --git a/app/views/score/index.php b/app/views/score/index.php index b11a86a..a5901ef 100644 --- a/app/views/score/index.php +++ b/app/views/score/index.php @@ -29,15 +29,15 @@ <col class="hidden-small-down" width="1%"> </colgroup> <thead> - <tr> - <th><div class="hidden-small-down"><?= _('Platz') ?></div></th> - <th></th> - <th><?= _('Name') ?></th> - <th class="hidden-small-down"></th> - <th><?= _('Punkte') ?></th> - <th class="hidden-small-down"><?= _('Titel') ?></th> - <th class="hidden-small-down"></th> - </tr> + <tr> + <th><div class="hidden-small-down"><?= _('Platz') ?></div></th> + <th></th> + <th><?= _('Name') ?></th> + <th class="hidden-small-down"></th> + <th><?= _('Punkte') ?></th> + <th class="hidden-small-down"><?= _('Titel') ?></th> + <th class="hidden-small-down"></th> + </tr> </thead> <tbody> <? foreach ($persons as $index => $person): ?> @@ -54,71 +54,71 @@ <a href="<?= URLHelper::getLink('dispatch.php/profile?username='. $person['username']) ?>"> <?= htmlReady($person['fullname']) ?> </a> - <? foreach ($person['is_king'] as $type => $text): ?> - <?= Icon::create('crown', Icon::ROLE_SORT)->asSvg(['title' => $text, 'alt' => $text, 'class' => 'text-top']) ?> - <? endforeach ?> + <? foreach ($person['is_king'] as $type => $text): ?> + <?= Icon::create('crown', Icon::ROLE_SORT)->asSvg(['title' => $text, 'alt' => $text, 'class' => 'text-top']) ?> + <? endforeach ?> </td> <td class="hidden-small-down"> - <? - $content = Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; + <? + $content = Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; - // News - if (!empty($person['newscount'])) { - $tmp = sprintf(ngettext('Eine persönliche Ankündigung', '%s persönliche Ankündigungen', $person['newscount']), $person['newscount']); - $content .= sprintf( - '<a href="%s">%s</a> ', - URLHelper::getLink('dispatch.php/profile?username=' . $person['username']), - Icon::create('news', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asSvg() - ); - } else { - $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; - } + // News + if (!empty($person['newscount'])) { + $tmp = sprintf(ngettext('Eine persönliche Ankündigung', '%s persönliche Ankündigungen', $person['newscount']), $person['newscount']); + $content .= sprintf( + '<a href="%s">%s</a> ', + URLHelper::getLink('dispatch.php/profile?username=' . $person['username']), + Icon::create('news', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asSvg() + ); + } else { + $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; + } - // Votes - if (!empty($person['votecount'])) { - $tmp = sprintf(ngettext('Eine Umfrage', '%s Umfragen', $person['votecount']), $person['votecount']); - $content .= sprintf( - '<a href="%s">%s</a> ', - URLHelper::getLink('dispatch.php/profile?username=' . $person['username'] . '#questionnaire_area'), - Icon::create('vote', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asSvg() - ); - } else { - $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; - } + // Votes + if (!empty($person['votecount'])) { + $tmp = sprintf(ngettext('Eine Umfrage', '%s Umfragen', $person['votecount']), $person['votecount']); + $content .= sprintf( + '<a href="%s">%s</a> ', + URLHelper::getLink('dispatch.php/profile?username=' . $person['username'] . '#questionnaire_area'), + Icon::create('vote', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asSvg() + ); + } else { + $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; + } - // Termine - if (!empty($person['eventcount'])) { - $tmp = sprintf(ngettext('Ein Termin', '%s Termine', $person['eventcount']), $person['eventcount']); - $content .= sprintf( - '<a href="%s">%s</a> ', - URLHelper::getLink('dispatch.php/profile?username=' . $person['username'] . '#a'), - Icon::create('schedule', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asSvg() - ); - } else { - $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; - } + // Termine + if (!empty($person['eventcount'])) { + $tmp = sprintf(ngettext('Ein Termin', '%s Termine', $person['eventcount']), $person['eventcount']); + $content .= sprintf( + '<a href="%s">%s</a> ', + URLHelper::getLink('dispatch.php/profile?username=' . $person['username'] . '#a'), + Icon::create('schedule', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asSvg() + ); + } else { + $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; + } - $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; + $content .= Assets::img('blank.gif', ['width' => Icon::SIZE_DEFAULT]) . ' '; - echo $content; - ?> + echo $content; + ?> </td> <td><?= number_format($person['score'], 0, ',', '.') ?></td> <td class="hidden-small-down" ><?= Score::getTitel($person['score'], $person['geschlecht']) ?></td> <td class="hidden-small-down" style="text-align: right"> - <? if($person['user_id'] == $GLOBALS['user']->id): ?> - <a href="<?= $controller->url_for('score/unpublish') ?>"> - <?= Icon::create('trash', Icon::ROLE_CLICKABLE, ['title' => _('Ihren Wert von der Liste löschen')]) - ->asSvg(['class' => 'text-top']) - ?> - </a> - <? endif; ?> + <? if($person['user_id'] == $GLOBALS['user']->id): ?> + <a href="<?= $controller->url_for('score/unpublish') ?>"> + <?= Icon::create('trash', Icon::ROLE_CLICKABLE, ['title' => _('Ihren Wert von der Liste löschen')]) + ->asSvg(['class' => 'text-top']) + ?> + </a> + <? endif; ?> </td> </tr> <? endforeach ?> </tbody> -<? if (ceil($numberOfPersons / $max_per_page) > 1): ?> - <tfoot> + <? if (ceil($numberOfPersons / $max_per_page) > 1): ?> + <tfoot> <tr> <td colspan="7" style="text-align: right"> <?= $GLOBALS['template_factory']->render('shared/pagechooser', @@ -131,6 +131,6 @@ ) ?> </td> </tr> - </tfoot> -<? endif ?> + </tfoot> + <? endif ?> </table> |
