Skip to content
Snippets Groups Projects
bill.twig 2.54 KiB
Newer Older
<table class="equal-width-cols">
    <tbody>
    <tr class="RatingTableModulesHead">
        <td class="student_td title">&nbsp;</td>
        {% for dis in GlobalDisciplines %}
            <td class="title">
                {{ HTML.anchor('#', dis.SubjectName ~ '(межфакультетская дисциплина)', {'title': dis.SubjectName  ~ '(межфакультетская дисциплина)' })|raw }}
            </td>
        {% endfor %}
        {% for dis in Disciplines %}
            {% if not dis.IsGlobal %}
                <td class="title">
                    {% if dis.CompoundDiscID %}
                        {{ HTML.anchor('/compound_disciplines/' ~ dis.CompoundDiscID,
                            dis.CompoundDiscName, {'title': dis.CompoundDiscName })|raw }}
                    {% else %}
                        {{ HTML.anchor('/discipline/' ~ dis.ID ~ '/rate', dis.SubjectName, {'title': dis.SubjectName })|raw }}
                    {% endif %}
                </td>
            {% endif %}

    {% set typeClasses = ['success_rate', 'debt_rate', 'repass_rate', 'absent_rate'] %}
    {% for stud in Students %}
            <td class="student_td">{{ stud.FullName }} </td>
            {% for disc in GlobalDisciplines %}
                {% set id = GlobalDisciplines[disc.ID][stud.ID] %}
                {% set rate = Rates[stud.ID][id] %}
                {% if rate %}
                    <td>
                        {{ HTML.anchor('/discipline/' ~ id ~ '/rate',
                            '☞<div class = ' ~ typeClasses[rate.Type] ~ '>' ~ rate.rating ~ '</div>',
                            {
                                'title': Disciplines[id].GlobalName,
                                'target': '_blank'
                            })|raw }}
                    </td>
                {% endif %}
            {% endfor %}
            {% for disc in Disciplines %}
                {% if not disc.IsGlobal %}
                    {% set id = -disc.CompoundDiscID ?: disc.ID %}
                    {% set rate = Rates[stud.ID][id] %}
                    {% if rate %}
                        <td class="{{ typeClasses[rate.Type] }}">{{ rate.rating }}</td>
                    {% else %}
                        <td class="absent_rate"> -</td>
                    {% endif %}
dmitry.s's avatar
dmitry.s committed
            {% endfor %}
        </tr>