Place question number beside text

This commit is contained in:
Wojtek
2026-10-15 13:06:24 +02:00
parent 252348a07f
commit b4af647616
6 changed files with 51 additions and 3 deletions
+1 -1
View File
@@ -22,6 +22,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
## Instalacja
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.8.1).
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.8.2).
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
@@ -0,0 +1 @@
-- No database changes required for version 1.8.2.
+1 -1
View File
@@ -4,7 +4,7 @@
<creationDate>2026-10-14</creationDate>
<author>Komponent</author>
<license>GNU General Public License version 2 or later</license>
<version>1.8.1</version>
<version>1.8.2</version>
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
<element>com_testquestions</element>
<namespace path="src">Komponent\Component\Testquestions</namespace>
@@ -68,6 +68,31 @@
font-size: inherit;
}
.com-testquestions .question-header {
display: flex;
align-items: flex-start;
gap: .5rem;
}
.com-testquestions .question-number {
flex: 0 0 auto;
white-space: nowrap;
font-weight: 700;
}
.com-testquestions .question-text {
flex: 1 1 auto;
min-width: 0;
}
.com-testquestions .question-text > :first-child {
margin-top: 0;
}
.com-testquestions .question-text > :last-child {
margin-bottom: 0;
}
.com-testquestions .odp,
.com-testquestions .odpp,
.com-testquestions .odpu,
@@ -36,7 +36,12 @@ use Joomla\CMS\HTML\HTMLHelper;
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8'); ?>" method="post">
<?php foreach ($this->items as $number => $item) : ?>
<article class="testquestion mb-4">
<div class="pyt"><h2><?php echo ($number + 1) . '. '; ?><?php echo $item->question; ?></h2></div>
<div class="pyt">
<div class="question-header">
<span class="question-number"><?php echo ($number + 1) . '.'; ?></span>
<div class="question-text"><?php echo $item->question; ?></div>
</div>
</div>
<?php if ($item->image) : ?>
<div class="foto_pyt"><img src="<?php echo htmlspecialchars($item->image, ENT_QUOTES, 'UTF-8'); ?>" alt="" loading="lazy"></div>
<?php endif; ?>
+17
View File
@@ -147,3 +147,20 @@ div.odpup
.com-testquestions .odpup {
box-sizing: border-box;
}
.com-testquestions .question-header {
display: flex;
align-items: flex-start;
gap: .5rem;
}
.com-testquestions .question-number {
flex: 0 0 auto;
white-space: nowrap;
font-weight: 700;
}
.com-testquestions .question-text {
flex: 1 1 auto;
min-width: 0;
}