Tidy up formatting of study week group table

This commit is contained in:
2014-01-31 16:34:00 +11:00
parent 14303f8069
commit 9d936bab1b
2 changed files with 21 additions and 2 deletions

View File

@@ -471,6 +471,7 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
$form = array();
$options = array();
$last_session = "";
//attach the custom css
$form['#attached']['css'] = array(
@@ -530,7 +531,7 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
foreach($result as $data)
{
//watchdog('booking', 'Study groups raw data: @info', array ('@info' => var_export($data, TRUE)));
$class = "";
//apply theme as required
if ($data->booking_is_leader == 1)
@@ -539,7 +540,18 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
$class = "helper-row";
else
$class = "normal-row";
//Add a different id for first entry of new session, with a border-top to distinguish it
if ($last_session <> $data->booking_session_id && $last_session <> "")
{
if ($class === "leader-row")
$class = "leader-new-group-row";
elseif ($class === "helper-row")
$class = "helper-new-group-row";
else
$class = "new-group-row";
}
$options[$data->nid] = array (
'booking_session_id' => $data->booking_session_id,
'booking_name' => $data->booking_firstname . " " . $data->booking_lastname,
@@ -547,6 +559,8 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
'booking_is_helper' => $data->booking_is_helper == 1 ? 'Yes' : 'No',
'#attributes' => array('id' => array($class))
);
$last_session = $data->booking_session_id;
}
$prefix = t("<h2>Study Group !descrip</h2>", array('!descrip' => $group->booking_studygroup_descrip));