Enhance style

refs #33
This commit is contained in:
Alexander A. Klimov 2017-09-07 11:44:31 +02:00
parent 37a4b9ad3e
commit 6cde4499f4
2 changed files with 16 additions and 9 deletions

View file

@ -51,15 +51,15 @@ trait TimeRangePickerTrait
$result = $this->getTimeRangePickerCommonForm();
$url = Url::fromRequest();
$relevantParams = ['graph_range', 'graph_start', 'graph_end'];
$hasLink = false;
foreach ($relevantParams as $param) {
if ($url->hasParam($param)) {
$result .= $this->view->qlink(
$this->translate('Clear', 'TimeRangePicker'),
$url->without($relevantParams)
$url->without($relevantParams),
null,
['class' => 'button-link']
);
$hasLink = true;
break;
}
}
@ -67,17 +67,15 @@ trait TimeRangePickerTrait
if ($url->hasParam('graph_range_custom')) {
$result .= $this->getTimeRangePickerCustomForm();
} else {
if ($hasLink) {
$result .= ' ';
}
$result .= $this->view->qlink(
$this->translate('Custom', 'TimeRangePicker'),
$url->with('graph_range_custom', '1')
$url->with('graph_range_custom', '1'),
null,
['class' => 'button-link']
);
}
return $result;
return '<div class="timerangepicker-forms">' . $result . '</div>';
}
/**

View file

@ -52,6 +52,7 @@ ul.legend {
form[name=form_timerangepickercommon_graphite] select {
width: 7.5em;
margin-right: 0.25em;
}
form[name=form_timerangepickercustom_graphite] {
@ -63,3 +64,11 @@ form[name=form_timerangepickercustom_graphite] {
width: 7.5em;
}
}
.timerangepicker-forms {
padding: 0.25em;
> * {
margin: 0.25em;
}
}