Skip to content

Commit 3713ea1

Browse files
committed
feat: Modernizing the exercises page
1 parent aaf7370 commit 3713ea1

File tree

4 files changed

+112
-48
lines changed

4 files changed

+112
-48
lines changed

lms/lmsweb/translations/he/LC_MESSAGES/messages.po

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: 1.0\n"
99
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10-
"POT-Creation-Date: 2024-03-29 21:14+0300\n"
10+
"POT-Creation-Date: 2024-04-05 05:39+0300\n"
1111
"PO-Revision-Date: 2024-03-23 18:59+0300\n"
1212
"Last-Translator: Yam Mesicka\n"
1313
"Language: he\n"
@@ -184,19 +184,23 @@ msgstr "אימות סיסמה"
184184
msgid "Exercises"
185185
msgstr "תרגילים"
186186

187-
#: lms/templates/exercises.html:26
187+
#: lms/templates/exercises.html:13
188+
msgid "Upload Solutions"
189+
msgstr "העלו פתרונות"
190+
191+
#: lms/templates/exercises.html:32
188192
msgid "Send"
189193
msgstr "שלח"
190194

191-
#: lms/templates/exercises.html:28
195+
#: lms/templates/exercises.html:34
192196
msgid "View"
193197
msgstr "הצצה"
194198

195-
#: lms/templates/exercises.html:30
199+
#: lms/templates/exercises.html:36
196200
msgid "Check"
197201
msgstr "לבדיקה"
198202

199-
#: lms/templates/exercises.html:44
203+
#: lms/templates/exercises.html:50
200204
msgid "All Exercises"
201205
msgstr "לכל התרגילים"
202206

@@ -489,7 +493,7 @@ msgstr "סיום בדיקה"
489493
msgid "Automatic Checking"
490494
msgstr "בדיקות אוטומטיות"
491495

492-
#: lms/templates/view.html:93
496+
#: lms/templates/view.html:94
493497
msgid "Test failed"
494498
msgstr "בדיקה נכשלה"
495499

@@ -549,3 +553,4 @@ msgstr ""
549553
"שלום %(fullname)s. הסיסמה שלך באתר %(site_name)s שונתה.\n"
550554
"אם לא אתה שינית את הסיסמה, צור קשר עם הנהלת האתר.\n"
551555
"כתובת המייל שלך לפי רישומינו: %(site_mail)s"
556+

lms/static/my.css

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,15 @@ a {
9393
margin: 3rem 0;
9494
}
9595

96+
#exercises-page-container {
97+
display: flex;
98+
justify-content: center;
99+
}
100+
96101
#exercises-page {
97102
display: flex;
98103
flex-direction: column;
104+
width: 720px;
99105
}
100106

101107
#exercises-header {
@@ -136,6 +142,30 @@ a {
136142
text-align: center;
137143
border-right: #00000000 8px solid;
138144
border-left: #00000000 8px solid;
145+
transition: box-shadow 0.3s ease, border-color 0.3s ease;
146+
}
147+
148+
.exercise-status-icon {
149+
margin-inline: 0.5rem;
150+
align-self: center;
151+
}
152+
153+
.exercise:hover {
154+
box-shadow: 0 5px 8px rgba(0, 0, 0, 0.2);
155+
text-decoration: none;
156+
}
157+
158+
.exercise-link {
159+
text-decoration: none;
160+
color: inherit;
161+
display: block;
162+
transition: all 0.3s ease;
163+
}
164+
165+
.exercise-link:hover, .exercise-link:focus {
166+
text-decoration: none;
167+
color: inherit;
168+
border-radius: 10px;
139169
}
140170

