use better and more icons

This commit is contained in:
Thomas Rupprecht 2022-12-02 23:03:23 +01:00 committed by Michael Weimann
parent 3e22315caa
commit 7a376399b8
17 changed files with 74 additions and 64 deletions

View File

@ -296,7 +296,7 @@ function angeltypes_list_controller()
$actions = [
button(
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype->id]),
__('view'),
icon('eye') . __('view'),
'btn-sm'
)
];
@ -304,12 +304,12 @@ function angeltypes_list_controller()
if (auth()->can('admin_angel_types')) {
$actions[] = button(
page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype->id]),
__('edit'),
icon('pencil') . __('edit'),
'btn-sm'
);
$actions[] = button(
page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype->id]),
__('delete'),
icon('trash') . __('delete'),
'btn-sm'
);
}
@ -321,18 +321,18 @@ function angeltypes_list_controller()
'user_angeltypes',
['action' => 'delete', 'user_angeltype_id' => $angeltype->user_angeltype_id]
),
__('leave'),
icon('box-arrow-right') . __('leave'),
'btn-sm'
);
} else {
$actions[] = button(
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype->id]),
__('join'),
icon('box-arrow-in-right') . __('join'),
'btn-sm'
);
}
$angeltype->is_restricted = $angeltype->restricted ? icon('book') : '';
$angeltype->is_restricted = $angeltype->restricted ? icon('mortarboard-fill') : '';
$angeltype->no_self_signup_allowed = $angeltype->no_self_signup ? '' : icon('pencil-square');
$angeltype->name = '<a href="'

View File

@ -102,7 +102,7 @@ function admin_free()
: icon('eye-slash'),
'actions' =>
auth()->can('admin_user')
? button(page_link_to('admin_user', ['id' => $usr->id]), __('edit'), 'btn-sm')
? button(page_link_to('admin_user', ['id' => $usr->id]), icon('pencil') . __('edit'), 'btn-sm')
: ''
];
}

View File

@ -42,7 +42,7 @@ function admin_groups()
'admin_groups',
['action' => 'edit', 'id' => $group->id]
),
__('edit'),
icon('pencil') . __('edit'),
'btn-sm'
)
];

View File

@ -30,12 +30,12 @@ function admin_rooms()
'actions' => table_buttons([
button(
page_link_to('admin_rooms', ['show' => 'edit', 'id' => $room->id]),
__('edit'),
icon('pencil') . __('edit'),
'btn-sm'
),
button(
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
__('delete'),
icon('trash') . __('delete'),
'btn-sm'
)
])

View File

