diff --git a/TODO.md b/TODO.md index 97a4791..353e08e 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,9 @@ - **Add and Drop**: - The add and drop page should only include courses offered by the department head. - - Add and drop should be restricted by the school calendar. + - Add and drop date should be restricted by the school calendar. +- **Auto generate username and password when adding students and lecturers** + - Instead of filling the username and password for the student/lecturer, the system should automatically generate them and send to the student's/lecturer's email. - **Payment integration**: - Integrating PayPal and Stripe for students to pay their fees. - **Integrate the dashboard with dynamic/live data**: diff --git a/templates/accounts/add_staff.html b/templates/accounts/add_staff.html index 289b14f..ca9cd5c 100644 --- a/templates/accounts/add_staff.html +++ b/templates/accounts/add_staff.html @@ -15,46 +15,17 @@

Lecturer Add Form

-{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %}
{% csrf_token %}

Login Info

-
-
- ID No.{{ form.username }} - {{ form.username.errors }} -

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

-
-
- {{ form.password1.label }}{{ form.password1 }} - {{ form.password1.errors }} -

- The password can't be too similar to other personal information.
- The password must contain at least 8 characters.
- The password can't be a commonly used password.
- The password can't be entirely numeric. -

-
-
- {{ form.password2.label }}{{ form.password2 }} - {{ form.password2.errors }} -

Enter the same password as before, for verification.

-
+
+ {{ form.username|as_crispy_field }} + {{ form.password1|as_crispy_field }} + {{ form.password2|as_crispy_field }}
@@ -62,26 +33,11 @@

Personal Info

-
- {{ form.first_name.label }}{{ form.first_name }} - {{ form.first_name.errors }} -
-
- {{ form.last_name.label }}{{ form.last_name }} - {{ form.last_name.errors }} -
-
- {{ form.email.label }}{{ form.email }} - {{ form.email.errors }} -
-
- {{ form.address.label }}{{ form.address }} - {{ form.address.errors }} -
-
- {{ form.phone.label }}{{ form.phone }} - {{ form.phone.errors }} -
+ {{ form.first_name|as_crispy_field }} + {{ form.last_name|as_crispy_field }} + {{ form.email|as_crispy_field }} + {{ form.address|as_crispy_field }} + {{ form.phone|as_crispy_field }}
diff --git a/templates/accounts/add_student.html b/templates/accounts/add_student.html index 6983aa0..2a00bdf 100644 --- a/templates/accounts/add_student.html +++ b/templates/accounts/add_student.html @@ -15,97 +15,42 @@

Student Add Form

-{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %} {% csrf_token %}
-

Login Info

+

Login Info

-
- -
- ID No.{{ form.username }} - {{ form.username.errors }} -

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

+
+ {{ form.username|as_crispy_field }} + {{ form.password1|as_crispy_field }} + {{ form.password2|as_crispy_field }}
-
- {{ form.password1.label }}{{ form.password1 }} - {{ form.password1.errors }} -

- The password can't be too similar to other personal information.
- The password must contain at least 8 characters.
- The password can't be a commonly used password.
- The password can't be entirely numeric. -

-
-
- {{ form.password2.label }}{{ form.password2 }} - {{ form.password2.errors }} -

Enter the same password as before, for verification.

-
-
-
-

Personal Info

-
- -
- {{ form.first_name.label }}{{ form.first_name }} - {{ form.first_name.errors }} +

Personal Info

+
+ {{ form.first_name|as_crispy_field }} + {{ form.last_name|as_crispy_field }} + {{ form.email|as_crispy_field }} + {{ form.address|as_crispy_field }} + {{ form.phone|as_crispy_field }}
-
- {{ form.last_name.label }}{{ form.last_name }} - {{ form.last_name.errors }} -
-
- {{ form.email.label }}{{ form.email }} - {{ form.email.errors }} -
-
- {{ form.address.label }}{{ form.address }} - {{ form.address.errors }} -
-
- {{ form.phone.label }}{{ form.phone }} - {{ form.phone.errors }} -
-
-
-

Others

-
-
- {{ form.program.label }}{{ form.program }} - {{ form.program.errors }} +

Others