141171
.centered {
@@ -163,12 +193,10 @@ a {
163193
overflow: hidden;
164194
text-align: center;
165195
font-size: 1.2rem;
166-
margin-right: 1rem;
167196
color: #495057;
168197
padding: 0.25rem 0.75rem;
169-
border-radius: 15px;
170-
min-width: 4rem;
171198
justify-content: start;
199+
min-width: 4rem;
172200
}
173201

174202
.exercise-name {
@@ -296,6 +324,40 @@ button.our-button-narrow, a.our-button-narrow {
296324
justify-content: center;
297325
}
298326

327+
#upload-solutions-button, #upload-solutions-button > a {
328+
margin-inline-end: 0;
329+
}
330+
331+
.our-cta-button {
332+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
333+
font-size: 1rem;
334+
justify-content: center;
335+
width: auto;
336+
padding: 0.6rem 1rem;
337+
}
338+
339+
.our-cta-button:hover {
340+
box-shadow: 0 5px 7px rgba(0, 0, 0, 0.1);
341+
transform: scale(1.05);
342+
}
343+
344+
.our-cta-button:active {
345+
background-color: #269abc;
346+
animation: none;
347+
}
348+
349+
.our-cta-button.active, .our-cta-button:checked {
350+
background-color: #1e90ff;
351+
}
352+
353+
.our-cta-button.active:hover, .our-cta-button:checked:hover {
354+
background-color: #187adf;
355+
}
356+
357+
.our-cta-button > .fa {
358+
margin-inline-end: 0.5rem;
359+
}
360+
299361
#filetree {
300362
display: flex;
301363
flex-basis: auto;
@@ -970,7 +1032,7 @@ code .grader-add .fa {
9701032
align-items: center;
9711033
align-self: center;
9721034
display: flex;
973-
margin-inline-end: 1rem;
1035+
margin-inline-end: 2rem;
9741036
}
9751037

9761038
.fa-book {

lms/templates/exercises.html

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
11
{%- extends 'base.html' -%}
22

33
{%- block page_content -%}
4-
<div class="container">
4+
<div id="exercises-page-container" class="container">
55
<div id="exercises-page" class="page {{ direction }}">
66
<div id="exercises-header">
77
<div id="main-title">
88
<h1 id="exercises-head">{{ _('Exercises') }}</h1>
99
</div>
10+
<div id="upload-solutions-button">
11+
<a href="{{ url_for('send_', course_id=current_user.last_course_viewed.id) }}" class="our-button our-cta-button">
12+
<i class="fa fa-upload" aria-hidden="true"></i>
13+
{{ _('Upload Solutions') }}
14+
</a>
15+
</div>
1016
</div>
1117
<div id="exercises">
1218
{%- for exercise in exercises %}
13-
<div class="exercise" {%- if exercise.grade_color %} style="border-right: 8px solid {{ exercise.grade_color }};" {%- endif -%}>
14-
<div class="right-side {{ direction }}-language">
15-
<div class="exercise-number me-3">{{ exercise['exercise_number'] }}</div>
16-
<div class="exercise-name"><div class="ex-title">{{ exercise['exercise_name'] | e }}</div></div>
17-
</div>
18-
<div class="left-side">
19-
{%- if exercise['notebook'] %}
20-
<div class="which-notebook">
21-
<i class="fa fa-book" aria-hidden="true"></i>
22-
{{ exercise['notebook'] }}
19+
{%- if exercise.get('is_checked') is none %}
20+
{% set details = {'page': 'send', 'icon': 'upload', 'text': _('Send'), 'css': 'send', 'page_id': exercise['course_id'] ~ '/' ~ exercise['exercise_id']} %}
21+
{% elif not exercise.get('is_checked') %}
22+
{% set details = {'page': 'view', 'icon': 'eye', 'text': _('View'), 'css': 'view', 'page_id': exercise['solution_id']} %}
23+
{% else %}
24+
{% set details = {'page': 'view', 'icon': 'check-circle-o', 'text': _('Check'), 'css': 'checked', 'page_id': exercise['solution_id']} %}
25+
{% endif -%}
26+
<a href="{{ details['page'] }}/{{ details['page_id'] }}" class="exercise-link">
27+
<div class="exercise" {%- if exercise.grade_color %} style="border-right: 8px solid {{ exercise.grade_color }};" {%- endif -%}>
28+
<div class="right-side {{ direction }}-language">
29+
<i class="fa fa-{{ details['icon'] }} exercise-status-icon" aria-hidden="true"></i>
30+
<div class="exercise-number me-3">{{ exercise['exercise_number'] }}</div>
31+
{%- if exercise['notebook'] %}
32+
{%- endif %}
33+
<div class="exercise-name"><div class="ex-title">{{ exercise['exercise_name'] | e }}</div></div>
34+
</div>
35+
<div class="left-side">
36+
<div class="which-notebook">
37+
<i class="fa fa-book" aria-hidden="true"></i>
38+
{{ exercise['notebook'] }}
39+
</div>
2340
</div>
24-
{%- endif %}
25-
{%- if exercise.get('is_checked') is none %}
26-
{% set details = {'page': 'send', 'icon': 'upload', 'text': _('Send'), 'css': 'send', 'page_id': exercise['course_id'] ~ '/' ~ exercise['exercise_id']} %}
27-
{% elif not exercise.get('is_checked') %}
28-
{% set details = {'page': 'view', 'icon': 'eye', 'text': _('View'), 'css': 'view', 'page_id': exercise['solution_id']} %}
29-
{% else %}
30-
{% set details = {'page': 'view', 'icon': 'check-circle-o', 'text': _('Check'), 'css': 'checked', 'page_id': exercise['solution_id']} %}
31-
{% endif -%}
32-
{%- if not exercise.get('is_archived') or exercise.get('is_checked') is not none %}
33-
<a class="our-button go-{{ details['css'] }}" href="{{ details['page'] }}/{{ details['page_id'] }}">
34-
{{ details['text'] | e }}
35-
<i class="fa fa-{{ details['icon'] }}" aria-hidden="true"></i>
36-
</a>
37-
{% endif -%}
3841
</div>
39-
</div>
42+
</a>
4043
{% endfor -%}
4144
{%- if not fetch_archived %}
42-
<div class="exercise centered">
43-
<div id="show-all-exercises-action" class="right-side">
44-
<a href="?archived=1">{{ _('All Exercises') }}</a>
45+
<a href="?archived=1">
46+
<div class="exercise centered">
47+
<div id="show-all-exercises-action" class="right-side">
48+
{{ _('All Exercises') }}
49+
</div>
4550
</div>
46-
</div>
51+
</a>
4752
{% endif -%}
4853
</div>
4954
</div>

lms/templates/navbar.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@
5858
{% endfor -%}
5959
</ul>
6060
</li>
61-
{%- if current_user.last_course_viewed %}
62-
<li class="nav-item">
63-
<a href="{{ url_for('send_', course_id=current_user.last_course_viewed.id) }}" class="nav-link">
64-
<i class="fa fa-upload" aria-hidden="true"></i>
65-
{{ _('Upload Exercises') }}
66-
</a>
67-
</li>
68-
{% endif -%}
6961
{%- if not exercises or fetch_archived %}
7062
<li class="nav-item">
7163
<a href="/exercises" class="nav-link">

0 commit comments

Comments
 (0)