Skip to content
Open

ui #170

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Django==3.0.7
coverage
pyaml
django-recurrence
asgiref==3.9.1
coverage==7.10.6
Django==4.2.24
django-recurrence==1.11.1
numpy==2.0.2
pandas==2.3.2
pyaml==25.7.0
python-dateutil==2.9.0.post0
python-decouple==3.3
pandas
pytz==2025.2
PyYAML==6.0.2
six==1.17.0
sqlparse==0.5.3
typing_extensions==4.15.0
tzdata==2025.2
13 changes: 7 additions & 6 deletions statistics_app/templates/statistics_app/paginator.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<ul class="pagination pagination">
<ul class="pagination justify-content-center" style="margin:1em 0;">
{% if objects.has_previous %}
<li class="page-item">
<a class="page-link" href="?page=1{% if request.GET.from_date %}&from_date={{ request.GET.from_date }}{% endif %}{% if request.GET.to_date %}&to_date={{ request.GET.to_date }}{% endif %}{% if request.GET.state %}&state={{ request.GET.state }}{% endif %}{% if request.GET.workshop_type %}&workshop_type={{ request.GET.workshop_type }}{% endif %}{% if request.GET.show_workshops %}&show_workshops={{ request.GET.show_workshops }}{% endif %}{% if request.GET.sort %}&sort={{ request.GET.sort }}{% endif %}
" aria-label="Previous">
<a class="page-link rounded-pill bg-gradient-info text-white mx-1" style="box-shadow:0 2px 8px rgba(37,117,252,0.10);" href="?page=1{% if request.GET.from_date %}&from_date={{ request.GET.from_date }}{% endif %}{% if request.GET.to_date %}&to_date={{ request.GET.to_date }}{% endif %}{% if request.GET.state %}&state={{ request.GET.state }}{% endif %}{% if request.GET.workshop_type %}&workshop_type={{ request.GET.workshop_type }}{% endif %}{% if request.GET.show_workshops %}&show_workshops={{ request.GET.show_workshops }}{% endif %}{% if request.GET.sort %}&sort={{ request.GET.sort }}{% endif %}" aria-label="Previous">
<span aria-hidden="true">
<i class="fa fa-angle-double-left"></i>
</span>
Expand All @@ -14,16 +13,18 @@
{% for n in objects.paginator.page_range %}
{% if objects.number == n %}
<li class="page-item active">
<span class="page-link">{{ n }}<span class="sr-only">(current)</span></span>
<span class="page-link rounded-pill bg-gradient-info text-white mx-1" style="font-weight:700; box-shadow:0 2px 8px rgba(37,117,252,0.18);">{{ n }}<span class="sr-only">(current)</span></span>
</li>
{% elif n > objects.number|add:'-5' and n < objects.number|add:'5' %}
<li class="page-item"><a class="page-link" href="?page={{ n }}{% if request.GET.from_date %}&from_date={{ request.GET.from_date }}{% endif %}{% if request.GET.to_date %}&to_date={{ request.GET.to_date }}{% endif %}{% if request.GET.state %}&state={{ request.GET.state }}{% endif %}{% if request.GET.workshop_type %}&workshop_type={{ request.GET.workshop_type }}{% endif %}{% if request.GET.show_workshops %}&show_workshops={{ request.GET.show_workshops }}{% endif %}{% if request.GET.sort %}&sort={{ request.GET.sort }}{% endif %}">{{ n }}</a></li>
<li class="page-item">
<a class="page-link rounded-pill mx-1" style="transition:background 0.2s;" href="?page={{ n }}{% if request.GET.from_date %}&from_date={{ request.GET.from_date }}{% endif %}{% if request.GET.to_date %}&to_date={{ request.GET.to_date }}{% endif %}{% if request.GET.state %}&state={{ request.GET.state }}{% endif %}{% if request.GET.workshop_type %}&workshop_type={{ request.GET.workshop_type }}{% endif %}{% if request.GET.show_workshops %}&show_workshops={{ request.GET.show_workshops }}{% endif %}{% if request.GET.sort %}&sort={{ request.GET.sort }}{% endif %}">{{ n }}</a>
</li>
{% endif %}
{% endfor %}

