Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/ Update alignment to match glpi style #369

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions inc/object.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,11 @@ public function displayField($canedit, $name, $value, $template, $description =
}

$this->startColumn();
echo $searchoption['name'];
if (isset($searchoption['autoname']) && $searchoption['autoname'] && $template) {
echo "* ";
}
$this->endColumn();
$this->startColumn();
echo '<label class="col-form-label col-xxl-5 text-xxl-end">' . $searchoption['name'] . '</label>';

// Keep only main column type by removing anything that is preceded by a space (e.g. " unsigned")
// or a parenthesis (e.g. "(255)").
echo '<div class="col-xxl-7 text-start field-container">';
$column_type = preg_replace('/^([a-z]+)([ (].+)*$/', '$1', $description['Type']);
switch ($column_type) {
case "int":
Expand Down Expand Up @@ -774,6 +770,7 @@ public function displayField($canedit, $name, $value, $template, $description =
echo "<input type='text' name='$name' value='$value'>";
break;
}
echo '</div>';
$this->endColumn();
}
}
Expand All @@ -786,10 +783,14 @@ public function displayField($canedit, $name, $value, $template, $description =
public function startColumn()
{
if ($this->cpt == 0) {
echo "<tr class='tab_bg_1'>";
echo '<div class="card-body d-flex flex-wrap">';
echo '<div class="col-12 col-xxl-12 flex-column">';
echo '<div class="d-flex flex-row flex-wrap flex-xl-nowrap">';
echo '<div class="row flex-row align-items-start flex-grow-1">';
echo '<div class="row flex-row">';
}
echo '<div class="form-field row col-12 col-sm-6 mb-2">';

echo "<td>";
$this->cpt++;
}

Expand All @@ -800,12 +801,7 @@ public function startColumn()
**/
public function endColumn()
{
echo "</td>";

if ($this->cpt == 4) {
echo "</tr>";
$this->cpt = 0;
}
echo "</div>";
}


Expand All @@ -816,11 +812,7 @@ public function endColumn()
public function closeColumn()
{
if ($this->cpt > 0) {
while ($this->cpt < 4) {
echo "<td></td>";
$this->cpt++;
}
echo "</tr>";
echo "</div></div></div></div></div>";
}
}

Expand Down
Loading