Add extra `class` to outer item lists & render subject header in the error box
This commit is contained in:
parent
fdadba59ca
commit
ad02431bd1
|
@ -78,6 +78,9 @@ class MigrationList extends BaseItemList
|
|||
protected function assemble(): void
|
||||
{
|
||||
$itemClass = $this->getItemClass();
|
||||
if (! $this->isMinimal()) {
|
||||
$this->getAttributes()->add('class', 'file-list');
|
||||
}
|
||||
|
||||
/** @var MigrationHook $data */
|
||||
foreach ($this->data as $data) {
|
||||
|
|
|
@ -86,8 +86,29 @@ class MigrationListItemMinimal extends BaseListItem
|
|||
])
|
||||
);
|
||||
|
||||
$scriptPath = $migration->getScriptPath();
|
||||
/** @var string $parentDirs */
|
||||
$parentDirs = substr($scriptPath, (int) strpos($scriptPath, 'schema'));
|
||||
$parentDirs = substr($parentDirs, 0, strrpos($parentDirs, '/') + 1);
|
||||
|
||||
$title = new HtmlElement('div', Attributes::create(['class' => 'title']));
|
||||
$title->addHtml(
|
||||
new HtmlElement('span', null, Text::create($parentDirs)),
|
||||
new HtmlElement(
|
||||
'span',
|
||||
Attributes::create(['class' => 'version']),
|
||||
Text::create($migration->getVersion() . '.sql')
|
||||
),
|
||||
new HtmlElement(
|
||||
'span',
|
||||
Attributes::create(['class' => 'upgrade-failed']),
|
||||
Text::create($this->translate('Upgrade failed'))
|
||||
)
|
||||
);
|
||||
|
||||
$wrapper->addHtml(
|
||||
new Icon('circle-xmark'),
|
||||
new HtmlElement('header', null, $title),
|
||||
$caption,
|
||||
new HtmlElement('pre', null, new HtmlString(Html::escape($migration->getLastState())))
|
||||
);
|
||||
|
@ -117,8 +138,6 @@ class MigrationListItemMinimal extends BaseListItem
|
|||
|
||||
protected function assembleMain(BaseHtmlElement $main): void
|
||||
{
|
||||
$this->getAttributes()->add('class', 'minimal');
|
||||
|
||||
$main->addHtml($this->createHeader());
|
||||
$caption = $this->createCaption();
|
||||
if (! $caption->isEmpty()) {
|
||||
|
|
|
@ -72,6 +72,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.item-list:not(.file-list) .list-item footer {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
align-items: baseline;
|
||||
|
||||
|
@ -100,19 +104,15 @@
|
|||
|
||||
i.icon {
|
||||
position: absolute;
|
||||
margin-top: .5em;
|
||||
margin-top: .3em;
|
||||
margin-left: .5em;
|
||||
}
|
||||
|
||||
.caption {
|
||||
.caption, header {
|
||||
margin-left: 1.8em;
|
||||
}
|
||||
}
|
||||
|
||||
&.minimal footer {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
footer {
|
||||
width: 100%;
|
||||
padding-top: 0;
|
||||
|
|
Loading…
Reference in New Issue