Skip to content
Snippets Groups Projects
Commit dccfbe7b authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

fixes #3528

Closes #3528

Merge request studip/studip!2417
parent 9f501da3
No related branches found
No related tags found
No related merge requests found
...@@ -39,101 +39,105 @@ ...@@ -39,101 +39,105 @@
</fieldset> </fieldset>
<? if (count($teachers) > 1): ?> <? if (count($teachers) > 1): ?>
<fieldset class="studip-selection <?= $metadata_locked ? 'disabled' : ''?>" data-attribute-name="assigned_teachers"> <fieldset>
<legend><?= _('Durchführende Lehrende') ?></legend> <legend><?= _('Durchführende Lehrende') ?></legend>
<section class="studip-selection-selected"> <div class="studip-selection <?= $metadata_locked ? 'disabled' : ''?>" data-attribute-name="assigned_teachers">
<h2><?= _('Zugewiesene Lehrende') ?></h2> <section class="studip-selection-selected">
<h2><?= _('Zugewiesene Lehrende') ?></h2>
<ul>
<? foreach ($assigned_teachers as $teacher): ?> <ul>
<li data-selection-id="<?= htmlReady($teacher->user_id) ?>"> <? foreach ($assigned_teachers as $teacher): ?>
<input type="hidden" name="assigned_teachers[]" <li data-selection-id="<?= htmlReady($teacher->user_id) ?>">
value="<?= htmlReady($teacher->user_id) ?>"> <input type="hidden" name="assigned_teachers[]"
value="<?= htmlReady($teacher->user_id) ?>">
<span class="studip-selection-image">
<?= Avatar::getAvatar($teacher->user_id)->getImageTag(Avatar::SMALL) ?> <span class="studip-selection-image">
</span> <?= Avatar::getAvatar($teacher->user_id)->getImageTag(Avatar::SMALL) ?>
<span class="studip-selection-label"> </span>
<?= htmlReady($teacher->getFullname()) ?> <span class="studip-selection-label">
</span> <?= htmlReady($teacher->getFullname()) ?>
</li> </span>
</li>
<? endforeach; ?>
<li class="empty-placeholder">
<?= _('Kein spezieller Lehrender zugewiesen') ?>
</li>
</ul>
</section>
<section class="studip-selection-selectable">
<h2><?= _('Lehrende der Veranstaltung') ?></h2>
<ul>
<? foreach ($teachers as $teacher): ?>
<? if (!$assigned_teachers->find($teacher->user_id)): ?>
<li data-selection-id="<?= htmlReady($teacher->id) ?>" >
<span class="studip-selection-image">
<?= Avatar::getAvatar($teacher->id)->getImageTag(Avatar::SMALL) ?>
</span>
<span class="studip-selection-label">
<?= htmlReady($teacher->getFullname()) ?>
</span>
</li>
<? endif; ?>
<? endforeach; ?> <? endforeach; ?>
<li class="empty-placeholder"> <li class="empty-placeholder">
<?= _('Kein spezieller Lehrender zugewiesen') ?> <?= sprintf(
</li> _('Ihre Auswahl entspricht dem Zustand "%s" und wird beim Speichern zurückgesetzt'),
</ul> _('Kein spezieller Lehrender zugewiesen')
</section> ) ?>
</li>
<section class="studip-selection-selectable"> </ul>
<h2><?= _('Lehrende der Veranstaltung') ?></h2> </section>
</div>
<ul>
<? foreach ($teachers as $teacher): ?>
<? if (!$assigned_teachers->find($teacher->user_id)): ?>
<li data-selection-id="<?= htmlReady($teacher->id) ?>" >
<span class="studip-selection-image">
<?= Avatar::getAvatar($teacher->id)->getImageTag(Avatar::SMALL) ?>
</span>
<span class="studip-selection-label">
<?= htmlReady($teacher->getFullname()) ?>
</span>
</li>
<? endif; ?>
<? endforeach; ?>
<li class="empty-placeholder">
<?= sprintf(
_('Ihre Auswahl entspricht dem Zustand "%s" und wird beim Speichern zurückgesetzt'),
_('Kein spezieller Lehrender zugewiesen')
) ?>
</li>
</ul>
</section>
</fieldset> </fieldset>
<? endif; ?> <? endif; ?>
<? if (count($groups) > 0): ?> <? if (count($groups) > 0): ?>
<fieldset class="studip-selection <?= $metadata_locked ? 'disabled' : ''?>" data-attribute-name="assigned_groups"> <fieldset>
<legend><?= _('Beteiligte Gruppen') ?></legend> <legend><?= _('Beteiligte Gruppen') ?></legend>
<section class="studip-selection-selected"> <div class="studip-selection <?= $metadata_locked ? 'disabled' : ''?>" data-attribute-name="assigned_groups">
<h2><?= _('Zugewiesene Gruppen') ?></h2> <section class="studip-selection-selected">
<h2><?= _('Zugewiesene Gruppen') ?></h2>
<ul>
<? foreach ($assigned_groups as $group) : ?> <ul>
<li data-selection-id="<?= htmlReady($group->id) ?>"> <? foreach ($assigned_groups as $group) : ?>
<input type="hidden" name="assigned_groups[]" <li data-selection-id="<?= htmlReady($group->id) ?>">
value="<?= htmlReady($group->id) ?>"> <input type="hidden" name="assigned_groups[]"
value="<?= htmlReady($group->id) ?>">
<span class="studip-selection-label">
<?= htmlReady($group->name) ?> <span class="studip-selection-label">
</span> <?= htmlReady($group->name) ?>
</li> </span>
<? endforeach ?> </li>
<li class="empty-placeholder"> <? endforeach ?>
<?= _('Keine spezielle Gruppe zugewiesen') ?> <li class="empty-placeholder">
</li> <?= _('Keine spezielle Gruppe zugewiesen') ?>
</ul> </li>
</section> </ul>
</section>
<section class="studip-selection-selectable">
<h2><?= _('Gruppen der Veranstaltung') ?></h2> <section class="studip-selection-selectable">
<h2><?= _('Gruppen der Veranstaltung') ?></h2>
<ul>
<? foreach ($groups as $group): ?> <ul>
<? if (!$assigned_groups->find($group->id)): ?> <? foreach ($groups as $group): ?>
<li data-selection-id="<?= htmlReady($group->id) ?>" > <? if (!$assigned_groups->find($group->id)): ?>
<span class="studip-selection-label"> <li data-selection-id="<?= htmlReady($group->id) ?>" >
<?= htmlReady($group->name) ?> <span class="studip-selection-label">
</span> <?= htmlReady($group->name) ?>
</li> </span>
<? endif; ?> </li>
<? endforeach; ?> <? endif; ?>
<li class="empty-placeholder"> <? endforeach; ?>
<?= _('Alle Gruppen wurden dem Termin zugewiesen') ?> <li class="empty-placeholder">
</li> <?= _('Alle Gruppen wurden dem Termin zugewiesen') ?>
</ul> </li>
</section> </ul>
</section>
</div>
</fieldset> </fieldset>
<? endif; ?> <? endif; ?>
......
...@@ -114,96 +114,101 @@ ...@@ -114,96 +114,101 @@
</fieldset> </fieldset>
<? if (count($teachers) > 1): ?> <? if (count($teachers) > 1): ?>
<fieldset class="collapsed studip-selection" data-attribute-name="assigned_teachers"> <fieldset class="collapsed">
<legend><?= _('Durchführende Lehrende') ?></legend> <legend><?= _('Durchführende Lehrende') ?></legend>
<section class="studip-selection-selected"> <div class="studip-selection" data-attribute-name="assigned_teachers">
<p><strong><?= _('Zugewiesene Lehrende') ?></strong></p> <section class="studip-selection-selected">
<ul> <p><strong><?= _('Zugewiesene Lehrende') ?></strong></p>
<? foreach ($assigned_teachers as $teacher): ?> <ul>
<li data-selection-id="<?= htmlReady($teacher->user_id) ?>"> <? foreach ($assigned_teachers as $teacher): ?>
<input type="hidden" name="assigned_teachers[]" <li data-selection-id="<?= htmlReady($teacher->user_id) ?>">
value="<?= htmlReady($teacher->user_id) ?>"> <input type="hidden" name="assigned_teachers[]"
value="<?= htmlReady($teacher->user_id) ?>">
<span class="studip-selection-image">
<?= Avatar::getAvatar($teacher->user_id)->getImageTag(Avatar::SMALL) ?>
</span>
<span class="studip-selection-label">
<?= htmlReady($teacher->getFullname()) ?>
</span>
</li>
<? endforeach ?>
<li class="empty-placeholder">
<?= _('Kein spezieller Lehrender zugewiesen') ?>
</li>
</ul>
</section>
<section class="studip-selection-selectable">
<p><strong><?= _('Lehrende der Veranstaltung') ?></strong></p>
<ul>
<? foreach ($teachers as $teacher): ?>
<? if (!$assigned_teachers->find($teacher->user_id)): ?>
<li data-selection-id="<?= htmlReady($teacher->user_id) ?>" >
<span class="studip-selection-image"> <span class="studip-selection-image">
<?= Avatar::getAvatar($teacher->user_id)->getImageTag(Avatar::SMALL) ?> <?= Avatar::getAvatar($teacher->user_id)->getImageTag(Avatar::SMALL) ?>
</span> </span>
<span class="studip-selection-label"> <span class="studip-selection-label">
<?= htmlReady($teacher->getUserFullname()) ?> <?= htmlReady($teacher->getFullname()) ?>
</span> </span>
</li> </li>
<? endif ?> <? endforeach ?>
<? endforeach ?> <li class="empty-placeholder">
<li class="empty-placeholder"> <?= _('Kein spezieller Lehrender zugewiesen') ?>
<?= sprintf( </li>
_('Ihre Auswahl entspricht dem Zustand "%s" und wird beim Speichern zurückgesetzt'), </ul>
_('Kein spezieller Lehrender zugewiesen') </section>
) ?>
</li> <section class="studip-selection-selectable">
</ul> <p><strong><?= _('Lehrende der Veranstaltung') ?></strong></p>
</section> <ul>
<? foreach ($teachers as $teacher): ?>
<? if (!$assigned_teachers->find($teacher->user_id)): ?>
<li data-selection-id="<?= htmlReady($teacher->user_id) ?>" >
<span class="studip-selection-image">
<?= Avatar::getAvatar($teacher->user_id)->getImageTag(Avatar::SMALL) ?>
</span>
<span class="studip-selection-label">
<?= htmlReady($teacher->getUserFullname()) ?>
</span>
</li>
<? endif ?>
<? endforeach ?>
<li class="empty-placeholder">
<?= sprintf(
_('Ihre Auswahl entspricht dem Zustand "%s" und wird beim Speichern zurückgesetzt'),
_('Kein spezieller Lehrender zugewiesen')
) ?>
</li>
</ul>
</section>
</div>
</fieldset> </fieldset>
<? endif ?> <? endif ?>
<? if (count($groups) > 0): ?> <? if (count($groups) > 0): ?>
<fieldset class="collapsed studip-selection" data-attribute-name="assigned_groups"> <fieldset class="collapsed">
<legend><?= _('Beteiligte Gruppen') ?></legend> <legend><?= _('Beteiligte Gruppen') ?></legend>
<section class="studip-selection-selected">
<p><strong><?= _('Zugewiesene Gruppen') ?></strong></p>
<ul>
<? foreach ($assigned_groups as $group) : ?>
<li data-selection-id="<?= htmlReady($group->id) ?>">
<input type="hidden" name="assigned_groups[]"
value="<?= htmlReady($group->id) ?>">
<span class="studip-selection-label"> <div class="studip-selection" data-attribute-name="assigned-groups">
<?= htmlReady($group->name) ?> <section class="studip-selection-selected">
</span> <p><strong><?= _('Zugewiesene Gruppen') ?></strong></p>
</li> <ul>
<? endforeach ?> <? foreach ($assigned_groups as $group) : ?>
<li class="empty-placeholder"> <li data-selection-id="<?= htmlReady($group->id) ?>">
<?= _('Keine spezielle Gruppe zugewiesen') ?> <input type="hidden" name="assigned_groups[]"
</li> value="<?= htmlReady($group->id) ?>">
</ul>
</section>
<section class="studip-selection-selectable">
<p><strong><?= _('Gruppen der Veranstaltung') ?></strong></p>
<ul>
<? foreach ($groups as $group): ?>
<? if (!$assigned_groups->find($group->id)): ?>
<li data-selection-id="<?= htmlReady($group->id) ?>" >
<span class="studip-selection-label"> <span class="studip-selection-label">
<?= htmlReady($group->name) ?> <?= htmlReady($group->name) ?>
</span> </span>
</li> </li>
<? endif ?> <? endforeach ?>
<? endforeach ?> <li class="empty-placeholder">
<li class="empty-placeholder"> <?= _('Keine spezielle Gruppe zugewiesen') ?>
<?= _('Alle Gruppen wurden dem Termin zugewiesen') ?> </li>
</li> </ul>
</ul> </section>
</section>
<section class="studip-selection-selectable">
<p><strong><?= _('Gruppen der Veranstaltung') ?></strong></p>
<ul>
<? foreach ($groups as $group): ?>
<? if (!$assigned_groups->find($group->id)): ?>
<li data-selection-id="<?= htmlReady($group->id) ?>" >
<span class="studip-selection-label">
<?= htmlReady($group->name) ?>
</span>
</li>
<? endif ?>
<? endforeach ?>
<li class="empty-placeholder">
<?= _('Alle Gruppen wurden dem Termin zugewiesen') ?>
</li>
</ul>
</section>
</div>
</fieldset> </fieldset>
<? endif ?> <? endif ?>
......
...@@ -3,14 +3,6 @@ ...@@ -3,14 +3,6 @@
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
> * {
flex: 1 0 100%;
}
> legend {
margin-bottom: 0 !important;
}
// General list item styles and placeholders // General list item styles and placeholders
ul, li { ul, li {
list-style: none; list-style: none;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment