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

4
5
6
7
{% block title %}{{ course.name }} — {% trans "Course" %} —
    {{ block.super }}{% endblock %}
{% block opengraph_title %}{{ course.name }} — {% trans "Course" %} —
    {{ block.super }}{% endblock %}
Jan's avatar
Jan committed
8
9

{% block body %}
10
11
12
13
    <section class="page-section" id="education-course">
        <div class="container">
            <h1 class="text-center section-title">{{ course.name }}</h1>

Jan's avatar
Jan committed
14
            <div class="row">
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
                <div class="col-12 col-md-8">
                    {% if items|length  == 0 %}
                        <p class="text-center">
                            <i>
                                {% blocktrans trimmed %}
                                    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>
Jan's avatar
Jan committed
30
                    {% else %}
31
                        <div class="accordion bordered">
32
                            {% for year, data in items reversed %}
33
34
35
36
37
38
39
                                <div class="card mb-0">
                                    <div class="card-header collapsed"
                                         data-toggle="collapse"
                                         data-target="#year-{{ year }}">
                                        <a href="#year-{{ year }}">
                                            {{ year }} - {{ year|add:1 }}
                                        </a>
Jan's avatar
Jan committed
40
                                    </div>
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
                                    <div
                                        class="collapse"
                                        id="year-{{ year }}"
                                    >
                                        <div class="card-body">
                                            {% if data.legacy %}
                                                <div
                                                    class="alert alert-warning">
                                                    {% blocktrans trimmed with course_url=data.legacy.get_absolute_url course_name=data.legacy.name %}
                                                        These documents were collected for <a href="{{ course_url }}">{{ course_name }}</a>, a
                                                        predecessor of this course.
                                                    {% endblocktrans %}
                                                </div>
                                            {% endif %}

                                            {% if data.exams|length != 0 %}
                                                <h5>{% trans "Exams" %}</h5>
                                                <ul
                                                    {% if data.summaries|length == 0 %}
                                                        class="mb-0"{% endif %}>
                                                    {% for item in data.exams %}
                                                        <li>
                                                            <a href="{% url 'education:exam' item.id %}"
                                                               target="_blank">{{ item.name }}</a>
                                                        </li>
                                                    {% endfor %}
                                                </ul>
                                            {% endif %}

                                            {% if data.summaries|length != 0 %}
                                                <h5>{% trans "Summaries" %}</h5>
                                                <ul class="mb-0">
                                                    {% for item in data.summaries %}
                                                        <li>
                                                            <a href="{% url 'education:summary' item.id %}"
                                                               target="_blank">
                                                                {{ item.name }}
                                                            </a>
                                                        </li>
                                                    {% endfor %}
                                                </ul>
                                            {% endif %}
Jan's avatar
Jan committed
83
84
                                        </div>
                                    </div>
85
                                </div>
Jan's avatar
Jan committed
86
                            {% endfor %}
87
                        </div>
Jan's avatar
Jan committed
88
89
                    {% endif %}
                </div>
90
                <div class="col-12 col-md-4">
Jan's avatar
Jan committed
91
                    <p>
92
93
94
95
                        {% blocktrans trimmed with name=course.name %}
                            This is the overview for <b>{{ name }}</b>. You can
                            find all the exams and summaries that Thalia has
                            here.
Jan's avatar
Jan committed
96
97
98
99
                        {% endblocktrans %}
                    </p>
                    <p>
                        {% blocktrans trimmed %}
100
101
                            Keep in mind that old exams and summaries may not
                            always test the same material as this year.
Jan's avatar
Jan committed
102
103
104
                        {% endblocktrans %}
                    </p>

105
106
107
108
109
110
111
112
113
114
115
116
117
118
                    <hr/>

                    <ul class="list-unstyled">
                        <li>
                            <strong>{% trans "Course code" %}: </strong>
                            {{ course.course_code }}
                        </li>
                        <li><strong>{% trans "EC" %}: </strong>
                            {{ course.ec }}
                        </li>
                        <li>
                            <strong>{% trans "Period" %}: </strong>
                            {{ course.period }}
                        </li>
Jan's avatar
Jan committed
119
                    </ul>
120

Jan's avatar
Jan committed
121
                    {% if request.user.is_authenticated %}
122
123
124
125
126
127
128
129
130
                        <hr>
                        <a href="{% url 'education:submit-exam' course.id %}"
                           class="btn btn-primary">
                            {% trans "Submit Exam" %}
                        </a>
                        <a href="{% url 'education:submit-summary' course.id %}"
                           class="btn btn-primary">
                            {% trans "Submit Summary" %}
                        </a>
Jan's avatar
Jan committed
131
132
133
134
                    {% endif %}
                </div>
            </div>
        </div>
135
    </section>
136
{% endblock %}