+
+ {{ form.program|as_crispy_field }} + {{ form.level|as_crispy_field }}
-
- {{ form.level.label }}{{ form.level }} - {{ form.level.errors }} -
-
-
diff --git a/templates/accounts/profile.html b/templates/accounts/profile.html index 69366a8..bb57ba3 100644 --- a/templates/accounts/profile.html +++ b/templates/accounts/profile.html @@ -15,19 +15,7 @@ -{% if messages %} -{% for message in messages %} -{% if message.tags == 'error' %} -
- {{ message }} -
-{% else %} -
- {{ message }} -
-{% endif %} -{% endfor %} -{% endif %} +{% include 'snippets/messages.html' %}
diff --git a/templates/accounts/profile_single.html b/templates/accounts/profile_single.html index 894234f..f3030b8 100644 --- a/templates/accounts/profile_single.html +++ b/templates/accounts/profile_single.html @@ -1,9 +1,13 @@ {% extends 'base.html' %} {% block title %} {{ title }} | Learning management system{% endblock title %} + {% load static %} {% load i18n %} + {% block content %} +{% if user.is_authenticated %} + -{% if messages %} -{% for message in messages %} -{% if message.tags == 'error' %} -
- {{ message }} -
-{% else %} -
- {{ message }} -
-{% endif %} -{% endfor %} -{% endif %} +{% include 'snippets/messages.html' %} -{% if request.user.is_superuser %} -
- {% if user.is_student %} - - Edit Profile - - {% endif %} - {% if user.is_lecturer %} - - Edit Profile - - {% endif %} - -
-{% endif %} - -
+
-
- -
-

Last login: {{ user.last_login|date }}

-

Full Name: {{ user.get_full_name|title }}

-

Role: {{ user_type }} -

+
+
+ +
    +
  • {{ user.get_full_name|title }}
  • +
  • Last login: {{ user.last_login|date }}
  • +
  • Role: + {{ user.get_user_role }} +
  • +
+
+ {% if request.user.is_superuser %} +
+ {% if user.is_student %} + + Edit Profile + + {% endif %} + {% if user.is_lecturer %} + + Edit Profile + + {% endif %} +
+ {% endif %}
-
+
- - {% if user.is_lecturer %} -

My Courses

-
- {% if courses %} -
- {% for course in courses %} - - {% endfor %} +
+ + + {% if user.is_lecturer %} +

My Courses

+ {% if courses %} +
    + {% for course in courses %} +
  • {{ course }}
  • + {% endfor %} +
{% else %} -
No courses!
+
No courses assigned!
{% endif %} -
- {% endif %} - -

Personal Info

-
-

First Name: {{ user.first_name|title }}

-

Last Name: {{ user.last_name|title }}

-

ID No.: {{ user.username }}

-
- {% if user.is_student %} -

Applicant Info

-
-

School: {{ student.get_student_school }}

-

Program: {{ student.program }}

-

Level: {{ student.level }}

-
- {% endif %} - -

Contact Info

-
-

Email: {{ user.email }}

-

Tel No.: {{ user.phone }}

-

Address/city: {{ user.address }}

-
- -

Important Dates

-
-

Last login: {{ user.last_login }}

- {% if current_semester and current_session %} -

Academic Year: {{ current_semester }} Semester {{ current_session }}

+
{% endif %} -

Registered Date: {{ user.date_joined|date }}

+ +

Personal Info

+
+

First Name: {{ user.first_name|title }}

+

Last Name: {{ user.last_name|title }}

+

ID No.: {{ user.username }}

+
+ {% if user.is_student %} +
+

Applicant Info

+
+

School: Hawas Preparatory School

+

Level: {{ level.level }}

+
+ {% endif %} + +
+

Contact Info

+
+

Email: {{ user.email }}

+

Tel No.: {{ user.phone }}

+

Address/city: {{ user.address }}

+
+ +
+

Important Dates

+
+

Last login: {{ user.last_login }}

+ {% if current_semester and current_session %} +

Academic Year: {{ current_semester }} Semester {{ current_session }}

+ {% endif %} +

Registered Date: {{ user.date_joined|date }}

+
-
+
+{% endif %} + {% endblock content %} \ No newline at end of file diff --git a/templates/course/course_add.html b/templates/course/course_add.html index 8b073cf..dedb330 100644 --- a/templates/course/course_add.html +++ b/templates/course/course_add.html @@ -13,82 +13,39 @@ -
Course Add & Update Form
+
Course Form


-{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} + +{% include 'snippets/messages.html' %} {% csrf_token %}
-

Course Info

+

Course Detail

- -
- {{ form.title.label }}{{ form.title }} - {{ form.title.errors }} -

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

-
-
- {{ form.code.label }}{{ form.code }} - {{ form.code.errors }} -

The course code must be similar to only the pre requests.

-
-
- {{ form.summary.label }}(optional){{ form.summary }} - {{ form.summary.errors }} -

Enter some description about the course.

-
+ {{ form.title|as_crispy_field }} + {{ form.code|as_crispy_field }} + {{ form.summary|as_crispy_field }}
-

Applicant Info

+

Other Info

