From 3713ea1c1088c477f43e885d9ea0f85ded1f9c40 Mon Sep 17 00:00:00 2001 From: Yam Mesicka Date: Fri, 5 Apr 2024 07:06:51 +0300 Subject: [PATCH] feat: Modernizing the exercises page --- .../translations/he/LC_MESSAGES/messages.po | 17 +++-- lms/static/my.css | 70 +++++++++++++++++-- lms/templates/exercises.html | 65 +++++++++-------- lms/templates/navbar.html | 8 --- 4 files changed, 112 insertions(+), 48 deletions(-) diff --git a/lms/lmsweb/translations/he/LC_MESSAGES/messages.po b/lms/lmsweb/translations/he/LC_MESSAGES/messages.po index eebec578..bf0793f5 100644 --- a/lms/lmsweb/translations/he/LC_MESSAGES/messages.po +++ b/lms/lmsweb/translations/he/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-03-29 21:14+0300\n" +"POT-Creation-Date: 2024-04-05 05:39+0300\n" "PO-Revision-Date: 2024-03-23 18:59+0300\n" "Last-Translator: Yam Mesicka\n" "Language: he\n" @@ -184,19 +184,23 @@ msgstr "אימות סיסמה" msgid "Exercises" msgstr "תרגילים" -#: lms/templates/exercises.html:26 +#: lms/templates/exercises.html:13 +msgid "Upload Solutions" +msgstr "העלו פתרונות" + +#: lms/templates/exercises.html:32 msgid "Send" msgstr "שלח" -#: lms/templates/exercises.html:28 +#: lms/templates/exercises.html:34 msgid "View" msgstr "הצצה" -#: lms/templates/exercises.html:30 +#: lms/templates/exercises.html:36 msgid "Check" msgstr "לבדיקה" -#: lms/templates/exercises.html:44 +#: lms/templates/exercises.html:50 msgid "All Exercises" msgstr "לכל התרגילים" @@ -489,7 +493,7 @@ msgstr "סיום בדיקה" msgid "Automatic Checking" msgstr "בדיקות אוטומטיות" -#: lms/templates/view.html:93 +#: lms/templates/view.html:94 msgid "Test failed" msgstr "בדיקה נכשלה" @@ -549,3 +553,4 @@ msgstr "" "שלום %(fullname)s. הסיסמה שלך באתר %(site_name)s שונתה.\n" "אם לא אתה שינית את הסיסמה, צור קשר עם הנהלת האתר.\n" "כתובת המייל שלך לפי רישומינו: %(site_mail)s" + diff --git a/lms/static/my.css b/lms/static/my.css index b76d4724..32dc7869 100644 --- a/lms/static/my.css +++ b/lms/static/my.css @@ -93,9 +93,15 @@ a { margin: 3rem 0; } +#exercises-page-container { + display: flex; + justify-content: center; +} + #exercises-page { display: flex; flex-direction: column; + width: 720px; } #exercises-header { @@ -136,6 +142,30 @@ a { text-align: center; border-right: #00000000 8px solid; border-left: #00000000 8px solid; + transition: box-shadow 0.3s ease, border-color 0.3s ease; +} + +.exercise-status-icon { + margin-inline: 0.5rem; + align-self: center; +} + +.exercise:hover { + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.2); + text-decoration: none; +} + +.exercise-link { + text-decoration: none; + color: inherit; + display: block; + transition: all 0.3s ease; +} + +.exercise-link:hover, .exercise-link:focus { + text-decoration: none; + color: inherit; + border-radius: 10px; } .centered { @@ -163,12 +193,10 @@ a { overflow: hidden; text-align: center; font-size: 1.2rem; - margin-right: 1rem; color: #495057; padding: 0.25rem 0.75rem; - border-radius: 15px; - min-width: 4rem; justify-content: start; + min-width: 4rem; } .exercise-name { @@ -296,6 +324,40 @@ button.our-button-narrow, a.our-button-narrow { justify-content: center; } +#upload-solutions-button, #upload-solutions-button > a { + margin-inline-end: 0; +} + +.our-cta-button { + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + font-size: 1rem; + justify-content: center; + width: auto; + padding: 0.6rem 1rem; +} + +.our-cta-button:hover { + box-shadow: 0 5px 7px rgba(0, 0, 0, 0.1); + transform: scale(1.05); +} + +.our-cta-button:active { + background-color: #269abc; + animation: none; +} + +.our-cta-button.active, .our-cta-button:checked { + background-color: #1e90ff; +} + +.our-cta-button.active:hover, .our-cta-button:checked:hover { + background-color: #187adf; +} + +.our-cta-button > .fa { + margin-inline-end: 0.5rem; +} + #filetree { display: flex; flex-basis: auto; @@ -970,7 +1032,7 @@ code .grader-add .fa { align-items: center; align-self: center; display: flex; - margin-inline-end: 1rem; + margin-inline-end: 2rem; } .fa-book { diff --git a/lms/templates/exercises.html b/lms/templates/exercises.html index 3abb75ed..f00a2c7b 100644 --- a/lms/templates/exercises.html +++ b/lms/templates/exercises.html @@ -1,49 +1,54 @@ {%- extends 'base.html' -%} {%- block page_content -%} -
+

{{ _('Exercises') }}

+
{%- for exercise in exercises %} -
-
-
{{ exercise['exercise_number'] }}
-
{{ exercise['exercise_name'] | e }}
-
-
- {%- if exercise['notebook'] %} -
- - {{ exercise['notebook'] }} + {%- if exercise.get('is_checked') is none %} + {% set details = {'page': 'send', 'icon': 'upload', 'text': _('Send'), 'css': 'send', 'page_id': exercise['course_id'] ~ '/' ~ exercise['exercise_id']} %} + {% elif not exercise.get('is_checked') %} + {% set details = {'page': 'view', 'icon': 'eye', 'text': _('View'), 'css': 'view', 'page_id': exercise['solution_id']} %} + {% else %} + {% set details = {'page': 'view', 'icon': 'check-circle-o', 'text': _('Check'), 'css': 'checked', 'page_id': exercise['solution_id']} %} + {% endif -%} + + -
+ {% endfor -%} {%- if not fetch_archived %} -
diff --git a/lms/templates/navbar.html b/lms/templates/navbar.html index 115afba0..4375ccdc 100644 --- a/lms/templates/navbar.html +++ b/lms/templates/navbar.html @@ -58,14 +58,6 @@ {% endfor -%} - {%- if current_user.last_course_viewed %} - - {% endif -%} {%- if not exercises or fetch_archived %}