Make profile page layout and shifts renderer less worse for normal users

This commit is contained in:
Igor Scheller 2023-04-30 13:00:49 +02:00 committed by Michael Weimann
parent 72d48de3ae
commit 983fb988b4
4 changed files with 23 additions and 23 deletions

View File

@ -427,7 +427,7 @@ function buttons($buttons = [])
* @param array $buttons
* @return string
*/
function table_buttons($buttons = [])
function table_buttons($buttons = [], $additionalClass = '')
{
return '<div class="btn-group" role="group">' . join('', $buttons) . '</div>';
return '<div class="btn-group ' . $additionalClass . '" role="group">' . join('', $buttons) . '</div>';
}

View File

@ -312,7 +312,7 @@ class ShiftCalendarRenderer
badge(__('Help needed'), 'danger'),
badge(__('Other angeltype needed / collides with my shifts'), 'warning'),
badge(__('Shift is full'), 'success'),
badge(__('Shift running/ended or user not arrived/allowed'), 'secondary'),
badge(__('Shift running/ended or you have not arrived'), 'secondary'),
]);
}
}

View File

@ -516,14 +516,14 @@ function User_view(
$admin_user_worklog_privilege
);
if (count($my_shifts) > 0) {
$myshifts_table = table([
$myshifts_table = div('table-responsive', table([
'date' => __('Day &amp; time'),
'duration' => __('Duration'),
'room' => __('Location'),
'shift_info' => __('Name &amp; workmates'),
'comment' => __('Comment'),
'actions' => __('Action'),
], $my_shifts);
], $my_shifts));
} elseif ($user_source->state->force_active) {
$myshifts_table = success(__('You have done enough.'), true);
}
@ -547,7 +547,7 @@ function User_view(
msg(),
div('row', [
div('col-md-12', [
buttons([
table_buttons([
$auth->can('user.edit.shirt') && $goodie_enabled ? button(
url('/admin/user/' . $user_source->id . '/goodie'),
icon('person') . ($goodie_tshirt ? __('Shirt') : __('Goodie'))
@ -579,27 +579,29 @@ function User_view(
url('/admin/user/' . $user_source->id . '/worklog'),
icon('clock-history') . __('worklog.add')
) : '',
$its_me ? button(
], 'mb-2'),
$its_me ? table_buttons([
button(
page_link_to('settings/profile'),
icon('person-fill-gear') . __('Settings')
) : '',
($its_me && $auth->can('ical')) ? button(
),
$auth->can('ical') ? button(
page_link_to('ical', ['key' => $user_source->api_key]),
icon('calendar-week') . __('iCal Export')
) : '',
($its_me && $auth->can('shifts_json_export')) ? button(
$auth->can('shifts_json_export') ? button(
page_link_to('shifts_json_export', ['key' => $user_source->api_key]),
icon('braces') . __('JSON Export')
) : '',
($its_me && (
(
$auth->can('shifts_json_export')
|| $auth->can('ical')
|| $auth->can('atom')
)) ? button(
) ? button(
page_link_to('user_myshifts', ['reset' => 1]),
icon('arrow-repeat') . __('Reset API key')
) : '',
]),
], 'mb-2') : '',
]),
]),
div('row user-info', [

View File

@ -2159,10 +2159,8 @@ msgid "Shift is full"
msgstr "Schicht ist voll"
#: includes/view/ShiftCalendarRenderer.php:316
msgid "Shift running/ended or user not arrived/allowed"
msgstr ""
"Schicht läuft/vorbei oder du bist noch nicht angekommen/darfst dich noch "
"nicht anmelden"
msgid "Shift running/ended or you have not arrived"
msgstr "Schicht läuft/vorbei oder du bist noch nicht angekommen"
#: includes/view/ShiftCalendarShiftRenderer.php:135
msgid "Add more angels"