@ -307,7 +307,7 @@ function admin_shifts()
foreach ($shifts as $shift) {
$shifts_table_entry = [
'timeslot' =>
icon('clock') . ' '
icon('clock-history') . ' '
. date('Y-m-d H:i', $shift['start'])
. ' - '
. date('H:i', $shift['end'])

View File

@ -257,7 +257,12 @@ function view_user_shifts()
msg(),
view(__DIR__ . '/../../resources/views/pages/user-shifts.html', [
'title' => shifts_title(),
'room_select' => make_select($rooms, $shiftsFilter->getRooms(), 'rooms', __('Rooms')),
'room_select' => make_select(
$rooms,
$shiftsFilter->getRooms(),
'rooms',
icon('pin-map-fill') . __('Rooms')
),
'start_select' => html_select_key(
'start_day',
'start_day',
@ -276,7 +281,7 @@ function view_user_shifts()
$types,
$shiftsFilter->getTypes(),
'types',
__('Angeltypes') . '<sup>1</sup>',
icon('person-lines-fill') . __('Angeltypes') . '<sup>1</sup>',
[
button(
'javascript:checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')',
@ -285,7 +290,12 @@ function view_user_shifts()
),
]
),
'filled_select' => make_select($filled, $shiftsFilter->getFilled(), 'filled', __('Occupancy')),
'filled_select' => make_select(
$filled,
$shiftsFilter->getFilled(),
'filled',
icon('person-fill-slash') . __('Occupancy')
),
'task_notice' =>
'<sup>1</sup>'
. __('The tasks shown here are influenced by the angeltypes you joined already!')
@ -378,7 +388,7 @@ function make_select($items, $selected, $name, $title = null, $additionalButtons
. '<input class="form-check-input" type="checkbox" id="' . $id . '" name="' . $name . '[]" value="' . $i['id'] . '" '
. (in_array($i['id'], $selected) ? ' checked="checked"' : '')
. '><label class="form-check-label" for="' . $id . '">' . $i['name'] . '</label>'
. (!isset($i['enabled']) || $i['enabled'] ? '' : icon('book'))
. (!isset($i['enabled']) || $i['enabled'] ? '' : icon('mortarboard-fill'))
. '</div>';
}
$html .= '<div id="selection_' . $name . '" class="selection ' . $name . '">' . "\n";

View File

@ -68,7 +68,7 @@ function make_user_submenu()
page_link_to('settings/profile'),
__('Settings'),
$page == 'settings/profile',
'gear'
'person-fill-gear'
);
}
@ -192,7 +192,7 @@ function make_room_navigation($menu)
$room_menu[] = toolbar_dropdown_item_divider();
}
foreach ($rooms as $room) {
$room_menu[] = toolbar_dropdown_item(room_link($room), $room->name, false, 'geo-alt');
$room_menu[] = toolbar_dropdown_item(room_link($room), $room->name, false, 'pin-map-fill');
}
if (count($room_menu) > 0) {
$menu[] = toolbar_dropdown('map-marker', __('Rooms'), $room_menu);

View File

@ -26,7 +26,7 @@ function AngelType_name_render(AngelType $angeltype, $plain = false)
}
return '<a href="' . angeltype_link($angeltype->id) . '">'
. ($angeltype->restricted ? icon('book') : '') . $angeltype->name
. ($angeltype->restricted ? icon('mortarboard-fill') : '') . $angeltype->name
. '</a>';
}
@ -41,7 +41,7 @@ function AngelType_render_membership(AngelType $user_angeltype)
if (!empty($user_angeltype->user_angeltype_id)) {
if ($user_angeltype->restricted) {
if (empty($user_angeltype->confirm_user_id)) {
return icon('book') . __('Unconfirmed');
return icon('mortarboard-fill') . __('Unconfirmed');
} elseif ($user_angeltype->supporter) {
return icon_bool(true) . __('Supporter');
}
@ -82,7 +82,7 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
{
return page_with_title(sprintf(__('Edit %s'), $angeltype->name), [
buttons([
button(page_link_to('angeltypes'), __('Angeltypes'), 'back')
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back')
]),
msg(),
form([
@ -152,20 +152,20 @@ function AngelType_view_buttons(
$user
) {
$buttons = [
button(page_link_to('angeltypes'), __('Angeltypes'), 'back')
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back')
];
if ($angeltype->requires_driver_license) {
$buttons[] = button(
user_driver_license_edit_link($user),
icon('wallet2') . __('my driving license')
icon('person-vcard') . __('my driving license')
);
}
if (is_null($user_angeltype)) {
$buttons[] = button(
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype->id]),
__('join'),
icon('box-arrow-in-right') . __('join'),
'add'
);
} else {
@ -181,21 +181,21 @@ function AngelType_view_buttons(
}
$buttons[] = button(
page_link_to('user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $user_angeltype['id']]),
__('leave')
icon('box-arrow-right') . __('leave')
);
}
if ($admin_angeltypes || $supporter) {
$buttons[] = button(
page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype->id]),
__('edit'),
icon('pencil') . __('edit'),
'edit'
);
}
if ($admin_angeltypes) {
$buttons[] = button(
page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype->id]),
__('delete'),
icon('trash') . __('delete'),
'delete'
);
}
@ -259,7 +259,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
'user_angeltype_id' => $member['user_angeltype_id'],
'supporter' => 0
]),
__('Remove supporter rights'),
icon('person-fill-down') . __('Remove supporter rights'),
'btn-sm'
)
]);
@ -277,7 +277,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
'user_angeltype_id' => $member['user_angeltype_id'],
'supporter' => 1
]),
__('Add supporter rights'),
icon('person-fill-up') . __('Add supporter rights'),
'btn-sm'
) :
'',
@ -286,7 +286,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
'action' => 'delete',
'user_angeltype_id' => $member['user_angeltype_id']
]),
__('remove'),
icon('trash') . __('remove'),
'btn-sm'
)
]);
@ -529,7 +529,7 @@ function AngelTypes_list_view($angeltypes, bool $admin_angeltypes)
]),
table([
'name' => __('Name'),
'is_restricted' => icon('book') . __('Requires introduction'),
'is_restricted' => icon('mortarboard-fill') . __('Requires introduction'),
'no_self_signup_allowed' => icon('pencil-square') . __('Self Sign Up Allowed'),
'membership' => __('Membership'),
'actions' => ''
@ -561,12 +561,12 @@ function AngelTypes_about_view_angeltype(AngelType $angeltype)
'user_angeltypes',
['action' => 'delete', 'user_angeltype_id' => $angeltype->user_angeltype_id]
),
__('leave')
icon('box-arrow-right') . __('leave')
);
} else {
$buttons[] = button(
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype->id]),
__('join'),
icon('box-arrow-in-right') . __('join'),
'add'
);
}

