You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.7 KiB

<html>
<head>
{% load static %}
<link rel="stylesheet" href="{% static 'redis_app/style.css' %}">
</head>
<body>
<nav>
<a href="{% url 'home' %}">Home</a>
{% if person == '' %}
<a href="{% url 'login_form' %}">Login</a>
<a href="{% url 'register_form' %}">Register</a>
{% else %}
<a href="{% url 'courses' %}">Courses</a>
<a href="{% url 'profile' %}">Profile</a>
<a href="{% url 'search' %}">Search</a>
<a href="{% url 'notifications_view' %}">Notifications</a>
{% if person.role == 'Teacher' %}
<a href="{% url 'publish_message' %}">Publish a message</a>
{% endif %}
<a href="{% url 'logout' %}">Logout</a>
{% endif %}
</nav>
<div class="body">
<div class="container">
<div class="div-container">
{% if error_message %}
<p class="error-message">{{ error_message }}</p>
{% endif %}
{% if success_message %}
<p class="success-message">{{ success_message }}</p>
{% endif %}
<!-- Displaying information about the course, each of course information -->
{% if course %}
<h1>Welcome in the course {{ course.title }}!</h1>
<p>
{{ course.summary }}
</p>
<p>
This course is for {{ course.level }} students
</p>
<p>
There's only {{ course.places }} places
</p>
<p>
The course has been created by {{ course.teacher_name }}
</p>
<!-- When someone tries to go directly into a detail page but failed to type the correct course id into the URL. -->
{% else %}
<p class="no-courses">No course found!</p>
{% endif %}
<!-- All actions. -->
{% if person %}
<!-- Teachers actions -->
{% if person.role == "Teacher" %}
<a href="{% url 'delete_course' course.id %}">Delete</a>
<a href="{% url 'update_course' course.id %}">Update</a>
<!-- Students actions -->
{% else %}
<!-- If he's registered to the ourse, he can unregister from it -->
{% if register %}
<a href="{% url 'course_unregister' course.id %}">Unregister</a>
<!-- If he's not registered to the course, he can register to it -->
{% else %}
<!-- But if the course if full (if there's as many students as the number of places defined in course creatin/update), he can't register-->
{% if full == False %}
<a href="{% url 'course_register' course.id %}">Register</a>
{% else %}
<p>The course if full.</p>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
</div>
</body>
</html>