From 0b70fc2a7fe400cdea6d6106fe5e36fc38de1ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Sun, 28 Dec 2014 01:27:41 +0100 Subject: [PATCH] better shift sign up buttons in shift view --- includes/pages/user_shifts.php | 20 +++++++++++--------- includes/view/Rooms_view.php | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index d3acf2e8..44cf12c2 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -591,6 +591,7 @@ function view_user_shifts() { $shifts_row .= $shift['title']; $shifts_row .= "
"; } + $shifts_row .= ''; if (in_array('admin_shifts', $privileges)) $shifts_row .= ' ' . table_buttons(array( button(page_link_to('user_shifts') . '&edit_shift=' . $shift['SID'], glyph('edit'), 'btn-xs'), @@ -652,29 +653,30 @@ function view_user_shifts() { // User shift admins may join anybody in every shift $user_may_join_shift |= in_array('user_shifts_admin', $privileges); if ($user_may_join_shift) - $entry_list[] = '' . $inner_text . ' »'; + $entry_list[] = '' . $inner_text . ' ' . button(page_link_to('user_shifts') . '&shift_id=' . $shift['SID'] . '&type_id=' . $angeltype['id'], _('Sign up'), 'btn-xs'); else { if (time() > $shift['start']) - $entry_list[] = $inner_text . ' (vorbei)'; + $entry_list[] = $inner_text . ' (' . _('ended') . ')'; elseif ($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && ! isset($angeltype['confirm_user_id'])) $entry_list[] = $inner_text . glyph('lock'); + elseif ($angeltype['restricted'] == 1) + $entry_list[] = $inner_text; elseif ($collides) $entry_list[] = $inner_text; else - $entry_list[] = $inner_text . ' (Werde ' . $angeltype['name'] . ')'; + $entry_list[] = $inner_text . '
' . button(page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'], sprintf(_('Become %s'), $angeltype['name']), 'btn-xs'); } unset($inner_text); $is_free = true; } - $shifts_row .= '' . $angeltype['name'] . ': '; + $shifts_row .= ''.AngelType_name_render($angeltype) . ': '; $shifts_row .= join(", ", $entry_list); $shifts_row .= '
'; } - if (in_array('user_shifts_admin', $privileges)) { - $shifts_row .= '' . _("Add more angels") . ' »'; - } + if (in_array('user_shifts_admin', $privileges)) + $shifts_row .= ' ' . button(page_link_to('user_shifts') . '&shift_id=' . $shift['SID'] . '&type_id=' . $angeltype['id'], _("Add more angels"), 'btn-xs'); } if ($shift['own'] && ! in_array('user_shifts_admin', $privileges)) $class = 'own'; @@ -791,7 +793,7 @@ function view_user_shifts() { } elseif ($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && ! isset($angeltype['confirm_user_id'])) { $entry_list[] = $inner_text . glyph("lock"); } else { - $entry_list[] = $inner_text . ' (Werde ' . $angeltype['name'] . ')'; + $entry_list[] = $inner_text . ' ' . sprintf(_('Become %s'), $angeltype['name']) . ''; } } @@ -804,7 +806,7 @@ function view_user_shifts() { $shift_row['entries'] .= '
'; } if (in_array('user_shifts_admin', $privileges)) { - $shift_row['entries'] .= 'Weitere Helfer eintragen »'; + $shift_row['entries'] .= '' . _('Add more angels') . ' »'; } $shifts_table[] = $shift_row; $shift['angeltypes'] = $angeltypes; diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php index bb41a4d3..e1d411cb 100644 --- a/includes/view/Rooms_view.php +++ b/includes/view/Rooms_view.php @@ -4,7 +4,7 @@ function Room_name_render($room) { global $privileges; if (in_array('admin_rooms', $privileges)) return '' . glyph('map-marker') . $room['Name'] . ''; - return $room['Name']; + return glyph('map-marker') . $room['Name']; } ?> \ No newline at end of file