Tidy up formatting of study week group table
This commit is contained in:
5
booking.css
Normal file
5
booking.css
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#leader-row {background: #6495ED;}
|
||||||
|
#helper-row {background: #6495ED;}
|
||||||
|
#new-group-row {border-top: thick double #ff0000;}
|
||||||
|
#leader-new-group-row {background: #6495ED; border-top: thick double #ff0000;}
|
||||||
|
#helper-new-group-row {background: #6495ED; border-top: thick double #ff0000;}
|
@@ -471,6 +471,7 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
|
|||||||
|
|
||||||
$form = array();
|
$form = array();
|
||||||
$options = array();
|
$options = array();
|
||||||
|
$last_session = "";
|
||||||
|
|
||||||
//attach the custom css
|
//attach the custom css
|
||||||
$form['#attached']['css'] = array(
|
$form['#attached']['css'] = array(
|
||||||
@@ -530,7 +531,7 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
|
|||||||
|
|
||||||
foreach($result as $data)
|
foreach($result as $data)
|
||||||
{
|
{
|
||||||
//watchdog('booking', 'Study groups raw data: @info', array ('@info' => var_export($data, TRUE)));
|
$class = "";
|
||||||
|
|
||||||
//apply theme as required
|
//apply theme as required
|
||||||
if ($data->booking_is_leader == 1)
|
if ($data->booking_is_leader == 1)
|
||||||
@@ -539,7 +540,18 @@ function booking_studygroups_view_form($node, &$form_state, $single_view, $group
|
|||||||
$class = "helper-row";
|
$class = "helper-row";
|
||||||
else
|
else
|
||||||
$class = "normal-row";
|
$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 (
|
$options[$data->nid] = array (
|
||||||
'booking_session_id' => $data->booking_session_id,
|
'booking_session_id' => $data->booking_session_id,
|
||||||
'booking_name' => $data->booking_firstname . " " . $data->booking_lastname,
|
'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',
|
'booking_is_helper' => $data->booking_is_helper == 1 ? 'Yes' : 'No',
|
||||||
'#attributes' => array('id' => array($class))
|
'#attributes' => array('id' => array($class))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$last_session = $data->booking_session_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$prefix = t("<h2>Study Group !descrip</h2>", array('!descrip' => $group->booking_studygroup_descrip));
|
$prefix = t("<h2>Study Group !descrip</h2>", array('!descrip' => $group->booking_studygroup_descrip));
|
||||||
|
Reference in New Issue
Block a user