-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathuser.html
More file actions
97 lines (96 loc) · 4.5 KB
/
user.html
File metadata and controls
97 lines (96 loc) · 4.5 KB
1
2
3
4
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
89
90
91
92
93
94
95
96
97
{% extends 'base.html' %}
{% block page_content %}
<div id="page-user" data-user="{{ user.id }}" data-role="{{ current_user.role | lower }}" data-notes-options="{{ notes_options }}">
<div id="user" class="{{ direction }}">
<h1>{{ user.fullname | e }}</h1>
<div class="body">
<div class="user-details {{ direction }}">
<h2>{{ _('User details') }}:</h2>
<ul>
<li>{{ _('Username') }}: {{ user.username | e }}</li>
<li>{{ _('Email Address') }}: {{ user.mail_address | e }}</li>
</ul>
</div>
<div class="user-actions {{ direction }}">
<h2>{{ _('Actions') }}:</h2>
<div id="change-password-user">
<ul>
<li><a href="{{ url_for('change_password') }}" role="button">{{ _('Change Password') }}</a></li>
<div class="form-check mail-subscription">
<input class="form-check-input" type="checkbox" value="" id="mail-subscription-checkbox"{% if current_user.mail_subscription %} checked{% endif %}>
<label class="form-check-label" for="mail-subscription-checkbox">
{{ _('Mail Subscription') }}
</label>
</div>
</ul>
</div>
</div>
<div class="user-exercises {{ direction }}">
<h2>{{ _('Exercises Submitted') }}:</h2>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">{{ _('Course name') }}</th>
<th scope="col">{{ _('Exercise name') }}</th>
<th scope="col">{{ _('Submission status') }}</th>
<th scope="col">{{ _('Submission') }}</th>
<th scope="col">{{ _('Checker') }}</th>
<th scope="col">{{ _('Assessment') }}</th>
</tr>
</thead>
<tbody>
{% for solution in solutions %}
<tr>
<th scope="row">{{ solution.exercise_number | e }}</th>
<td>{{ solution.course_name | e }}</td>
<td>{{ solution.exercise_name | e }}</td>
<td>
{{ _('Checked') if solution.is_checked else _('Submitted') if solution.solution_id else _('Not submitted') }}
</td>
<td><a href="/view/{{ solution.solution_id }}">{{ solution.solution_id }}</a></td>
<td>{{ solution.get('checker', '') | e }}</a></td>
<td>{{ solution.get('assessment', '') | e }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if user.notes or is_manager %}
<div class="{{ direction }}">
<h2>{{ _('Notes') }}:</h2>
<div class="user-notes {{ direction }}" id="notes-user"></div>
{%- if is_manager %}
<form class="align-items-center" id="notes-form">
<div class="row mb-3 {{ direction }}-language">
<label for="note-text" class="visually-hidden">{{ _('New Note') }}</label>
<div>
<input id="note-text" class="form-control form-control-lg {{ direction }}" type="text" name="note" placeholder="{{ _('New Note') }}" required>
</div>
</div>
<div class="mb-3 {{ direction }}-language note-exercise-select">
<label class="form-label auto-width" for="note-exercise">{{ _('Related Exercise') }}:</label>
<input class="form-control auto-width" list="note-exercises" id="note-exercise" name="exercise">
<datalist id="note-exercises">
{% for solution in solutions %}
<option value="{{ solution.exercise_name }}">
{% endfor %}
</datalist>
</div>
<div class="row mb-3 {{ direction }}-language note-privacy-select">
<label class="form-label auto-width" for="note-privacy">{{ _('Privacy Level') }}:</label>
<div class="note-privacy-input-range">
<input type="range" class="form-range" min="0" max="{{ notes_options.split(',') | length - 1 }}" value="0" id="note-privacy" name="privacy">
<span class="note-privacy-text" id="privacy-text"></span>
</div>
</div>
<button class="btn btn-primary btn-sm btn-block add-note">{{ _('Add Note') }}</button>
</form>
{% endif -%}
</div>
{% endif %}
</div>
</div>
</div>
<script src="{{ url_for('static', filename='notes.js') }}"></script>
{% endblock %}