joeni

Add deadline to assignments in course pages

Author
Maarten Vangeneugden
Date
Aug. 24, 2018, 12:49 a.m.
Hash
5cab554537278cad91d9d2b04cf9413883d4769d
Parent
75a3cedc225b0d39f080c4fa7dca9051b974788a
Modified file
courses/templates/courses/course.djhtml

courses/templates/courses/course.djhtml

6 additions and 2 deletions.

View changes Hide changes
1
1
{% load static %}
2
2
{% load i18n %}
3
3
{% load humanize %}
4
4
{% load joeni_org %}
5
5
6
6
{% block title %}
7
7
    {{ course.name }} | {{ block.super }}
8
8
{% endblock %}
9
9
10
10
{% block main %}
11
11
    

{{ course.name }}

12
12
13
13
    

{% trans "Announcements" %}

14
14
    
15
15
    {% for announcement in announcements %}
16
16
        
17
17
            

{{ announcement.title }}

18
18
            
19
19
                {% trans "Posted" %} {{ announcement.posted|naturaltime }}
20
-
            
+
20
            
21
21
            

{{ announcement.text|org }}

22
22
        
23
23
    {% empty %}
24
24
        {% trans "No announcements have been made for this course." %}
25
25
    {% endfor %}
26
26
    
27
27
28
28
    

{% trans "Assignments" %}

29
29
    
30
30
    {% for assignment in assignments %}
31
31
        
32
32
            

{{ assignment.title }}

33
33
            
34
34
                {% trans "Posted" %} {{ assignment.posted|date:"DATE_FORMAT" }} {# {{ assignment.posted|naturaltime }}#}
35
-
            
+
35
            
+
36
            
+
37
                {% trans "Deadline:" %} {{ assignment.deadline|date:"DATE_FORMAT" }}
+
38
            
36
39
            {% if assignment.information %}
+
40
            {% if assignment.information %}
37
41
                

{{ assignment.information|org }}

38
42
            {% endif %}
39
43
            {#{% trans "Posted" %}: {{ assignment.posted|date:"DATE_FORMAT" }}#}
40
44
            {% if assignment.digital_task %}
41
45
                

{% trans "Your uploads" %}

42
46
                {% for upload in uploads %}
43
47
                    {% if upload.assignment ==  assignment %}
44
48
                        {% trans "Uploaded:"%} {{ upload.upload_time|date:"SHORT_DATETIME_FORMAT" }}
45
49
                        {% if upload.comment %}
46
50
                            

{{ upload.comment }}

47
51
                        {% endif %}
48
52
                        {% if upload.upload_time > assignment.deadline %}
49
53
                            {% trans "This upload is overdue." %}
50
54
                        {% endif %}
51
55
                    {% endif %}
52
56
                {% empty %}
53
57
                    {% with now as current_time %}
54
58
                    {% if current_time > assignment.deadline %}
55
59
                        

56
60
                            
57
61
                                {% blocktrans %}
58
62
                                    You have failed to provide an upload for this
59
63
                                    assignment. Any future uploads will be automatically
60
64
                                    overdue.
61
65
                                {% endblocktrans %}
62
66
                            
63
67
                        

64
68
                    {% else %}
65
69
                        

66
70
                            {% blocktrans %}
67
71
                                You haven't uploaded anything for this assignment
68
72
                                yet.
69
73
                            {% endblocktrans %}
70
74
                        

71
75
                    {% endif %}
72
76
                    {% endwith %}
73
77
                {% endfor %}
74
78
                
{% trans "Upload a task" %}
75
79
                
76
80
                    {% csrf_token %} {# todo i don't think that's necessary here #}
77
81
                    {% include "joeni/form.djhtml" with form=upload_form %}
78
82
                    
79
83
                
80
84
            {% endif %}
81
85
        
82
86
    {% endfor %}
83
87
    
84
88
    

{% trans "Course management" %}

85
89
    
95
99
    
96
100
        {% trans "Edit course page" %}
97
101
    
98
102
    {% comment %}
99
103
    
100
104
        {% trans "Student results" %}
101
105
    
102
106
    Uncomment this section when the course results page is finished.
103
107
    {% endcomment %}
104
108
    

{% trans "Students" %}

105
109
    
106
110
        
107
111
            
{% trans "Student name" %}
108
112
            
{% trans "Student number" %}
109
113
            
{% trans "First result" %}
110
114
            
{% trans "Second result" %}
111
115
            
{% trans "Decision" %}
112
116
        
113
117
            {% for student in student_list %}
114
118
                
115
119
                
{{ student.student }}
116
120
                
{{ student.student.number }}
117
121
                
{{ student.first_score|default_if_none:"-" }}
118
122
                
{{ student.second_score|default_if_none:"-" }}
119
123
                
{% with result=student.result %}
120
124
                    {% if result == "CRED" or result == "VRST" or result == "TLRD" or result == "ITLR"%}
121
125
                        
122
126
                    {% elif result == "FAIL" %}
123
127
                        
124
128
                    {% elif result == "BDRG" %}
125
129
                        
126
130
                    {% elif result == "STOP" %}
127
131
                        
128
132
                    {% endif %}
129
133
                    {{ student.get_result_display }}
130
134
                {% endwith %}
131
135
        
132
136
        {% endfor %}
133
137
        
134
138
{% endblock main %}