uclouvain/osis-dissertation

View on GitHub
templates/manager_informations_list.html

Summary

Maintainability
Test Coverage
{% extends "layout.html" %}
{% load static %}
{% load i18n %}

{% comment "License" %}
 * OSIS stands for Open Student Information System. It's an application
 * designed to manage the core business of higher education institutions,
 * such as universities, faculties, institutes and professional schools.
 * The core business involves the administration of students, teachers,
 * courses, programs and so on.
 *
 * Copyright (C) 2015-2019 Université catholique de Louvain (http://www.uclouvain.be)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * A copy of this license - GNU General Public License - is available
 * at the root of the source code of this program.  If not,
 * see http://www.gnu.org/licenses/.
{% endcomment %}

{% block style %}
    <link rel="stylesheet" href="{% static 'css/dataTables.bootstrap.min.css' %}">
{% endblock %}

{% block breadcrumb %}
    <li><a href="{% url 'studies' %}" id="lnk_studies">{% trans "Students' path" %}</a></li>
    <li id="lnk_cohorts_management"><a href="{% url 'cohorts_management' %}">{% trans "Cohorts management" %}</a></li>
    <li><a href="{% url 'dissertations' %}" id="lnk_dissertations">{% trans 'Dissertations' %}</a></li>
    <li class="active">{% trans 'Teachers' %}</li>
{% endblock %}
{% block content %}
  <div class="page-header">
    <h2>{% trans 'Teachers' %}</h2>
  </div>
  <ul class="nav nav-tabs">
    <li class="active"><a href={% url 'manager_informations' %}>{% trans 'All teachers' %}</a></li>
    <li><a href="{% url 'manager_informations_list_request' %}">{% trans 'Teachers having to answer request' %}</a></li>
  </ul>
  <div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
             <div class="col-md-12">
                  <a href="{% url 'manager_informations_add' %}" id="lnk_manager_informations_add" class="btn btn-default"
                    role="button" title="{% trans 'Add teacher'%}"><span class="glyphicon glyphicon-plus"
                    aria-hidden="true"></span> {% trans 'Add teacher' %}</a>
             </div>
        </div>
        <br>
        <div class="table-responsive">
            <table class="table table-hover display responsive no-wrap" width="100%" id="table-advisers">
                <thead>
                    <tr>
                        <th>{% trans 'Teachers' %}</th>
                        <th>{% trans 'How many active dissertations for this current academic year (all programs)' %}</th>
                        <th>{% trans 'How many active dissertations (all programs)' %}</th>
                        <th>{% trans 'How many active dissertations (your programs)' %}</th>
                        <th>{% trans 'How many dissertations as promotor' %}</th>
                        <th>{% trans 'How many dissertations as copromotor' %}</th>
                        <th>{% trans 'How many dissertations as reader' %}</th>
                        <th>{% trans 'How many active dissertations as accompanist' %}</th>
                        <th>{% trans 'How many dissertations as internship' %}</th>
                        <th>{% trans 'How many dissertations as president' %}</th>
                        <th>{% trans 'How many dissertations need answer' %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for adviser in advisers %}
                        <tr>
                            <td><a href="{% url 'manager_informations_detail' pk=adviser.pk %}">{{ adviser }}</a></td>
                            <td>{{adviser.dissertations_count_actif_this_academic_year}}</td>
                            <td>{{adviser.dissertations_count_all_actif}}</td>
                            <td>{{adviser.dissertations_count_all_actif_in_your_education_groups}}</td>
                            <td>{{adviser.dissertations_count_promotor_actif}}</td>
                            <td>{{adviser.dissertations_count_copromoteur_actif}}</td>
                            <td>{{adviser.dissertations_count_reader_actif}}</td>
                            <td>{{adviser.dissertations_count_accompanist_actif}}</td>
                            <td>{{adviser.dissertations_count_internship_actif}}</td>
                            <td>{{adviser.dissertations_count_president_actif}}</td>
                            <td>{{adviser.dissertations_count_need_to_respond_actif}}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    </div>
{% endblock %}

{% block script %}
    <script type="text/javascript" src="{% static 'js/jquery.dataTables.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/dataTables.bootstrap.min.js' %}"></script>
    <script>
        $(document).ready(function()
        {
            $('#table-advisers').DataTable(
            {
                "pageLength": 50,
                "paging" : true,
                "ordering" : true,
                "info"  : false,
                "searching" : true,
                "language":
                {
                    "sProcessing":     "{% trans 'Processing...'%}",
                    "sSearch":         "{% trans 'Search:'%}",
                    "sLengthMenu":     "&nbsp;&nbsp;&nbsp;_MENU_ &eacute;l&eacute;ments",
                    "sInfo":           "{% trans 'Showing _START_ to _END_ of _TOTAL_ entries'%}",
                    "sInfoEmpty":      "{% trans 'Showing 0 to 0 of 0 entries'%}",
                    "sInfoFiltered":   "{% trans '(filtered from _MAX_ total entries)'%}",
                    "sInfoPostFix":    "{% trans 'datatable_infopostfix'%}",
                    "sLoadingRecords": "{% trans 'Loading...'%}",
                    "sZeroRecords":    "{% trans 'No matching records found'%}",
                    "sEmptyTable":     "{% trans 'No data available in table'%}",
                    "oPaginate":
                    {
                        "sFirst":      "{% trans 'First'%}",
                        "sPrevious":   "{% trans 'Previous'%}",
                        "sNext":       "{% trans 'Next'%}",
                        "sLast":       "{% trans 'Last'%}"
                    },
                    "oAria":
                    {
                        "sSortAscending":  "{% trans ': activate to sort column ascending'%}",
                        "sSortDescending": "{% trans ': activate to sort column descending'%}",
                    }
                },
                "columns": [
                    null,
                    { "orderable": false },
                    { "orderable": false },
                    { "orderable": true },
                    { "orderable": false },
                    { "orderable": false },
                    { "orderable": false },
                    { "orderable": false },
                    { "orderable": false },
                    { "orderable": false },
                    { "orderable": false }
                ]
            });
        });
    </script>
{% endblock %}