Fixed api key toggle driver license config display and dashboard

This commit is contained in:
Igor Scheller 2021-07-24 20:31:40 +02:00 committed by Michael Weimann
parent 2509bd4a98
commit 7917e32f3e
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
6 changed files with 34 additions and 27 deletions

View File

@ -164,7 +164,7 @@ return [
],
3 => [
'name' => 'Engelsystem 32c3 (2015)',
'type' => 'dark',
'type' => 'light',
'navbar_classes' => 'navbar-dark bg-black border-dark',
],
2 => [

View File

@ -314,7 +314,9 @@ function ical_hint()
page_link_to('shifts_json_export', ['key' => $user->api_key]),
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') . '
</button>'
. '</p>'

View File

@ -18,7 +18,7 @@ function stats($label, $number, $style = null)
$style = 'success';
}
}
return div('stats stats-' . $style, [
return div('col stats stats-' . $style, [
$label,
div('number', [
$number

View File

@ -34,22 +34,24 @@ function public_dashboard_view($stats, $free_shifts)
$isFiltered = request()->get('filtered');
$filter = collect(session()->get('shifts-filter'))->only(['rooms', 'types'])->toArray();
return page([
div('public-dashboard', [
div('first', [
stats(__('Angels needed in the next 3 hrs'), $stats['needed-3-hours']),
stats(__('Angels needed for nightshifts'), $stats['needed-night']),
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
'<script>
$(function() {
setInterval(function() {
$(\'#public-dashboard\').load(window.location.href + \' #public-dashboard\');
}, 60000);
})
</script>'
], 'statistics'),
$needed_angels
], 'public-dashboard'),
div('wrapper', [
div('public-dashboard', [
div('first row', [
stats(__('Angels needed in the next 3 hrs'), $stats['needed-3-hours']),
stats(__('Angels needed for nightshifts'), $stats['needed-night']),
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
'<script>
$(function() {
setInterval(function() {
$(\'#content .wrapper\').load(window.location.href + \' #public-dashboard\');
}, 60000);
})
</script>'
], 'statistics'),
$needed_angels
], 'public-dashboard'),
]),
div('first col-md-12 text-center', [buttons([
button_js(
'
@ -91,9 +93,14 @@ function public_dashboard_shift_render($shift)
. '</span>';
}
return div('col-md-3', [
div('dashboard-panel panel panel-' . $shift['style'], [
div('panel-body', [
$type = 'bg-dark';
if (theme_type() == 'light') {
$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>',
$panel_body
])

View File

@ -20,8 +20,7 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver
form([
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),
div('panel panel-default', [
div('panel-body', [
div('m-3', [
form_checkbox(
'has_car',
__('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'),
$user_driver_license['has_license_forklift']
)
])
], 'driving_license'),
form_submit('submit', __('Save'))
]),

View File

@ -42,8 +42,8 @@ class Globals extends TwigExtension implements GlobalsInterface
}
$query = $this->request->query->get('theme');
if (!is_null($query) && isset($themes[$query])) {
$themeId = $query;
if (!is_null($query) && isset($themes[(int)$query])) {
$themeId = (int)$query;
}
$theme = $themes[$themeId];