From 6cde4499f4355ccbbea7b947abb4515d1dbd690b Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 7 Sep 2017 11:44:31 +0200 Subject: [PATCH] Enhance style refs #33 --- .../Web/Controller/TimeRangePickerTrait.php | 16 +++++++--------- public/css/module.less | 9 +++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/library/Graphite/Web/Controller/TimeRangePickerTrait.php b/library/Graphite/Web/Controller/TimeRangePickerTrait.php index a573e55..35a4733 100644 --- a/library/Graphite/Web/Controller/TimeRangePickerTrait.php +++ b/library/Graphite/Web/Controller/TimeRangePickerTrait.php @@ -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 '
' . $result . '
'; } /** diff --git a/public/css/module.less b/public/css/module.less index c6b5bdf..751c10f 100644 --- a/public/css/module.less +++ b/public/css/module.less @@ -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; + } +}