View File

@ -68,7 +68,7 @@ function public_dashboard_view($stats, $free_shifts)
*/
function public_dashboard_shift_render($shift)
{
$panel_body = icon('clock') . $shift['start'] . ' - ' . $shift['end'];
$panel_body = icon('clock-history') . $shift['start'] . ' - ' . $shift['end'];
$panel_body .= ' (' . $shift['duration'] . '&nbsp;h)';
$panel_body .= '<br>' . icon('list-task') . $shift['shifttype_name'];
@ -76,7 +76,7 @@ function public_dashboard_shift_render($shift)
$panel_body .= ' (' . $shift['title'] . ')';
}
$panel_body .= '<br>' . icon('geo-alt') . $shift['room_name'];
$panel_body .= '<br>' . icon('pin-map-fill') . $shift['room_name'];
foreach ($shift['needed_angels'] as $needed_angels) {
$panel_body .= '<br>' . icon('person')

View File

@ -57,17 +57,17 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
$selected_tab = count($tabs) - 1;
}
return page_with_title(icon('geo-alt') . $room->name, [
return page_with_title(icon('pin-map-fill') . $room->name, [
$assignNotice,
auth()->can('admin_rooms') ? buttons([
button(
page_link_to('admin_rooms', ['show' => 'edit', 'id' => $room->id]),
__('edit'),
icon('pencil') . __('edit'),
'btn'
),
button(
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
__('delete'),
icon('trash') . __('delete'),
'btn'
)
]) : '',
@ -85,8 +85,8 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
function Room_name_render(Room $room)
{
if (auth()->can('view_rooms')) {
return '<a href="' . room_link($room) . '">' . icon('geo-alt') . $room->name . '</a>';
return '<a href="' . room_link($room) . '">' . icon('pin-map-fill') . $room->name . '</a>';
}
return icon('geo-alt') . $room->name;
return icon('pin-map-fill') . $room->name;
}

View File

@ -220,7 +220,7 @@ class ShiftCalendarShiftRenderer
case ShiftSignupState::ANGELTYPE:
if ($angeltype->restricted) {
// User has to be confirmed on the angeltype first
$entry_list[] = $inner_text . icon('book');
$entry_list[] = $inner_text . icon('mortarboard-fill');
} else {
// Add link to join the angeltype first
$entry_list[] = $inner_text . '<br />'

View File

@ -73,12 +73,12 @@ function ShiftType_view(ShiftType $shifttype)
button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
button(
page_link_to('shifttypes', ['action' => 'edit', 'shifttype_id' => $shifttype->id]),
__('edit'),
icon('pencil') . __('edit'),
'edit'
),
button(
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype->id]),
__('delete'),
icon('trash') . __('delete'),
'delete'
)
]),
@ -105,12 +105,12 @@ function ShiftTypes_list_view($shifttypes)
'shifttypes',
['action' => 'edit', 'shifttype_id' => $shifttype->id]
),
__('edit'),
icon('pencil') . __('edit'),
'btn-sm'
),
button(
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype->id]),
__('delete'),
icon('trash') . __('delete'),
'btn-sm'
)
]);