- -
- {{ form.program.label }}{{ form.program }} - {{ form.program.errors }} -
-
- {{ form.credit.label }}{{ form.credit }} - {{ form.credit.errors }} -
-
- {{ form.year.label }}{{ form.year }} - {{ form.year.errors }} -
-
- {{ form.semester.label }}{{ form.semester }} - {{ form.semester.errors }} -
-
- {{ form.level.label }}{{ form.level }} - {{ form.level.errors }} -
-
- {{ form.is_elective.label }}{{ form.is_elective }} - {{ form.is_elective.errors }} -
+ {{ form.program|as_crispy_field }} + {{ form.credit|as_crispy_field }} + {{ form.year|as_crispy_field }} + {{ form.semester|as_crispy_field }} + {{ form.level|as_crispy_field }} + {{ form.is_elective|as_crispy_field }}
-
+ {% endblock content %} diff --git a/templates/course/program_add.html b/templates/course/program_add.html index 15b908f..1720fbf 100644 --- a/templates/course/program_add.html +++ b/templates/course/program_add.html @@ -13,19 +13,7 @@ -{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %}
@@ -33,18 +21,8 @@

Program Add Form


{% csrf_token %} - - -
- {{ form.title.label }}{{ form.title }} - {{ form.title.errors }} -
-
- {{ form.summary.label }}{{ form.summary }} - {{ form.summary.errors }} -
- - + {{ form|crispy }} +
diff --git a/templates/course/program_list.html b/templates/course/program_list.html index 34e8582..b34426e 100644 --- a/templates/course/program_list.html +++ b/templates/course/program_list.html @@ -17,53 +17,12 @@ {% endif %}
Program List
+

-{% if messages %} -{% for message in messages %} -{% if message.tags == 'error' %} -
- {{ message }} -
-{% else %} -
- {{ message }} -
-{% endif %} -{% endfor %} -{% endif %} +{% include 'snippets/messages.html' %} +{% include 'snippets/filter_form.html' %} -
-
- {{ filter.form }} - -
-
- - - - -{% for program in programs %} - -{% endfor %} - - -
+
@@ -80,41 +39,23 @@ {% for program in filter.qs %} - + {% if request.user.is_superuser %} - {% endif %} diff --git a/templates/course/program_single.html b/templates/course/program_single.html index 00e8ebc..5dbb72e 100644 --- a/templates/course/program_single.html +++ b/templates/course/program_single.html @@ -27,30 +27,8 @@ {% endif %} {% endif %} -{% if messages %} -{% for message in messages %} -{% if message.tags == 'error' %} -
- {{ message }} -
-{% else %} -
- {{ message }} -
-{% endif %} -{% endfor %} -{% endif %} - -
-
- - - - - -
+{% include 'snippets/messages.html' %} +{% include 'snippets/filter_form.html' %}
@@ -95,7 +73,7 @@ data-bs-boundary="window" aria-haspopup="true" aria-expanded="false"> -
+ {% else %} @@ -100,23 +101,27 @@ {% if progress.0|add:1 == 1 %} - + {% else %} @@ -112,14 +113,14 @@

{{ sitting.result_message }}

{% endif %} -

{% trans "Review the questions below and try the quiz again in the future"%}.

- -

- +

    +
  • {% trans "Review the questions below and try the quiz again in the future"%}.
  • +
  • {% trans "The result of this quiz will be stored in your progress section" %} Here {% trans "so you can review and monitor your progression" %}. -

    +
  • +
diff --git a/templates/snippets/filter_form.html b/templates/snippets/filter_form.html index cf7b009..ba5bdf2 100644 --- a/templates/snippets/filter_form.html +++ b/templates/snippets/filter_form.html @@ -1,4 +1,4 @@ - +{% if filter.form %}
{% for field in filter.form %} @@ -11,3 +11,4 @@
+{% endif %} \ No newline at end of file diff --git a/templates/snippets/messages.html b/templates/snippets/messages.html index 47af087..4b422ab 100644 --- a/templates/snippets/messages.html +++ b/templates/snippets/messages.html @@ -2,12 +2,16 @@ {% if messages %} {% for message in messages %} {% if message.tags == 'error' %} -
- {{ message }} +
+ {{ message }} +
+ {% elif message.tags == 'warning' %} +
+ {{ message }}
{% else %} -
- {{ message }} +
+ {{ message }}
{% endif %} {% endfor %}
{{ forloop.counter }}. - {{ program.title}} + + {{ program.title}} + + {{ program.summary }} -
- - +
- - - -
{{ answer }} {% trans "This is the correct answer" %}
{{ answer }}
{{ answer }} {% trans "This is the correct answer" %}
{{ answer }}