Skip to content

Commit

Permalink
FilterEditor: Fix css
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Meyer committed Apr 17, 2015
1 parent 6d0870a commit b52b507
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
32 changes: 17 additions & 15 deletions library/Icinga/Web/Widget/FilterEditor.php
Expand Up @@ -649,7 +649,7 @@ protected function applyChanges($changes)

public function renderSearch()
{
$html = ' <form method="post" class="inline dontprint" action="'
$html = ' <form method="post" class="search inline dontprint" action="'
. $this->preservedUrl()
. '"><input type="text" name="q" style="width: 8em" class="search" value="" placeholder="'
. t('Search...')
Expand Down Expand Up @@ -678,20 +678,22 @@ public function renderSearch()
public function render()
{
if (! $this->preservedUrl()->getParam('modifyFilter')) {
return $this->renderSearch() . $this->shorten($this->filter, 50);
}
return $this->renderSearch()
. '<form action="'
. Url::fromRequest()
. '" class="filterEditor" method="POST">'
. '<ul class="tree widgetFilter"><li>'
. $this->renderFilter($this->filter)
. '</li></ul>'
. '<div style="float: right">'
. '<input type="submit" name="submit" value="Apply" />'
. '<input type="submit" name="cancel" value="Cancel" />'
. '</div>'
. '</form>';
return '<div class="filter">' . $this->renderSearch() . $this->shorten($this->filter, 50) . '</div>';
}
return '<div class="filter">'
. $this->renderSearch()
. '<form action="'
. Url::fromRequest()
. '" class="editor" method="POST">'
. '<ul class="tree"><li>'
. $this->renderFilter($this->filter)
. '</li></ul>'
. '<div class="buttons">'
. '<input type="submit" name="submit" value="Apply" />'
. '<input type="submit" name="cancel" value="Cancel" />'
. '</div>'
. '</form>'
. '</div>';
}

protected function shorten($string, $length)
Expand Down
22 changes: 16 additions & 6 deletions public/css/icinga/widgets.less
Expand Up @@ -48,8 +48,22 @@ table.multiselect tr[href] td {
-ms-user-select: none;
}

#main form.filterEditor input[type=text], #main form.filterEditor select {
width: 12em;
#main div.filter {
margin-top: 1em;

form.editor {
input[type=text], select {
width: 12em;
}

ul.tree li.active {
background-color: #eee;
}

div.buttons {
float: right;
}
}
}

ul.datafilter li {
Expand Down Expand Up @@ -281,10 +295,6 @@ li li .badge {
background-color: @colorUnknown;
}

.widgetFilter li.active {
background-color: #eee;
}

.sparkline-box {
position: relative;
top: -3px;
Expand Down

0 comments on commit b52b507

Please sign in to comment.