mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
dashboards/settings: Don't disguise action links as button links
This commit is contained in:
parent
8bd82ff97c
commit
d91795d815
@ -20,7 +20,8 @@ use Icinga\Web\Notification;
|
||||
use Icinga\Web\Widget\Tabextension\DashboardSettings;
|
||||
use ipl\Web\Compat\CompatController;
|
||||
use ipl\Web\Url;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
use ipl\Web\Widget\Icon;
|
||||
use ipl\Web\Widget\Link;
|
||||
|
||||
class DashboardsController extends CompatController
|
||||
{
|
||||
@ -419,19 +420,18 @@ class DashboardsController extends CompatController
|
||||
|
||||
$this->dashboard->activate('dashboard_settings');
|
||||
|
||||
$this->addControl(new ActionLink(
|
||||
t('Add new Home'),
|
||||
$this->addControl(new Link(
|
||||
[new Icon('plus'), t('Add new Home')],
|
||||
Url::fromPath(Dashboard::BASE_ROUTE . '/new-home'),
|
||||
'plus',
|
||||
[
|
||||
'class' => 'add-home',
|
||||
'class' => ['button-link', 'add-home'],
|
||||
'data-icinga-modal' => true,
|
||||
'data-no-icinga-ajax' => true
|
||||
]
|
||||
));
|
||||
|
||||
$this->content->getAttributes()->add('class', 'dashboard-manager');
|
||||
$this->controls->getAttributes()->add('class', 'dashboard-manager-controls');
|
||||
$this->controls->getAttributes()->add('class', ['separated', 'dashboard-manager-controls']);
|
||||
|
||||
$this->addContent(new Settings($this->dashboard));
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ use ipl\Html\BaseHtmlElement;
|
||||
use ipl\Html\HtmlElement;
|
||||
use ipl\Html\ValidHtml;
|
||||
use ipl\Web\Url;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
use ipl\Web\Widget\Icon;
|
||||
use ipl\Web\Widget\Link;
|
||||
|
||||
abstract class ItemListControl extends BaseHtmlElement
|
||||
{
|
||||
@ -64,7 +64,7 @@ abstract class ItemListControl extends BaseHtmlElement
|
||||
protected function assembleHeader(Url $url, string $title)
|
||||
{
|
||||
$header = HtmlElement::create('h1', ['class' => 'collapsible-header'], $title);
|
||||
$header->addHtml(new Link(t('Edit'), $url, [
|
||||
$header->addHtml(new ActionLink(t('Edit'), $url, null, [
|
||||
'data-icinga-modal' => true,
|
||||
'data-no-icinga-ajax' => true
|
||||
]));
|
||||
|
@ -10,7 +10,8 @@ use Icinga\Web\Dashboard\DashboardHome;
|
||||
use ipl\Html\BaseHtmlElement;
|
||||
use ipl\Html\HtmlElement;
|
||||
use ipl\Web\Url;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
use ipl\Web\Widget\Icon;
|
||||
use ipl\Web\Widget\Link;
|
||||
|
||||
class DashboardHomeList extends ItemListControl
|
||||
{
|
||||
@ -63,6 +64,10 @@ class DashboardHomeList extends ItemListControl
|
||||
$url = Url::fromPath(Dashboard::BASE_ROUTE . '/new-pane');
|
||||
$url->setParams(['home' => $this->home->getName()]);
|
||||
|
||||
return new ActionLink(t('Add Dashboard'), $url, 'plus', ['class' => 'add-dashboard']);
|
||||
return new Link(
|
||||
[new Icon('plus'), t('Add Dashboard')],
|
||||
$url,
|
||||
['class' => ['button-link', 'add-dashboard']]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,8 @@ use Icinga\Web\Dashboard\Pane;
|
||||
use ipl\Html\BaseHtmlElement;
|
||||
use ipl\Html\HtmlElement;
|
||||
use ipl\Web\Url;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
use ipl\Web\Widget\Icon;
|
||||
use ipl\Web\Widget\Link;
|
||||
|
||||
class DashboardList extends ItemListControl
|
||||
{
|
||||
@ -70,6 +71,10 @@ class DashboardList extends ItemListControl
|
||||
'pane' => $this->pane->getName()
|
||||
]);
|
||||
|
||||
return new ActionLink(t('Add Dashlet'), $url, 'plus', ['class' => 'add-dashlet']);
|
||||
return new Link(
|
||||
[new Icon('plus'), t('Add Dashlet')],
|
||||
$url,
|
||||
['class' => ['button-link', 'add-dashlet']]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ use ipl\Html\BaseHtmlElement;
|
||||
use ipl\Html\HtmlElement;
|
||||
use ipl\Html\ValidHtml;
|
||||
use ipl\Web\Url;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
use ipl\Web\Widget\Link;
|
||||
|
||||
class DashletListItem extends BaseHtmlElement
|
||||
@ -84,7 +85,7 @@ class DashletListItem extends BaseHtmlElement
|
||||
'dashlet' => $this->dashlet->getName()
|
||||
]);
|
||||
|
||||
$header->addHtml(new Link(t('Edit'), $url, [
|
||||
$header->addHtml(new ActionLink(t('Edit'), $url, null, [
|
||||
'data-icinga-modal' => true,
|
||||
'data-no-icinga-ajax' => true
|
||||
]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user