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.

43 lines
1.6 KiB

<html>
<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>
<form action="{% url 'publish_message_form' %}" method="POST">
{% csrf_token %}
<fieldset>
<legend><h1>Publish a message</h1></legend>
{% if error_message %}
{{ error_message }}
{% endif %}
<label for="course_id">Course</label><br>
<select name="course_id" id="course_id" required>
{% for course in courses %}
<option value="{{ course.id }}">{{ course.title }}</option>
{% endfor %}
</select><br/>
<label for="message">Message</label><br>
<input name="message" id="message" required><br/>
</fieldset>
<input type="submit" value="Publish the message">
</form>
</body>
</html>