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
2a092dd7
Commit
2a092dd7
authored
6 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
CSS change for timetable (more padding) | Bug fix for PDF generator of timetable
parent
1494fc8f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
biscuit/apps/chronos/pdf.py
+3
-1
3 additions, 1 deletion
biscuit/apps/chronos/pdf.py
biscuit/apps/chronos/views.py
+2
-1
2 additions, 1 deletion
biscuit/apps/chronos/views.py
with
5 additions
and
2 deletions
biscuit/apps/chronos/pdf.py
+
3
−
1
View file @
2a092dd7
...
...
@@ -4,6 +4,8 @@ import subprocess
from
django.utils
import
timezone
from
django.utils
import
formats
from
schoolapps.settings
import
BASE_DIR
# LaTeX constants
TEX_HEADER
=
"""
\\
documentclass[11pt]{article}
...
...
@@ -94,7 +96,7 @@ def generate_pdf(tex, filename):
"""
Generate a PDF by LaTeX code
"""
# Read LaTeX file
tex_file
=
open
(
os
.
path
.
join
(
"
latex
"
,
filename
+
"
.tex
"
),
"
w
"
)
tex_file
=
open
(
os
.
path
.
join
(
BASE_DIR
,
"
latex
"
,
filename
+
"
.tex
"
),
"
w
"
)
tex_file
.
write
(
tex
)
tex_file
.
close
()
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/chronos/views.py
+
2
−
1
View file @
2a092dd7
...
...
@@ -14,6 +14,7 @@ from untisconnect.sub import get_substitutions_by_date, generate_sub_table
from
untisconnect.api
import
*
from
userinformation
import
UserInformation
from
schoolapps.settings
import
BASE_DIR
def
get_all_context
():
teachers
=
get_all_teachers
()
...
...
@@ -196,7 +197,7 @@ def sub_pdf(request):
generate_pdf
(
tex
,
"
class
"
)
# Read and response PDF
file
=
open
(
os
.
path
.
join
(
"
latex
"
,
"
class.pdf
"
),
"
rb
"
)
file
=
open
(
os
.
path
.
join
(
BASE_DIR
,
"
latex
"
,
"
class.pdf
"
),
"
rb
"
)
return
FileResponse
(
file
,
content_type
=
"
application/pdf
"
)
...
...
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