Skip to content

Commit

Permalink
Use Bootstrap's responsive style on tables - refs BT#10856 #ofj
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Feb 23, 2016
1 parent 1c24300 commit 977f9da
Showing 1 changed file with 58 additions and 33 deletions.
91 changes: 58 additions & 33 deletions main/mySpace/myStudents.php
Expand Up @@ -315,7 +315,7 @@ function show_image(image,width,height) {
if (!empty($student_id)) {
// Actions bar
echo '<div class="actions">';
echo '<a href="javascript: window.history.go(-1);" ">'.
echo '<a href="javascript: window.history.go(-1);">'.
Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';

echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Expand Down Expand Up @@ -469,19 +469,18 @@ function show_image(image,width,height) {

echo Display::page_subheader($table_title);

echo '<table width="100%" border="0">';
echo '<tr>';

$userPicture = UserManager::getUserPicture($user_info['user_id']);
echo '<img src="' . $userPicture . '" />';

echo '</td>';
?>
<td width="40%" valign="top">
<table width="100%" class="data_table">
<tr>
<th><?php echo get_lang('Information'); ?></th>
</tr>
<img src="<?php echo $userPicture ?>">
<div class="row">
<div class="col-sm-6">
<table class="table table-striped table-hover">
<thead>
<tr>
<th><?php echo get_lang('Information'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo get_lang('Name') . ' : '.$user_info['complete_name']; ?></td>
</tr>
Expand Down Expand Up @@ -534,14 +533,17 @@ function show_image(image,width,height) {
<?php
}
?>
</tbody>
</table>
</td>

<td class="borderLeft" width="35%" valign="top">
<table width="100%" class="data_table">
</div>
<div class="col-sm-6">
<table class="table table-striped table-hover">
<thead>
<tr>
<th colspan="2"><?php echo get_lang('Tracking'); ?></th>
<th colspan="2" class="text-center"><?php echo get_lang('Tracking'); ?></th>
</tr>
</thead>
<tbody>
<tr><td align="right"><?php echo get_lang('FirstLoginInPlatform') ?></td>
<td align="left"><?php echo $first_connection_date ?></td>
</tr>
Expand Down Expand Up @@ -577,10 +579,10 @@ function show_image(image,width,height) {
echo '</tr>';
}
} ?>
</tbody>
</table>
</td>
</tr>
</table>
</div>
</div>
<?php

$table_title = '';
Expand Down Expand Up @@ -638,7 +640,9 @@ function show_image(image,width,height) {

// Courses
echo '<h3>'.$title.'</h3>';
echo '<table class="data_table courses-tracking">';
echo '<div class="table-respondive">';
echo '<table class="table table-striped table-hover courses-tracking">';
echo '<thead>';
echo '<tr>
<th>'.get_lang('Course').'</th>
<th>'.get_lang('Time').'</th>
Expand All @@ -648,6 +652,8 @@ function show_image(image,width,height) {
<th>'.get_lang('Evaluations').'</th>
<th>'.get_lang('Details').'</th>
</tr>';
echo '</thead>';
echo '<tbody>';

if (!empty($courses)) {
foreach ($courses as $courseId) {
Expand Down Expand Up @@ -727,7 +733,9 @@ function show_image(image,width,height) {
} else {
echo "<tr><td colspan='5'>".get_lang('NoCourse')."</td></tr>";
}
echo '</tbody>';
echo '</table>';
echo '</div>';
}
} else {
if ($user_info['status'] != INVITEE) {
Expand Down Expand Up @@ -768,7 +776,9 @@ function show_image(image,width,height) {
if (count($rs_lp) > 0) {
?>
<!-- LPs-->
<table class="data_table">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th><?php echo get_lang('Learnpaths');?></th>
<th><?php
Expand All @@ -793,6 +803,8 @@ function show_image(image,width,height) {
}
?>
</tr>
</thead>
<tbody>
<?php

$i = 0;
Expand Down Expand Up @@ -935,11 +947,15 @@ function show_image(image,width,height) {
//echo '<tr><td colspan="6">'.get_lang('NoLearnpath').'</td></tr>';
}
?>
</tbody>
</table>
</div>
<?php } ?>
<!-- line about exercises -->
<?php if ($user_info['status'] != INVITEE) { ?>
<table class="data_table">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th><?php echo get_lang('Exercises'); ?></th>
<th><?php echo get_lang('LearningPath');?></th>
Expand All @@ -948,6 +964,8 @@ function show_image(image,width,height) {
<th><?php echo get_lang('LatestAttempt'); ?></th>
<th><?php echo get_lang('AllAttempts'); ?></th>
</tr>
</thead>
<tbody>
<?php

$csv_content[] = array();
Expand Down Expand Up @@ -1052,7 +1070,11 @@ function show_image(image,width,height) {
} else {
echo '<tr><td colspan="6">'.get_lang('NoExercise').'</td></tr>';
}
echo '</table>';
?>
</tbody>
</table>
</div>
<?php
}

//@when using sessions we do not show the survey list
Expand Down Expand Up @@ -1098,8 +1120,16 @@ function show_image(image,width,height) {
}

// line about other tools
echo '<table class="data_table">';

?>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th colspan="2"><?php echo get_lang('OtherTools'); ?></th>
</tr>
</thead>
<tbody>
<?php
$csv_content[] = array ();
$nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $sessionId);
$messages = Tracking::count_student_messages($student_id, $course_code, $sessionId);
Expand Down Expand Up @@ -1137,9 +1167,6 @@ function show_image(image,width,height) {
$chat_last_connection
);
?>
<tr>
<th colspan="2"><?php echo get_lang('OtherTools'); ?></th>
</tr>
<tr><!-- assignments -->
<td width="40%"><?php echo get_lang('Student_publication') ?></td>
<td><?php echo $nb_assignments ?></td>
Expand All @@ -1164,11 +1191,9 @@ function show_image(image,width,height) {
<td><?php echo get_lang('ChatLastConnection') ?></td>
<td><?php echo $chat_last_connection; ?></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>

</div>
<?php
} //end details
}
Expand Down

0 comments on commit 977f9da

Please sign in to comment.