Restrict access to all programs page for student
This commit is contained in:
parent
cf5d3cc9b6
commit
8cde63946f
@ -25,7 +25,7 @@ from .filters import ProgramFilter, CourseAllocationFilter
|
|||||||
from .models import Program, Course, CourseAllocation, Upload, UploadVideo
|
from .models import Program, Course, CourseAllocation, Upload, UploadVideo
|
||||||
|
|
||||||
|
|
||||||
@method_decorator([login_required], name="dispatch")
|
@method_decorator([login_required, lecturer_required], name="dispatch")
|
||||||
class ProgramFilterView(FilterView):
|
class ProgramFilterView(FilterView):
|
||||||
filterset_class = ProgramFilter
|
filterset_class = ProgramFilter
|
||||||
template_name = "course/program_list.html"
|
template_name = "course/program_list.html"
|
||||||
|
|||||||
@ -68,9 +68,11 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if request.user.is_superuser or request.user.is_lecturer %}
|
||||||
<li class="{% if request.path == pro %}active{% endif %}">
|
<li class="{% if request.path == pro %}active{% endif %}">
|
||||||
<a href="{% url 'programs' %}"><i class="fas fa-book-open"></i>{% trans 'Programs & Courses' %}</a>
|
<a href="{% url 'programs' %}"><i class="fas fa-book-open"></i>{% trans 'Programs & Courses' %}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if request.user.is_superuser or request.user.is_lecturer %}
|
{% if request.user.is_superuser or request.user.is_lecturer %}
|
||||||
<li class="{% if request.path == qce %}active{% endif %}">
|
<li class="{% if request.path == qce %}active{% endif %}">
|
||||||
|
|||||||
@ -35,8 +35,7 @@
|
|||||||
<p class="form-title fw-bold">{% trans 'Course Add' %}</p>
|
<p class="form-title fw-bold">{% trans 'Course Add' %}</p>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="d-flex justify-content-between mb-3">
|
<div class="d-flex justify-content-between mb-3">
|
||||||
<button title="{% trans 'Save Score' %}" type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> {% trans 'Add
|
<button title="{% trans 'Save Score' %}" type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> {% trans 'Add Selected' %}</button>
|
||||||
Selected' %}</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-responsive p-0 px-2 mt-2">
|
<div class="table-responsive p-0 px-2 mt-2">
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
||||||
|
{% if request.user.is_student %}
|
||||||
|
<li class="breadcrumb-item"><a href="{% url 'user_course_list' %}">{% trans 'My courses' %}</a></li>
|
||||||
|
{% else %}
|
||||||
<li class="breadcrumb-item"><a href="{% url 'programs' %}">{% trans 'Programs' %}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'programs' %}">{% trans 'Programs' %}</a></li>
|
||||||
|
{% endif %}
|
||||||
<li class="breadcrumb-item"><a href="{% url 'program_detail' course.program.id %}">{{ course.program }}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'program_detail' course.program.id %}">{{ course.program }}</a></li>
|
||||||
<li class="breadcrumb-item active" aria-current="page">{{ course }}</li>
|
<li class="breadcrumb-item active" aria-current="page">{{ course }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
||||||
|
{% if request.user.is_student %}
|
||||||
|
<li class="breadcrumb-item"><a href="{% url 'user_course_list' %}">{% trans 'My courses' %}</a></li>
|
||||||
|
{% else %}
|
||||||
<li class="breadcrumb-item"><a href="{% url 'programs' %}">{% trans 'Programs' %}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'programs' %}">{% trans 'Programs' %}</a></li>
|
||||||
|
{% endif %}
|
||||||
<li class="breadcrumb-item active" aria-current="page">{{ program.title }}</li>
|
<li class="breadcrumb-item active" aria-current="page">{{ program.title }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -10,7 +10,11 @@
|
|||||||
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
||||||
|
{% if request.user.is_student %}
|
||||||
|
<li class="breadcrumb-item"><a href="{% url 'user_course_list' %}">{% trans 'My courses' %}</a></li>
|
||||||
|
{% else %}
|
||||||
<li class="breadcrumb-item"><a href="{% url 'programs' %}">{% trans 'Programs' %}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'programs' %}">{% trans 'Programs' %}</a></li>
|
||||||
|
{% endif %}
|
||||||
<li class="breadcrumb-item"><a href="{% url 'program_detail' pk=1 %}">{{ course.program }}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'program_detail' pk=1 %}">{{ course.program }}</a></li>
|
||||||
<li class="breadcrumb-item"><a href="{{ course.get_absolute_url }}">{{ course }}</a></li>
|
<li class="breadcrumb-item"><a href="{{ course.get_absolute_url }}">{{ course }}</a></li>
|
||||||
<li class="breadcrumb-item active" aria-current="page">{% trans 'Quizzes' %}</li>
|
<li class="breadcrumb-item active" aria-current="page">{% trans 'Quizzes' %}</li>
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>{% trans 'Course Title' %}</th>
|
<th>{% trans 'Course Title' %}</th>
|
||||||
<th>{% trans 'Course Code %}</th>
|
<th>{% trans 'Course Code' %}</th>
|
||||||
<th>{% trans 'Cr.Hr(s)' %}</th>
|
<th>{% trans 'Cr.Hr(s)' %}</th>
|
||||||
<th>{% trans 'Assignment' %}</th>
|
<th>{% trans 'Assignment' %}</th>
|
||||||
<th>{% trans 'Mid exam' %}</th>
|
<th>{% trans 'Mid exam' %}</th>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user