chg: [element:genericElements] UI improvements in index factory

pull/37/head
mokaddem 2021-01-12 10:56:47 +01:00
parent 43118f21eb
commit 1753ce387e
5 changed files with 10 additions and 5 deletions

View File

@ -10,7 +10,6 @@ echo $this->element('genericElements/IndexTable/index_table', [
'data' => [ 'data' => [
'type' => 'simple', 'type' => 'simple',
'text' => __('Add individual'), 'text' => __('Add individual'),
'class' => 'btn btn-primary',
'popover_url' => '/individuals/add' 'popover_url' => '/individuals/add'
] ]
] ]

View File

@ -47,7 +47,7 @@
} }
$dataFields = implode(' ', $dataFields); $dataFields = implode(' ', $dataFields);
echo sprintf( echo sprintf(
'<button class="btn btn-sm %s %s" %s href="%s" %s %s %s %s %s>%s%s%s</button>', '<button class="btn %s %s" %s href="%s" %s %s %s %s %s>%s%s%s</button>',
empty($data['class']) ? '' : h($data['class']), empty($data['class']) ? '' : h($data['class']),
empty($data['isFilter']) ? 'btn-primary' : (empty($data['active']) ? 'btn-light' : 'btn-secondary'), // Change the default class for highlighted/active toggles here empty($data['isFilter']) ? 'btn-primary' : (empty($data['active']) ? 'btn-light' : 'btn-secondary'), // Change the default class for highlighted/active toggles here
empty($data['id']) ? '' : 'id="' . h($data['id']) . '"', empty($data['id']) ? '' : 'id="' . h($data['id']) . '"',

View File

@ -37,7 +37,9 @@
if (isset($data['requirement'])) { if (isset($data['requirement'])) {
$dataGroup['requirement'] = $data['requirement']; $dataGroup['requirement'] = $data['requirement'];
} }
echo '<div class="d-flex align-items-end topbar-contextual-filter">';
echo $this->element('/genericElements/ListTopBar/group_simple', [ echo $this->element('/genericElements/ListTopBar/group_simple', [
'data' => $dataGroup, 'data' => $dataGroup,
'tableRandomValue' => $tableRandomValue 'tableRandomValue' => $tableRandomValue
]); ]);
echo '</div>';

View File

@ -5,7 +5,7 @@
$elements .= $this->element('/genericElements/ListTopBar/element_' . (empty($element['type']) ? 'simple' : h($element['type'])), array('data' => $element, 'tableRandomValue' => $tableRandomValue)); $elements .= $this->element('/genericElements/ListTopBar/element_' . (empty($element['type']) ? 'simple' : h($element['type'])), array('data' => $element, 'tableRandomValue' => $tableRandomValue));
} }
echo sprintf( echo sprintf(
'<div %s class="btn-group mr-2" role="group" aria-label="button-group">%s</div>', '<div %s class="btn-group btn-group-sm mr-2" role="group" aria-label="button-group">%s</div>',
(!empty($data['id'])) ? 'id="' . h($data['id']) . '"' : '', (!empty($data['id'])) ? 'id="' . h($data['id']) . '"' : '',
$elements $elements
); );

View File

@ -117,7 +117,6 @@
.btn-group > .btn:last-of-type:not(.dropdown-toggle), .btn-group > .btn-group:not(:last-of-type) > .btn { .btn-group > .btn:last-of-type:not(.dropdown-toggle), .btn-group > .btn-group:not(:last-of-type) > .btn {
border-top-right-radius: 0.2rem; border-top-right-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
} }
input[type="checkbox"].change-cursor { input[type="checkbox"].change-cursor {
@ -127,3 +126,8 @@ input[type="checkbox"].change-cursor {
input[type="checkbox"]:disabled.change-cursor { input[type="checkbox"]:disabled.change-cursor {
cursor: not-allowed; cursor: not-allowed;
} }
.topbar-contextual-filter button.btn {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}