better layout for small devices

This commit is contained in:
Uwe Steinmann 2021-05-06 20:51:13 +02:00
parent 4ea54923d3
commit 1746842aa3

View File

@ -60,30 +60,26 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Theme_Style {
<input type="text" id="myInput">
<table id="myTable" class="table table-condensed table-sm">
<thead>
<tr><th><?php printMLText('name'); ?></th><th><?php printMLText('email');?></th><th><?php printMLText('groups'); ?></th><th><?php printMLText('role'); ?></th><th></th></tr>
<tr><th><?php printMLText('name'); ?></th><th><?php printMLText('role'); ?>/<?php printMLText('groups'); ?></th><th></th></tr>
</thead>
<tbody>
<?php
foreach ($allUsers as $currUser) {
echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">";
echo "<td>";
echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")<br />";
$hasemail = $currUser->getEmail() && (preg_match("/.+@.+/", $currUser->getEmail()) == 1);
if($hasemail)
echo "<a href=\"mailto:".$currUser->getEmail()."\">";
echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")";
if($hasemail)
echo "</a>";
echo "<br />";
if($hasemail)
echo "<small>".htmlspecialchars($currUser->getEmail())."</small><br />";
echo "<small>".htmlspecialchars($currUser->getComment())."</small>";
echo "</td>";
echo "<td>";
echo "<a href=\"mailto:".htmlspecialchars($currUser->getEmail())."\">".htmlspecialchars($currUser->getEmail())."</a><br />";
echo "</td>";
echo "<td>";
$groups = $currUser->getGroups();
if (count($groups) != 0) {
for ($j = 0; $j < count($groups); $j++) {
print htmlspecialchars($groups[$j]->getName());
if ($j +1 < count($groups))
print ", ";
}
}
echo "</td>";
echo "<td>";
echo getMLText('role').": ";
switch($currUser->getRole()) {
case SeedDMS_Core_User::role_user:
printMLText("role_user");
@ -95,10 +91,21 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Theme_Style {
printMLText("role_guest");
break;
}
echo "<br />";
$groups = $currUser->getGroups();
if (count($groups) != 0) {
for ($j = 0; $j < count($groups); $j++) {
print htmlspecialchars($groups[$j]->getName());
if ($j +1 < count($groups))
print ", ";
}
}
echo "</td>";
echo "<td>";
echo "</td>";
echo "<td>";
if($currUser->getID() != $user->getID()) {
echo "<a class=\"btn btn-primary\" href=\"../op/op.SubstituteUser.php?userid=".((int) $currUser->getID())."&formtoken=".createFormKey('substituteuser')."\"><i class=\"fa fa-exchange\"></i> ".getMLText('substitute_user')."</a> ";
echo "<a class=\"btn btn-primary btn-mini btn-sm text-nowrap\" href=\"../op/op.SubstituteUser.php?userid=".((int) $currUser->getID())."&formtoken=".createFormKey('substituteuser')."\"><i class=\"fa fa-exchange\"></i><span class=\"d-none d-md-inline\"> ".getMLText('substitute_user')."</span></a> ";
}
echo "</td>";
echo "</tr>";