Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
d2910a8d
Commit
d2910a8d
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Work at dashboard for hints
parent
0fd25c71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!86
Merge school-apps
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
react/src/dashboard.js
+3
-1
3 additions, 1 deletion
react/src/dashboard.js
schoolapps/dashboard/views.py
+10
-4
10 additions, 4 deletions
schoolapps/dashboard/views.py
with
13 additions
and
5 deletions
react/src/dashboard.js
+
3
−
1
View file @
d2910a8d
...
...
@@ -172,7 +172,9 @@ class Dashboard extends React.Component {
})}
<
/div
>
<
div
className
=
"
card-action
"
>
<
a
href
=
"
https://katharineum-zu-luebeck.de/aktuelles/termine/
"
>
Weitere
Termine
<
/a
>
<
a
href
=
"
https://katharineum-zu-luebeck.de/aktuelles/termine/
"
target
=
{
"
_blank
"
}
>
Weitere
Termine
<
/a
>
<
/div
>
<
/div
>
<
/div> : ""
}
...
...
This diff is collapsed.
Click to expand it.
schoolapps/dashboard/views.py
+
10
−
4
View file @
d2910a8d
from
django.contrib.auth.decorators
import
login_required
from
django.core.serializers
import
serialize
from
django.http
import
JsonResponse
from
django.shortcuts
import
render
,
get_object_or_404
from
django.template.loader
import
render_to_string
...
...
@@ -8,6 +9,7 @@ from dashboard.settings import latest_article_settings, current_events_settings
from
helper
import
get_newest_articles
,
get_current_events
,
get_newest_article_from_news
from
schoolapps.settings
import
LONG_WEEK_DAYS
from
timetable.helper
import
get_name_for_next_week_day_from_today
,
get_type_and_object_of_user
from
timetable.hints
import
get_all_hints_by_class_and_time_period
,
get_all_hints_for_teachers_by_time_period
from
timetable.views
import
get_next_weekday_with_time
,
get_calendar_week
from
untisconnect.api
import
TYPE_TEACHER
,
TYPE_CLASS
from
untisconnect.plan
import
get_plan
...
...
@@ -36,8 +38,9 @@ def api_information(request):
newest_article
=
get_newest_article_from_news
(
domain
=
latest_article_settings
.
wp_domain
)
else
:
newest_article
=
None
date_formatted
=
get_name_for_next_week_day_from_today
()
next_weekday
=
get_next_weekday_with_time
(
timezone
.
now
(),
timezone
.
now
().
time
())
# Get user type (student, teacher, etc.)
_type
,
el
=
get_type_and_object_of_user
(
request
.
user
)
...
...
@@ -48,7 +51,7 @@ def api_information(request):
raw_type
=
"
teacher
"
# Get hints
#
hints = list(get_all_hints_for_teachers_by_time_period(next_weekday, next_weekday))
hints
=
list
(
get_all_hints_for_teachers_by_time_period
(
next_weekday
,
next_weekday
))
elif
_type
==
TYPE_CLASS
:
# Student
...
...
@@ -57,8 +60,11 @@ def api_information(request):
raw_type
=
"
class
"
# Get hints
# hints = list(get_all_hints_by_class_and_time_period(el, next_weekday, next_weekday))
hints
=
list
(
get_all_hints_by_class_and_time_period
(
el
,
next_weekday
,
next_weekday
))
else
:
hints
=
[]
hints
=
serialize
(
"
json
"
,
hints
)
print
(
hints
)
context
=
{
'
activities
'
:
list
(
activities
.
values
()),
'
notifications
'
:
list
(
notifications
.
values
()),
...
...
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