{% if objects.has_next %}
<li class="page-item">
<a class="page-link" href="?page={{ objects.paginator.num_pages }}{% if request.GET.from_date %}&from_date={{ request.GET.from_date }}{% endif %}{% if request.GET.to_date %}&to_date={{ request.GET.to_date }}{% endif %}{% if request.GET.state %}&state={{ request.GET.state }}{% endif %}{% if request.GET.workshop_type %}&workshop_type={{ request.GET.workshop_type }}{% endif %}{% if request.GET.show_workshops %}&show_workshops={{ request.GET.show_workshops }}{% endif %}{% if request.GET.sort %}&sort={{ request.GET.sort }}{% endif %}" aria-label="Next">
<a class="page-link rounded-pill bg-gradient-info text-white mx-1" style="box-shadow:0 2px 8px rgba(37,117,252,0.10);" href="?page={{ objects.paginator.num_pages }}{% if request.GET.from_date %}&from_date={{ request.GET.from_date }}{% endif %}{% if request.GET.to_date %}&to_date={{ request.GET.to_date }}{% endif %}{% if request.GET.state %}&state={{ request.GET.state }}{% endif %}{% if request.GET.workshop_type %}&workshop_type={{ request.GET.workshop_type }}{% endif %}{% if request.GET.show_workshops %}&show_workshops={{ request.GET.show_workshops }}{% endif %}{% if request.GET.sort %}&sort={{ request.GET.sort }}{% endif %}" aria-label="Next">
<span aria-hidden="true">
<i class="fa fa-angle-double-right"></i>
</span>
Expand Down
170 changes: 102 additions & 68 deletions statistics_app/templates/statistics_app/profile_stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,75 +37,109 @@


{% block content %}
<div class="container">
<div class="row">
<div class="col-md-6" align="left" >
<fieldset data-mini="true">
<label for="radio-1">Instructor Statistics </label>
<input type="radio" name="radio-1" id="radio-1" value="IP">
<label for="radio-2">Coordinator Statistics</label>
<input type="radio" name="radio-1" id="radio-2" value="CP">
</fieldset>
<div class="container py-4">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="card shadow-lg mb-4">
<div class="card-header bg-gradient-info text-white d-flex align-items-center" style="border-radius:1em 1em 0 0;">
<span class="material-icons mr-2">bar_chart</span>
<h4 class="mb-0">Profile Statistics</h4>
</div>
<div class="card-body">
<div class="d-flex justify-content-center mb-4">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-outline-info active" id="label-instructor">
<input type="radio" name="radio-1" id="radio-1" value="IP" autocomplete="off"> Instructor Statistics
</label>
<label class="btn btn-outline-info ml-2" id="label-coordinator">
<input type="radio" name="radio-1" id="radio-2" value="CP" autocomplete="off"> Coordinator Statistics
</label>
</div>
</div>
<!-- Instructor Data Table -->
<div id="instructor_data" style="display: none;">
<table class="table table-hover table-responsive-sm mb-0">
<thead class="bg-gradient-info text-white">
<tr>
<th>#</th>
<th>Username</th>
<th>Full Name</th>
<th>Institute Name</th>
<th>Phone Number</th>
<th>Workshop Count</th>
</tr>
</thead>
{% csrf_token %}
{% for profile_data in instructor_data %}
<tbody>
<tr>
<td>{{ forloop.counter}}</td>
<td>{{ profile_data.profile.user}}</td>
<td>{{ profile_data.profile.user.first_name}} {{ profile_data.profile.user.last_name}}</td>
<td>{{ profile_data.profile.institute}}</td>
<td>{{ profile_data.profile.phone_number}}</td>
<td>{{ profile_data.count}}</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
<!-- Coordinator Data Table -->
<div id="coordinator_data" style="display: none;">
<table class="table table-hover table-responsive-sm mb-0">
<thead class="bg-gradient-info text-white">
<tr>
<th>#</th>
<th>Name</th>
<th>Institute Name</th>
<th>Phone Number</th>
<th>Registration Date</th>
<th>Workshop Count</th>
</tr>
</thead>
{% csrf_token %}
{% for profile_data in coordinator_data %}
<tbody>
{% if profile_data.count > 0 %}
<tr>
<td>{{ forloop.counter }}</td>
<td><a href="{{ URL_ROOT }}/view_comment_profile/{{ profile_data.profile.user.id }}" class="text-info font-weight-bold">
{{ profile_data.profile.user.get_full_name }}</a></td>
<td>{{ profile_data.profile.institute}}</td>
<td>{{ profile_data.profile.phone_number}}</td>
<td>{{ profile_data.profile.user.date_joined | date}}</td>
<td>{{ profile_data.count}}</td>
</tr>
{% endif %}
</tbody>
{% endfor %}
</table>
</div>
</div>
</div>
<br>
<br>
<!-- Instructor Data Table -->
<table class="table" id="instructor_data" style="display: none">
<thead>
<tr>
<th></th>
<th>username</th>
<th>Full Name</th>
<th>Institute Name</th>
<th>Phone Number</th>
<th>Workshop Count</th>
</tr>
</thead>
{% csrf_token %}
{% for profile_data in instructor_data %}
<tbody>
<tr>
<td>{{ forloop.counter}}</td>
<td>{{ profile_data.profile.user}}</td>
<td>{{ profile_data.profile.user.first_name}} {{ profile_data.profile.user.last_name}}</td>
<td>{{ profile_data.profile.institute}}</td>
<td>{{ profile_data.profile.phone_number}}</td>
<td>{{ profile_data.count}}</td>
</tr>
</tbody>
{% endfor %}
</table>

