Skip to content

Commit 0634f39

Browse files
authored
Fix/ Update alignment to match glpi style (#369)
* Update alignment to match glpi * Fix dropdown alignment
1 parent b789473 commit 0634f39

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

inc/object.class.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -646,15 +646,11 @@ public function displayField($canedit, $name, $value, $template, $description =
646646
}
647647

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

656651
// Keep only main column type by removing anything that is preceded by a space (e.g. " unsigned")
657652
// or a parenthesis (e.g. "(255)").
653+
echo '<div class="col-xxl-7 text-start field-container">';
658654
$column_type = preg_replace('/^([a-z]+)([ (].+)*$/', '$1', $description['Type']);
659655
switch ($column_type) {
660656
case "int":
@@ -774,6 +770,7 @@ public function displayField($canedit, $name, $value, $template, $description =
774770
echo "<input type='text' name='$name' value='$value'>";
775771
break;
776772
}
773+
echo '</div>';
777774
$this->endColumn();
778775
}
779776
}
@@ -786,10 +783,14 @@ public function displayField($canedit, $name, $value, $template, $description =
786783
public function startColumn()
787784
{
788785
if ($this->cpt == 0) {
789-
echo "<tr class='tab_bg_1'>";
786+
echo '<div class="card-body d-flex flex-wrap">';
787+
echo '<div class="col-12 col-xxl-12 flex-column">';
788+
echo '<div class="d-flex flex-row flex-wrap flex-xl-nowrap">';
789+
echo '<div class="row flex-row align-items-start flex-grow-1">';
790+
echo '<div class="row flex-row">';
790791
}
792+
echo '<div class="form-field row col-12 col-sm-6 mb-2">';
791793

792-
echo "<td>";
793794
$this->cpt++;
794795
}
795796

@@ -800,12 +801,7 @@ public function startColumn()
800801
**/
801802
public function endColumn()
802803
{
803-
echo "</td>";
804-
805-
if ($this->cpt == 4) {
806-
echo "</tr>";
807-
$this->cpt = 0;
808-
}
804+
echo "</div>";
809805
}
810806

811807

@@ -816,11 +812,7 @@ public function endColumn()
816812
public function closeColumn()
817813
{
818814
if ($this->cpt > 0) {
819-
while ($this->cpt < 4) {
820-
echo "<td></td>";
821-
$this->cpt++;
822-
}
823-
echo "</tr>";
815+
echo "</div></div></div></div></div>";
824816
}
825817
}
826818

0 commit comments

Comments
 (0)