better shift sign up buttons in shift view

This commit is contained in:
Philip Häusler 2014-12-28 01:27:41 +01:00
parent 502a52394e
commit 0b70fc2a7f
2 changed files with 12 additions and 10 deletions

View File

@ -591,6 +591,7 @@ function view_user_shifts() {
$shifts_row .= $shift['title']; $shifts_row .= $shift['title'];
$shifts_row .= "<br />"; $shifts_row .= "<br />";
} }
$shifts_row .= '</a>';
if (in_array('admin_shifts', $privileges)) if (in_array('admin_shifts', $privileges))
$shifts_row .= ' ' . table_buttons(array( $shifts_row .= ' ' . table_buttons(array(
button(page_link_to('user_shifts') . '&edit_shift=' . $shift['SID'], glyph('edit'), 'btn-xs'), 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 shift admins may join anybody in every shift
$user_may_join_shift |= in_array('user_shifts_admin', $privileges); $user_may_join_shift |= in_array('user_shifts_admin', $privileges);
if ($user_may_join_shift) if ($user_may_join_shift)
$entry_list[] = '<a href="' . page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'] . '">' . $inner_text . '&nbsp;&raquo;</a>'; $entry_list[] = '<a href="' . page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'] . '">' . $inner_text . '</a> ' . button(page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'], _('Sign up'), 'btn-xs');
else { else {
if (time() > $shift['start']) 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'])) elseif ($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && ! isset($angeltype['confirm_user_id']))
$entry_list[] = $inner_text . glyph('lock'); $entry_list[] = $inner_text . glyph('lock');
elseif ($angeltype['restricted'] == 1)
$entry_list[] = $inner_text;
elseif ($collides) elseif ($collides)
$entry_list[] = $inner_text; $entry_list[] = $inner_text;
else else
$entry_list[] = $inner_text . ' <a href="' . page_link_to('user_settings') . '#angel_types_anchor">(Werde ' . $angeltype['name'] . ')</a>'; $entry_list[] = $inner_text . '<br />' . button(page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'], sprintf(_('Become %s'), $angeltype['name']), 'btn-xs');
} }
unset($inner_text); unset($inner_text);
$is_free = true; $is_free = true;
} }
$shifts_row .= '<b>' . $angeltype['name'] . ':</b> '; $shifts_row .= '<strong>'.AngelType_name_render($angeltype) . ':</strong> ';
$shifts_row .= join(", ", $entry_list); $shifts_row .= join(", ", $entry_list);
$shifts_row .= '<br />'; $shifts_row .= '<br />';
} }
if (in_array('user_shifts_admin', $privileges)) { if (in_array('user_shifts_admin', $privileges))
$shifts_row .= '<a href="' . page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'] . '">' . _("Add more angels") . '&nbsp;&raquo;</a>'; $shifts_row .= ' ' . button(page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'], _("Add more angels"), 'btn-xs');
}
} }
if ($shift['own'] && ! in_array('user_shifts_admin', $privileges)) if ($shift['own'] && ! in_array('user_shifts_admin', $privileges))
$class = 'own'; $class = 'own';
@ -791,7 +793,7 @@ function view_user_shifts() {
} elseif ($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && ! isset($angeltype['confirm_user_id'])) { } elseif ($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && ! isset($angeltype['confirm_user_id'])) {
$entry_list[] = $inner_text . glyph("lock"); $entry_list[] = $inner_text . glyph("lock");
} else { } else {
$entry_list[] = $inner_text . ' <a href="' . page_link_to('user_settings') . '#angel_types_anchor">(Werde ' . $angeltype['name'] . ')</a>'; $entry_list[] = $inner_text . ' <a href="' . page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'] . '">' . sprintf(_('Become %s'), $angeltype['name']) . '</a>';
} }
} }
@ -804,7 +806,7 @@ function view_user_shifts() {
$shift_row['entries'] .= '<br />'; $shift_row['entries'] .= '<br />';
} }
if (in_array('user_shifts_admin', $privileges)) { if (in_array('user_shifts_admin', $privileges)) {
$shift_row['entries'] .= '<a href="' . page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'] . '">Weitere Helfer eintragen &raquo;</a>'; $shift_row['entries'] .= '<a href="' . page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'] . '">' . _('Add more angels') . ' &raquo;</a>';
} }
$shifts_table[] = $shift_row; $shifts_table[] = $shift_row;
$shift['angeltypes'] = $angeltypes; $shift['angeltypes'] = $angeltypes;

View File

@ -4,7 +4,7 @@ function Room_name_render($room) {
global $privileges; global $privileges;
if (in_array('admin_rooms', $privileges)) if (in_array('admin_rooms', $privileges))
return '<a href="' . room_link($room) . '">' . glyph('map-marker') . $room['Name'] . '</a>'; return '<a href="' . room_link($room) . '">' . glyph('map-marker') . $room['Name'] . '</a>';
return $room['Name']; return glyph('map-marker') . $room['Name'];
} }
?> ?>