<!-- Coordinator Data Table -->
<table class="table" id="coordinator_data" style="display: none">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Institute Name</th>
<th>Phone Number</th>
<th>Registration Date</th>
<th>Workshop Count</th>
</tr>
</thead>
{% csrf_token %}
{% for profile_data in coordinator_data %}
<tbody>
{% if profile_data.count > 0 %}
<tr>
<td>{{ forloop.counter }}</td>
<td><a href="{{ URL_ROOT }}/view_comment_profile/{{ profile_data.profile.user.id }}">
{{ profile_data.profile.user.get_full_name }}</a></td>
<td>{{ profile_data.profile.institute}}</td>
<td>{{ profile_data.profile.phone_number}}</td>
<td>{{ profile_data.profile.user.date_joined | date}}</td>
<td>{{ profile_data.count}}</td>
</tr>
{% endif %}
</tbody>
{% endfor %}
</table>
</div>
</div>

</div>
<script>
$(document).ready(function() {
// Default: show instructor table
$('#instructor_data').show();
$('#radio-1').prop('checked', true);
$('#label-instructor').addClass('active');
$('#label-coordinator').removeClass('active');
$('input[type=radio][name=radio-1]').change(function() {
if (this.value == "CP") {
$('#instructor_data').hide();
$('#coordinator_data').show();
$('#label-instructor').removeClass('active');
$('#label-coordinator').addClass('active');
} else {
$('#instructor_data').show();
$('#coordinator_data').hide();
$('#label-instructor').addClass('active');
$('#label-coordinator').removeClass('active');
}
});
});
</script>
{% endblock %}
65 changes: 43 additions & 22 deletions statistics_app/templates/statistics_app/team_stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,65 @@
{% endblock %}

{% block content %}

<div class="container-fluid">
<div class="container-fluid py-4" style="background: linear-gradient(120deg, #f6d365 0%, #fda085 100%); min-height: 80vh;">
<div class="row">
<div class="col-md-2">
<ul class="nav nav-pills list-group">
{% for team in all_teams %}
<li class="nav-item">
<a href="{% url 'statistics_app:team' team.id %}" class="nav-link list-group-item">
Team {{forloop.counter}}
</a>
</li>
{% endfor %}
</ul>
<div class="col-md-3 mb-4">
<div class="card shadow-lg">
<div class="card-header bg-gradient-info text-white" style="border-radius:1em 1em 0 0;">
<span class="material-icons mr-2">groups</span>
<h5 class="mb-0 d-inline">Teams</h5>
</div>
<ul class="nav nav-pills flex-column p-3">
{% for team in all_teams %}
<li class="nav-item mb-2">
<a href="{% url 'statistics_app:team' team.id %}" class="nav-link btn btn-outline-info w-100 text-left" style="border-radius:0.7em; font-weight:600;">
<span class="material-icons" style="vertical-align:middle;">group</span> Team {{forloop.counter}}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="col-md-8">
<br>
<canvas id="myChart"></canvas>
<div class="col-md-9">
<div class="card shadow-lg">
<div class="card-header bg-gradient-info text-white" style="border-radius:1em 1em 0 0;">
<span class="material-icons mr-2">bar_chart</span>
<h5 class="mb-0 d-inline">Team Members Workshops</h5>
</div>
<div class="card-body">
<canvas id="myChart"></canvas>
</div>
</div>
</div>
</div>
</div>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'bar',

// The data for our dataset
data: {
labels: {{team_labels|safe}},
datasets: [{
data: {{ws_count|safe}},
label: "Team Members Workshops",
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
backgroundColor: 'rgba(37,117,252,0.7)',
borderColor: 'rgba(37,117,252,1)',
}]
},
// Configuration options go here
options: {}
options: {
responsive: true,
legend: { display: false },
scales: {
xAxes: [{
gridLines: { display: false },
ticks: { fontColor: '#2575fc' }
}],
yAxes: [{
gridLines: { color: '#eee' },
ticks: { fontColor: '#2575fc', beginAtZero: true }
}]
}
}
});
</script>
{% endblock %}
Loading