Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
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-Chronos
Commits
767bb33b
Verified
Commit
767bb33b
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Make number of days shown in substitutions print view configurable
parent
38074159
No related branches found
Branches containing commit
No related tags found
1 merge request
!34
Include print view for substitutions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/chronos/settings.py
+8
-0
8 additions, 0 deletions
aleksis/apps/chronos/settings.py
aleksis/apps/chronos/views.py
+3
-2
3 additions, 2 deletions
aleksis/apps/chronos/views.py
with
11 additions
and
2 deletions
aleksis/apps/chronos/settings.py
0 → 100644
+
8
−
0
View file @
767bb33b
from
django.utils.translation
import
gettext_lazy
as
_
CONSTANCE_CONFIG
=
{
"
CHRONOS_SUBSTITUTIONS_PRINT_DAY_NUMBER
"
:
(
2
,
_
(
"
Number of days shown on substitutions print view
"
)),
}
CONSTANCE_CONFIG_FIELDSETS
=
{
"
Chronos settings
"
:
(
"
CHRONOS_SUBSTITUTIONS_PRINT_DAY_NUMBER
"
,),
}
This diff is collapsed.
Click to expand it.
aleksis/apps/chronos/views.py
+
3
−
2
View file @
767bb33b
...
...
@@ -2,6 +2,7 @@ from collections import OrderedDict
from
datetime
import
date
,
datetime
,
timedelta
from
typing
import
Optional
,
Tuple
from
constance
import
config
from
django.contrib.auth.decorators
import
login_required
from
django.db.models
import
Count
from
django.http
import
HttpRequest
,
HttpResponse
,
HttpResponseNotFound
...
...
@@ -310,12 +311,12 @@ def substitutions(
else
:
wanted_day
=
get_next_relevant_day
(
timezone
.
now
().
date
(),
datetime
.
now
().
time
())
DAY_COUNT
=
2
day_number
=
config
.
CHRONOS_SUBSTITUTIONS_PRINT_DAY_NUMBER
day_contexts
=
{}
if
is_print
:
next_day
=
wanted_day
for
i
in
range
(
DAY_COUNT
):
for
i
in
range
(
day_number
):
day_contexts
[
next_day
]
=
{
"
day
"
:
next_day
}
next_day
=
get_next_relevant_day
(
next_day
+
timedelta
(
days
=
1
))
else
:
...
...
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