Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
95c59478
Unverified
Commit
95c59478
authored
2 years ago
by
Julian
Committed by
magicfelix
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Create basic Coursebook views
parent
d31d3bd5
No related branches found
Branches containing commit
No related tags found
1 merge request
!284
Draft: Redesign entering of lesson documentation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/apps/alsijil/menus.py
+7
-0
7 additions, 0 deletions
aleksis/apps/alsijil/menus.py
aleksis/apps/alsijil/urls.py
+2
-0
2 additions, 0 deletions
aleksis/apps/alsijil/urls.py
aleksis/apps/alsijil/views.py
+18
-2
18 additions, 2 deletions
aleksis/apps/alsijil/views.py
with
27 additions
and
2 deletions
aleksis/apps/alsijil/menus.py
+
7
−
0
View file @
95c59478
...
...
@@ -13,6 +13,13 @@ MENUS = {
"
aleksis.core.util.core_helpers.has_person
"
,
],
"
submenu
"
:
[
{
"
name
"
:
_
(
"
Coursebook
"
),
"
url
"
:
"
select_coursebook
"
,
"
svg_icon
"
:
"
mdi:book-education-outline
"
,
"
vuetify_icon
"
:
"
mdi-book-education-outline
"
,
# FIXME: Permissions
},
{
"
name
"
:
_
(
"
Current lesson
"
),
"
url
"
:
"
lesson_period
"
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/urls.py
+
2
−
0
View file @
95c59478
...
...
@@ -3,6 +3,8 @@ from django.urls import path
from
.
import
views
urlpatterns
=
[
path
(
"
coursebook/
"
,
views
.
SelectCoursebookView
.
as_view
(),
name
=
"
select_coursebook
"
),
path
(
"
coursebook/<int:pk>/
"
,
views
.
CoursebookView
.
as_view
(),
name
=
"
coursebook
"
),
path
(
"
lesson
"
,
views
.
register_object
,
{
"
model
"
:
"
lesson
"
},
name
=
"
lesson_period
"
),
path
(
"
lesson/<int:year>/<int:week>/<int:id_>
"
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
18
−
2
View file @
95c59478
...
...
@@ -17,7 +17,7 @@ from django.utils.http import url_has_allowed_host_and_scheme
from
django.utils.translation
import
gettext
as
_
from
django.views
import
View
from
django.views.decorators.cache
import
never_cache
from
django.views.generic
import
DetailView
from
django.views.generic
import
DetailView
,
TemplateView
import
reversion
from
calendarweek
import
CalendarWeek
...
...
@@ -28,7 +28,7 @@ from reversion.views import RevisionMixin
from
rules.contrib.views
import
PermissionRequiredMixin
,
permission_required
from
aleksis.apps.chronos.managers
import
TimetableType
from
aleksis.apps.chronos.models
import
Event
,
ExtraLesson
,
Holiday
,
LessonPeriod
,
TimePeriod
from
aleksis.apps.chronos.models
import
Event
,
ExtraLesson
,
Holiday
,
Lesson
,
LessonPeriod
,
TimePeriod
from
aleksis.apps.chronos.util.build
import
build_weekdays
from
aleksis.apps.chronos.util.date
import
get_weeks_for_year
,
week_weekday_to_date
from
aleksis.core.mixins
import
(
...
...
@@ -1349,3 +1349,19 @@ class AllRegisterObjectsView(PermissionRequiredMixin, View):
if
self
.
action_form
.
is_valid
():
self
.
action_form
.
execute
()
return
render
(
request
,
"
alsijil/class_register/all_objects.html
"
,
context
)
class
CoursebookView
(
DetailView
):
model
=
Lesson
template_name
=
"
alsijil/class_register/coursebook.html
"
permission_required
=
""
# FIXME
class
SelectCoursebookView
(
TemplateView
):
template_name
=
"
alsijil/class_register/select_coursebook.html
"
permission_required
=
""
# FIXME
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
().
get_context_data
(
**
kwargs
)
context
[
"
lessons
"
]
=
self
.
request
.
user
.
person
.
lessons_as_teacher
.
all
()
return
context
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment