Commit 201266ff authored by Jelle Besseling's avatar Jelle Besseling

Merge branch 'tc/refactor-education-views-class-based' into 'master'

Refactor education views to class based

See merge request !1259
parents 0408ac16 61c38250
......@@ -12,9 +12,10 @@
{% trans "Submit Exam" %}
</h1>
{% if saved %}
{% trans "Exam submitted successfully." as success_text %}
{% alert 'success' success_text dismissable=True %}
{% if messages %}
{% for message in messages %}
{% alert message.tags message dismissable=True %}
{% endfor %}
{% endif %}
<form method="post" enctype="multipart/form-data"
......
......@@ -12,9 +12,10 @@
{% trans "Submit Summary" %}
</h1>
{% if saved %}
{% trans "Summary submitted successfully." as success_text %}
{% alert 'success' success_text dismissable=True %}
{% if messages %}
{% for message in messages %}
{% alert message.tags message dismissable=True %}
{% endfor %}
{% endif %}
<form method="post" enctype="multipart/form-data"
......
"""The routes defined by the education package"""
from django.conf.urls import include, url
from django.views.generic.base import RedirectView, TemplateView
from django.conf.urls import include
from django.urls import path
from django.views.generic.base import RedirectView
from . import views
from education.views import (
StudentParticipantView, BookInfoView,
CourseIndexView, CourseDetailView, ExamCreateView,
SummaryCreateView,
ExamDetailView, SummaryDetailView
)
app_name = "education"
urlpatterns = [
url(r'^books/$', views.books, name="books"),
url(r'^courses/', include([
url(r'^$', views.courses, name="courses"),
url(r'^(?P<id>[0-9]*)/', include([
url(r'^$', views.course, name="course"),
url(r'^upload-exam/$', views.submit_exam, name="submit-exam"),
url(r'^upload-summary/$', views.submit_summary, name="submit-summary"),
path('education/', include([
path('books/', BookInfoView.as_view(), name="books"),
path('courses/', include([
path('', CourseIndexView.as_view(), name="courses"),
path('<int:pk>/', include([
path('', CourseDetailView.as_view(), name="course"),
path('exam/upload/', ExamCreateView.as_view(),
name="submit-exam"),
path('summary/upload/', SummaryCreateView.as_view(),
name="submit-summary"),
])),
path('exam/<int:pk>/', ExamDetailView.as_view, name="exam"),
path('summary/(<int:pk>/', SummaryDetailView.as_view(),
name="summary"),
path('exam/upload/', ExamCreateView.as_view(),
name="submit-exam"),
path('summary/upload/', SummaryCreateView.as_view(),
name="submit-summary"),
])),
path('student-participation/',
StudentParticipantView.as_view(), name="student-participation"),
path('', RedirectView.as_view(
pattern_name='education:courses', permanent=True), name="index"),
])),
url(r'^exams/(?P<id>[0-9]*)/$', views.exam, name="exam"),
url(r'^summaries/(?P<id>[0-9]*)/$', views.summary, name="summary"),
url(r'^upload-exam/$', views.submit_exam, name="submit-exam"),
url(r'^upload-summary/$', views.submit_summary, name="submit-summary"),
url('^student-participation/$', TemplateView.as_view(
template_name='education/student_participation.html'),
name="student-participation"),
url(r'^$',
RedirectView.as_view(pattern_name='education:courses',
permanent=True), name="index"),
]
This diff is collapsed.
......@@ -109,7 +109,6 @@ urlpatterns = [ # pylint: disable=invalid-name
url(r'^', include('pushnotifications.api.urls')),
])),
])),
url(r'^education/', include('education.urls')),
url(r'^announcements/', include('announcements.urls')),
url(r'^pushnotifications/', include('pushnotifications.urls')),
# Default login helpers
......@@ -131,6 +130,7 @@ urlpatterns = [ # pylint: disable=invalid-name
url(r'^media/private/(?P<request_path>.*)$', private_media, name='private-media'),
url('', include('members.urls')),
url('', include('payments.urls')),
url('', include('education.urls')),
url('', include('activemembers.urls')),
url('', include('documents.urls')),
] + static(settings.MEDIA_URL + 'public/',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment