course.html 5.24 KB
Newer Older
Jan's avatar
Jan committed
1
2
3
{% extends 'education/base.html' %}
{% load i18n %}

4
{% block title %}{{ course.name }} — {% trans "Course" %} — {{ block.super }}{% endblock %}
Jan's avatar
Jan committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

{% block body %}
    <h1>{{ course.name }}</h1>
    <div class="type-portfolio type-portfolio-half clearfix">
        <div class="post">
            <div class="row">
                <div class="post-body span8">
                    {% regroup items|dictsortreversed:"year" by year as year_list %}
                    {% if year_list|length  == 0 %}
                        <p><i>{% blocktrans %}Thalia does not have any documents for this course, unfortunately. Are you in possession of exams or summaries for this course? Then let us know or add them to the catalog using the submission page!{% endblocktrans %}</i></p>
                    {% else %}
                        <ul class="toggles">
                            {% for year in year_list %}
                            {% with next_year=year.grouper|add:1|stringformat:"s" %}
                            {% with indicator=year.grouper|stringformat:"s"|add:"-"|add:next_year %}
                                <li id="{{ year.grouper }}">
                                    <div class="toggle-title">
                                        <a name="{{ indicator }}" href="#"><span></span>{{ year.grouper }} - {{ next_year }}</a>
                                    </div>
                                    <div class="toggle-content">
                                        {% regroup year.list by course as course_list %}
                                        {% for course_item in course_list %}
                                        {% regroup course_item.list by type as type_list %}
                                            {% for type in type_list %}
                                            <h5>{% if type.grouper == 'exam' %}{% trans "Exams" %}{% else %}{% trans "Summaries" %}{% endif %}</h5>
                                            <ul class="list-dot">
                                            {% for item in type.list %}
                                                <li>
                                                    {% if item.type == 'exam' %}
                                                        <a href="{% url 'education:exam' item.id %}">{{ item.name }}</a>
                                                    {% else %}
                                                        <a href="{% url 'education:summary' item.id %}">{{ item.name }}</a>
                                                    {% endif %}
                                                </li>
                                            {% endfor %}
                                            </ul>
                                            <br />
                                            {% endfor %}
                                        {% if course_item.grouper != course %}
                                        <div class="alert alert-info1">
                                            <i>{% blocktrans with course_url=course_item.grouper.get_absolute_url course_name=course_item.grouper %}These documents were collected for <a href="{{ course_url }}">{{ course_name }}</a>, a predecessor of this course.{% endblocktrans %}</i>
                                        </div>
                                        {% endif %}
                                        {% endfor %}
                                    </div>
                                </li>
                            {% endwith %}
                            {% endwith %}
                            {% endfor %}
                        </ul>
                    {% endif %}
                </div>
                <div class="post-body span4 row">
                    <p>
                        {% blocktrans with name=course.name trimmed %}
                        This is the overview for <b>{{ name }}</b>. You can find all the exams and summaries that Thalia has here.
                        {% endblocktrans %}
                    </p>
                    <p>
                        {% blocktrans trimmed %}
                        Keep in mind that old exams and summaries may not always test the same material as this year.
                        {% endblocktrans %}
                    </p>

                    <hr class="separator">
                    <ul class="post-meta">
                        <li><span>{% trans "Course code" %}: </span>{{ course.course_code }}</li>
                        <li><span>{% trans "EC" %}: </span>{{ course.ec }}</li>
                        <li><span>{% trans "Period" %}: </span>{{ course.period }}</li>
                    </ul>
                    {% if request.user.is_authenticated %}
                    <hr class="separator">
                    <p>
                        <a href="{% url 'education:submit-exam' course.id %}"><button type="button" class="btn-large btn-style1">{% trans "Submit Exam" %}</button></a>
                    </p>
                    <p>
                        <a href="{% url 'education:submit-summary' course.id %}"><button type="button" class="btn-large btn-style1">{% trans "Submit Summary" %}</button></a>
                    </p>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}