Skip to content

Commit

Permalink
Merge pull request #9 from CottaCush/improvement/filters
Browse files Browse the repository at this point in the history
 Display report filters on one column
  • Loading branch information
taiwo-ladipo authored Jan 9, 2019
2 parents 2d6f668 + 97f0e65 commit 4a247c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/generators/sql/SQLQueryFilterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SQLQueryFilterFactory

public $placeholder;
public $database;
const CSS_COLUMN_SPEC = 'col-sm-12';

public function __construct(PlaceholderInterface $placeholder = null, Connection $database = null)
{
Expand All @@ -40,7 +41,7 @@ public function createWidget($value = null)

switch ($type) {
case PlaceholderType::TYPE_BOOLEAN:
return Html::beginTag('div', ['class' => 'form-group col-sm-6']) .
return Html::beginTag('div', ['class' => ['form-group', self::CSS_COLUMN_SPEC]]) .
Html::tag('label', $description, ['class' => 'control-label']) .
Html::radioList($name, $value, PlaceholderType::BOOLEAN_VALUES_MAP, [
'item' => function ($index, $label, $name, $checked, $value) {
Expand All @@ -57,7 +58,7 @@ public function createWidget($value = null)
break;

case PlaceholderType::TYPE_DATE:
return Html::beginTag('div', ['class' => 'form-group col-sm-6']) .
return Html::beginTag('div', ['class' => ['form-group', self::CSS_COLUMN_SPEC]]) .
Html::label($description, $name, ['class' => 'control-label']) .
Html::textInput(
$name,
Expand All @@ -79,7 +80,7 @@ public function createWidget($value = null)
break;

default:
return Html::beginTag('div', ['class' => 'form-group col-sm-6']) .
return Html::beginTag('div', ['class' => ['form-group', self::CSS_COLUMN_SPEC]]) .
Html::label($description, $name, ['class' => 'control-label']) .
Html::textInput(
$name,
Expand Down Expand Up @@ -139,7 +140,7 @@ private function generateDropdown($value = null)
}

//Generate the dropdown from the values
$html .= Html::beginTag('div', ['class' => 'form-group col-sm-6']) .
$html .= Html::beginTag('div', ['class' => ['form-group', self::CSS_COLUMN_SPEC]]) .
Html::label($dropdownQuery->name, $this->placeholder->getName(), ['class' => 'control-label']) .
Select2::widget([
'name' => $this->placeholder->getName(),
Expand Down

0 comments on commit 4a247c6

Please sign in to comment.