Fixed api key toggle driver license config display and dashboard
This commit is contained in:
parent
2509bd4a98
commit
7917e32f3e
|
@ -164,7 +164,7 @@ return [
|
||||||
],
|
],
|
||||||
3 => [
|
3 => [
|
||||||
'name' => 'Engelsystem 32c3 (2015)',
|
'name' => 'Engelsystem 32c3 (2015)',
|
||||||
'type' => 'dark',
|
'type' => 'light',
|
||||||
'navbar_classes' => 'navbar-dark bg-black border-dark',
|
'navbar_classes' => 'navbar-dark bg-black border-dark',
|
||||||
],
|
],
|
||||||
2 => [
|
2 => [
|
||||||
|
|
|
@ -314,7 +314,9 @@ function ical_hint()
|
||||||
page_link_to('shifts_json_export', ['key' => $user->api_key]),
|
page_link_to('shifts_json_export', ['key' => $user->api_key]),
|
||||||
page_link_to('user_myshifts', ['reset' => 1])
|
page_link_to('user_myshifts', ['reset' => 1])
|
||||||
)
|
)
|
||||||
. ' <button class="btn btn-sm btn-danger" data-toggle="collapse" data-target="#collapseApiKey" aria-expanded="false" aria-controls="collapseApiKey">
|
. ' <button class="btn btn-sm btn-danger" type="button"
|
||||||
|
data-bs-toggle="collapse" data-bs-target="#collapseApiKey"
|
||||||
|
aria-expanded="false" aria-controls="collapseApiKey">
|
||||||
' . __('Show API Key') . '
|
' . __('Show API Key') . '
|
||||||
</button>'
|
</button>'
|
||||||
. '</p>'
|
. '</p>'
|
||||||
|
|
|
@ -18,7 +18,7 @@ function stats($label, $number, $style = null)
|
||||||
$style = 'success';
|
$style = 'success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return div('stats stats-' . $style, [
|
return div('col stats stats-' . $style, [
|
||||||
$label,
|
$label,
|
||||||
div('number', [
|
div('number', [
|
||||||
$number
|
$number
|
||||||
|
|
|
@ -34,22 +34,24 @@ function public_dashboard_view($stats, $free_shifts)
|
||||||
$isFiltered = request()->get('filtered');
|
$isFiltered = request()->get('filtered');
|
||||||
$filter = collect(session()->get('shifts-filter'))->only(['rooms', 'types'])->toArray();
|
$filter = collect(session()->get('shifts-filter'))->only(['rooms', 'types'])->toArray();
|
||||||
return page([
|
return page([
|
||||||
div('public-dashboard', [
|
div('wrapper', [
|
||||||
div('first', [
|
div('public-dashboard', [
|
||||||
stats(__('Angels needed in the next 3 hrs'), $stats['needed-3-hours']),
|
div('first row', [
|
||||||
stats(__('Angels needed for nightshifts'), $stats['needed-night']),
|
stats(__('Angels needed in the next 3 hrs'), $stats['needed-3-hours']),
|
||||||
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
|
stats(__('Angels needed for nightshifts'), $stats['needed-night']),
|
||||||
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
|
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
|
||||||
'<script>
|
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
|
||||||
$(function() {
|
'<script>
|
||||||
setInterval(function() {
|
$(function() {
|
||||||
$(\'#public-dashboard\').load(window.location.href + \' #public-dashboard\');
|
setInterval(function() {
|
||||||
}, 60000);
|
$(\'#content .wrapper\').load(window.location.href + \' #public-dashboard\');
|
||||||
})
|
}, 60000);
|
||||||
</script>'
|
})
|
||||||
], 'statistics'),
|
</script>'
|
||||||
$needed_angels
|
], 'statistics'),
|
||||||
], 'public-dashboard'),
|
$needed_angels
|
||||||
|
], 'public-dashboard'),
|
||||||
|
]),
|
||||||
div('first col-md-12 text-center', [buttons([
|
div('first col-md-12 text-center', [buttons([
|
||||||
button_js(
|
button_js(
|
||||||
'
|
'
|
||||||
|
@ -91,9 +93,14 @@ function public_dashboard_shift_render($shift)
|
||||||
. '</span>';
|
. '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return div('col-md-3', [
|
$type = 'bg-dark';
|
||||||
div('dashboard-panel panel panel-' . $shift['style'], [
|
if (theme_type() == 'light') {
|
||||||
div('panel-body', [
|
$type = 'bg-light';
|
||||||
|
}
|
||||||
|
|
||||||
|
return div('col-md-3 mb-3', [
|
||||||
|
div('dashboard-card card card-' . $shift['style'] . ' ' . $type, [
|
||||||
|
div('card-body', [
|
||||||
'<a class="panel-link" href="' . shift_link($shift) . '"></a>',
|
'<a class="panel-link" href="' . shift_link($shift) . '"></a>',
|
||||||
$panel_body
|
$panel_body
|
||||||
])
|
])
|
||||||
|
|
|
@ -20,8 +20,7 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver
|
||||||
form([
|
form([
|
||||||
form_info(__('Privacy'), __('Your driving license information is only visible for supporters and admins.')),
|
form_info(__('Privacy'), __('Your driving license information is only visible for supporters and admins.')),
|
||||||
form_checkbox('wants_to_drive', __('I am willing to drive a car for the event'), $wants_to_drive),
|
form_checkbox('wants_to_drive', __('I am willing to drive a car for the event'), $wants_to_drive),
|
||||||
div('panel panel-default', [
|
div('m-3', [
|
||||||
div('panel-body', [
|
|
||||||
form_checkbox(
|
form_checkbox(
|
||||||
'has_car',
|
'has_car',
|
||||||
__('I have my own car with me and am willing to use it for the event (You\'ll get reimbursed for fuel)'),
|
__('I have my own car with me and am willing to use it for the event (You\'ll get reimbursed for fuel)'),
|
||||||
|
@ -49,7 +48,6 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver
|
||||||
__('Forklift'),
|
__('Forklift'),
|
||||||
$user_driver_license['has_license_forklift']
|
$user_driver_license['has_license_forklift']
|
||||||
)
|
)
|
||||||
])
|
|
||||||
], 'driving_license'),
|
], 'driving_license'),
|
||||||
form_submit('submit', __('Save'))
|
form_submit('submit', __('Save'))
|
||||||
]),
|
]),
|
||||||
|
|
|
@ -42,8 +42,8 @@ class Globals extends TwigExtension implements GlobalsInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $this->request->query->get('theme');
|
$query = $this->request->query->get('theme');
|
||||||
if (!is_null($query) && isset($themes[$query])) {
|
if (!is_null($query) && isset($themes[(int)$query])) {
|
||||||
$themeId = $query;
|
$themeId = (int)$query;
|
||||||
}
|
}
|
||||||
|
|
||||||
$theme = $themes[$themeId];
|
$theme = $themes[$themeId];
|
||||||
|
|
Loading…
Reference in New Issue