View File

@ -28,7 +28,7 @@ function Shift_view_header($shift, Room $room)
div('col-sm-3 col-xs-6', [
'<h4>' . __('Start') . '</h4>',
'<p class="lead' . (time() >= $shift['start'] ? ' text-success' : '') . '">',
icon('calendar3') . date(__('Y-m-d'), $shift['start']),
icon('calendar-event') . date(__('Y-m-d'), $shift['start']),
'<br />',
icon('clock') . date('H:i', $shift['start']),
'</p>'
@ -36,7 +36,7 @@ function Shift_view_header($shift, Room $room)
div('col-sm-3 col-xs-6', [
'<h4>' . __('End') . '</h4>',
'<p class="lead' . (time() >= $shift['end'] ? ' text-success' : '') . '">',
icon('calendar3') . date(__('Y-m-d'), $shift['end']),
icon('calendar-event') . date(__('Y-m-d'), $shift['end']),
'<br />',
icon('clock') . date('H:i', $shift['end']),
'</p>'
@ -169,7 +169,7 @@ function Shift_view($shift, ShiftType $shifttype, Room $room, $angeltypes_source
$shift_admin ? button(shift_edit_link($shift), icon('pencil') . __('edit')) : '',
$shift_admin ? button(shift_delete_link($shift), icon('trash') . __('delete')) : '',
$admin_shifttypes ? button(shifttype_link($shifttype), $shifttype->name) : '',
$admin_rooms ? button(room_link($room), icon('geo-alt') . $room->name) : '',
$admin_rooms ? button(room_link($room), icon('pin-map-fill') . $room->name) : '',
];
}
$buttons[] = button(user_link(auth()->user()->id), '<span class="icon-icon_angel"></span> ' . __('My shifts'));

View File

@ -103,7 +103,7 @@ function Users_view(
? $user->personalData->planned_departure_date->format(__('Y-m-d')) : '';
$u['last_login_at'] = $user->last_login_at ? $user->last_login_at->format(__('m/d/Y h:i a')) : '';
$u['actions'] = table_buttons([
button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil-square', 'btn-sm')
button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil', 'btn-sm')
]);
$usersList[] = $u;
}
@ -272,9 +272,9 @@ function User_view_myshift($shift, $user_source, $its_me)
}
$myshift = [
'date' => icon('calendar3')
'date' => icon('calendar-event')
. date('Y-m-d', $shift['start']) . '<br>'
. icon('clock') . date('H:i', $shift['start'])
. icon('clock-history') . date('H:i', $shift['start'])
. ' - '
. date('H:i', $shift['end']),
'duration' => sprintf('%.2f', ($shift['end'] - $shift['start']) / 3600) . '&nbsp;h',
@ -305,7 +305,7 @@ function User_view_myshift($shift, $user_source, $its_me)
if ($its_me || auth()->can('user_shifts_admin')) {
$myshift['actions'][] = button(
page_link_to('user_myshifts', ['edit' => $shift['id'], 'id' => $user_source->id]),
icon('pencil-square') . __('edit'),
icon('pencil') . __('edit'),
'btn-sm'
);
}
@ -400,7 +400,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
$actions = table_buttons([
button(
url('/admin/user/' . $worklog->user->id . '/worklog/' . $worklog->id),
icon('pencil-square') . __('edit'),
icon('pencil') . __('edit'),
'btn-sm'
),
button(
@ -412,7 +412,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
}
return [
'date' => icon('calendar3') . date('Y-m-d', $worklog->worked_at->timestamp),
'date' => icon('calendar-event') . date('Y-m-d', $worklog->worked_at->timestamp),
'duration' => sprintf('%.2f', $worklog->hours) . ' h',
'room' => '',
'shift_info' => __('Work log entry'),
@ -511,11 +511,11 @@ function User_view(
) : '',
$admin_user_privilege ? button(
page_link_to('admin_user', ['id' => $user_source->id]),
icon('pencil-square') . __('edit')
icon('pencil') . __('edit')
) : '',
$admin_user_privilege || ($its_me && $needs_drivers_license) ? button(
user_driver_license_edit_link($user_source),
icon('wallet2') . __('driving license')
icon('person-vcard') . __('driving license')
) : '',
(($admin_user_privilege || $auth->can('admin_arrive')) && !$user_source->state->arrived) ?
form([
@ -529,24 +529,24 @@ function User_view(
'users',
['action' => 'edit_vouchers', 'user_id' => $user_source->id]
),
icon('file-binary-fill') . __('Vouchers')
icon('valentine') . __('Vouchers')
)
: '',
$admin_user_worklog_privilege ? button(
url('/admin/user/' . $user_source->id . '/worklog'),
icon('list') . __('worklog.add')
icon('clock-history') . __('worklog.add')
) : '',
$its_me ? button(
page_link_to('settings/profile'),
icon('gear') . __('Settings')
icon('person-fill-gear') . __('Settings')
) : '',
($its_me && $auth->can('ical')) ? button(
page_link_to('ical', ['key' => $user_source->api_key]),
icon('calendar3') . __('iCal Export')
icon('calendar-week') . __('iCal Export')
) : '',
($its_me && $auth->can('shifts_json_export')) ? button(
page_link_to('shifts_json_export', ['key' => $user_source->api_key]),
icon('box-arrow-up-right') . __('JSON Export')
icon('braces') . __('JSON Export')
) : '',
($its_me && (
$auth->can('shifts_json_export')
@ -705,7 +705,7 @@ function User_view_state_admin($freeloader, $user_source)
$availableCount = max($voucherCount, $availableCount);
if ($user_source->state->got_voucher > 0) {
$state[] = '<span class="text-success">'
. icon('file-binary-fill')
. icon('valentine')
. __('Got %s of %s vouchers', [$voucherCount, $availableCount])
. '</span>';
} else {

View File

@ -56,7 +56,7 @@
{% if has_permission_to('faq.edit') %}
<span class="ms-auto">
{{ m.button(m.icon('pencil-square'), url('admin/faq/' ~ item.id), 'secondary', 'sm') }}
{{ m.button(m.icon('pencil'), url('admin/faq/' ~ item.id), 'secondary', 'sm') }}
</span>
{% endif %}
</div>

View File

@ -94,7 +94,7 @@
{% if has_permission_to('admin_news') %}
<div class="ms-auto">
{{ m.button(m.icon('pencil-square'), url('admin/news/' ~ news.id), 'secondary', 'sm') }}
{{ m.button(m.icon('pencil'), url('admin/news/' ~ news.id), 'secondary', 'sm') }}
</div>
{% endif %}
</div>

View File

@ -62,7 +62,7 @@
{% endif %}
{% if has_permission_to('question.edit') %}
{{ m.button(m.icon('pencil-square'), url('admin/questions/' ~ question.id), null, 'sm') }}
{{ m.button(m.icon('pencil'), url('admin/questions/' ~ question.id), null, 'sm') }}
</div>
{% endif %}
</div>