Skip to content
Permalink
Browse files

improvement in user summary - refs #7681

  • Loading branch information...
aragonc committed Apr 11, 2019
1 parent 53bc13e commit c68ccd9f7a637b992d7269d15c62cf1a574d8c1b
@@ -9797,10 +9797,157 @@ ul.dropdown-menu.inner > li > a {
position: relative;
}

/* Fix grid with one row and multiples columns. Works for .col-sm-6.col-md-4.col-lg-3 */
.row.clear-rows-6-4-3 {
.summary-height{
height: calc(100% - 20px);
display: flex;
flex-grow: 1;
flex-direction: column;
box-shadow: 0 0 13px 0 rgba(82,63,105,0.05);
margin-bottom: 20px;
border-radius: 4px;
border: 1px solid #cdcdcd;
}
.summary{
padding: 0;
height: 100%;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
flex-direction: row;
width: 100%;
}
.summary-body{
flex-grow: 1;
padding-left: 10px !important;
padding-right: 10px !important;
margin-top: 15px !important;
}
.summary-item{
display: flex;
-webkit-box-pack: justify;
justify-content: flex-start;
-webkit-box-align: center;
align-items: center;
padding-bottom: 2rem;

}
.summary-item .icon{
padding-right: 1.25rem;
}
.summary-item .icon img{
border: 1px solid #cdcdcd;
}
.summary-item .user .username{
font-size: 12px;
}
.summary-item .user .name{
color: #6c7293;
font-size: 1.56rem;
font-weight: 500;
padding-right: 1.25rem;
margin-top: 1rem;
display: inline-block;
flex-grow: 1;
transition: color 0.3s ease;
}
.summary-item .user .name:hover{
color: #366cf3;
transition: color 0.3s ease;
}
.summary-item .user{
width: 14%;
}
.summary-item .summary-course{
width: 80%;
}
.summary-item .summary-course .alert{
margin-bottom: 0;
}
.summary-item .summary-course .course-item{
padding-bottom: 1rem;
padding-top: 1rem;
border-bottom: 1px dashed #cdcdcd;
display: flex;
flex-wrap: nowrap;
}
.summary-item .summary-course .course-item:last-child{
border-bottom: none;
}
.summary-item .summary-course .course-item .course-info{
margin-right: 20px;
width: 30%;
}
.summary-item .summary-course .course-item .course-info h5{
font-weight: bold;
padding: 0;
margin: 0;
}
.summary-item .summary-course .course-item .course-info .code{
font-size: 12px;
}
.summary-item .summary-course .course-item .box{
width: 10%;
text-align: center;
line-height: 50px;
margin-right: 5px;
font-size: 12px;
border-radius: 5px;
}
.summary-item .summary-course .course-item .box .kt-badge{
height: 0;
width: auto;
padding: 0.5rem 0.5rem;
border-radius: 2px;
font-weight: bold;
}
.summary-legend{
padding: 10px 0;
margin-bottom: 2rem;
}
.summary-legend .list-legend{
margin: 0;
padding: 0;
list-style: none;
}
.summary-legend .list-legend li{
display: inline-block;
font-size: 12px;
}
.summary-legend .cube{
width: 13px;
height: 13px;
display: inline-block;
margin-right: 2px;
border-radius: 2px;
border: 1px solid;
}
.student-progress{
color: #366cf3;
background: rgba(54,108,243,0.35);
}
.student-score{
color: #1dc9b7;
background: rgba(29,201,183,0.35);
}
.student-message{
color: #fd397a;
background: rgba(253,57,122,0.35);
}
.student-assignments{
color: #ffb822;
background: rgba(255,184,34,0.35);
}
.student-exercises{
background-color: #83af3d3b !important;
color: #4f9c53;
}
.questions-answered{
background-color: #fb5f0442 !important;
color: #FF5722;
}
.last-connection{
color: #2196f3;
background: rgba(57, 217, 253, 0.35);
}
@media (min-width: 768px) {
.clear-rows-6-4-3 .col-sm-6:nth-child(2n+1) {
clear: left;
@@ -358,7 +358,7 @@ public static function returnCourseTrackingFilter($user_id){
'student_progress' => round(Tracking::get_avg_student_progress($user_id, $courseCode)),
'student_score' => $avg_score,
'student_message' => Tracking::count_student_messages($user_id, $courseCode),
'student assignments' => Tracking::count_student_assignments($user_id, $courseCode),
'student_assignments' => Tracking::count_student_assignments($user_id, $courseCode),
'student_exercises' => (is_null($exercises_results['percentage']) ? '' : $exercises_results['score_obtained'].'/'.$exercises_results['score_possible'].' ( '.$exercises_results['percentage'].'% )'),
'questions_answered' => $exercises_results['questions_answered'],
'last_connection' => Tracking::get_last_connection_date_on_the_course($user_id, $courseInfo)
@@ -387,12 +387,14 @@ public static function returnTrackingUserOverview(){
$list = [];
foreach ($dataUser as $item){
$avatar = UserManager::getUserPicture($item['col4'],USER_IMAGE_SIZE_SMALL);
$listUser = [
'id' => $item['col4'],
'code_user' => $item['col0'],
'complete_name' => $item['col1'] . ' ' . $item['col2'],
'username' => $item['col3'],
'course' => self::returnCourseTrackingFilter($item['col4'])
'course' => self::returnCourseTrackingFilter($item['col4']),
'avatar' => $avatar
];
$list [] = $listUser;
}
@@ -1,3 +1,118 @@
<div class="summary-legend">
<ul class="list-legend">
<li>
<span class="cube student-progress">
</span>
{{ 'AvgStudentsProgress'|get_lang }}
</li>
<li>
<span class="cube student-score">
</span>
{{ 'AvgCourseScore'|get_lang }}
</li>
<li>
<span class="cube student-message">
</span>
{{ 'TotalNumberOfMessages'|get_lang }}
</li>
<li>
<span class="cube student-assignments">
</span>
{{ 'TotalNumberOfAssignments'|get_lang }}
</li>
<li>
<span class="cube student-exercises">
</span>
{{ 'TotalExercisesScoreObtained'|get_lang }}
</li>
<li>
<span class="cube questions-answered">
</span>
{{ 'TotalExercisesAnswered'|get_lang }}
</li>
<li>
<span class="cube last-connection">
</span>
{{ 'LatestLogin'|get_lang }}
</li>
</ul>
</div>

{% for item in data %}
{{ dump(item) }}
{% endfor %}
<div class="summary-height">
<div class="summary">
<div class="summary-body">
<div id="summary-user-{{ item.id }}" class="summary-item">
<div class="icon">
<img src="{{ item.avatar }}" class="img-circle">
</div>
<div class="user">
<a href="#" class="name">
{{ item.complete_name }}
</a>
<div class="username">{{ item.username }}</div>
</div>

<div class="summary-course">
{% if item.course %}
{% for course in item.course %}
<div id="course-{{ course.real_id }}" class="course-item">
<div class="course-info">
<h5>{{ course.title }}</h5>
<span class="code">{{ course.code }}</span>
</div>
<div class="box time-spent">
<i class="fa fa-clock-o" aria-hidden="true"></i>
{{ course.time_spent }}
</div>
<div class="box">
<span class="kt-badge student-progress">
{{ course.student_progress }} %
</span>
</div>
<div class="box">
<span class="kt-badge student-score">
{{ course.student_score }}
</span>
</div>
<div class="box">
<span class="kt-badge student-message">
{{ course.student_message }}
</span>
</div>
<div class="box">
<span class="kt-badge student-assignments">
{{ course.student_assignments }}
</span>
</div>
<div class="box">
<span class="kt-badge student-exercises">
{{ course.student_assignments }}
</span>
</div>
<div class="box">
<span class="kt-badge questions-answered">
{{ course.questions_answered }}
</span>
</div>
<div class="box">
{% if course.last_connection %}
<span class="kt-badge last-connection">
{{ course.last_connection }}
</span>
{% endif %}
</div>
</div>
{% endfor %}
{% else %}
<div class="alert alert-warning" role="alert">
Sin registros
</div>
{% endif %}
</div>

</div>
</div>
</div>
</div>
{% endfor %}

0 comments on commit c68ccd9

Please sign in to comment.
You can’t perform that action at this time.