Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Marie Place
SCODOC_R6A06
Commits
55748e9a
Commit
55748e9a
authored
3 months ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Filigrannes bulletins étudiant. Fixes #1052
parent
e2ffec1a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/scodoc/sco_bulletins_pdf.py
+2
-4
2 additions, 4 deletions
app/scodoc/sco_bulletins_pdf.py
app/scodoc/sco_pdf.py
+16
-9
16 additions, 9 deletions
app/scodoc/sco_pdf.py
with
18 additions
and
13 deletions
app/scodoc/sco_bulletins_pdf.py
+
2
−
4
View file @
55748e9a
...
...
@@ -296,17 +296,15 @@ def get_etud_bulletins_pdf(etudid, version="selectedevals"):
etud
=
Identite
.
get_etud
(
etudid
)
fragments
=
[]
bookmarks
=
{}
filigrannes
=
{}
i
=
1
for
formsemestre
in
etud
.
get_formsemestres
():
frag
,
filigranne
=
sco_bulletins
.
do_formsemestre_bulletinetud
(
frag
,
_
=
sco_bulletins
.
do_formsemestre_bulletinetud
(
formsemestre
,
etud
,
fmt
=
"
pdfpart
"
,
version
=
version
,
)
fragments
+=
frag
filigrannes
[
i
]
=
filigranne
bookmarks
[
i
]
=
formsemestre
.
session_id
()
# eg RT-DUT-FI-S1-2015
i
=
i
+
1
infos
=
{
"
DeptName
"
:
sco_preferences
.
get_preference
(
"
DeptName
"
)}
...
...
@@ -322,7 +320,7 @@ def get_etud_bulletins_pdf(etudid, version="selectedevals"):
etud
.
nomprenom
,
infos
,
bookmarks
,
filigranne
=
filigrannes
,
#
filigranne=filigrannes,
server_name
=
server_name
,
)
finally
:
...
...
This diff is collapsed.
Click to expand it.
app/scodoc/sco_pdf.py
+
16
−
9
View file @
55748e9a
...
...
@@ -226,6 +226,7 @@ class DebutBulletin(BulMarker):
"""
def
__init__
(
self
,
bookmark
=
None
,
filigranne
=
None
,
footer_content
=
None
):
log
(
f
"
DebutBulletin: filigranne=
{
filigranne
}
"
)
self
.
bookmark
=
bookmark
self
.
filigranne
=
filigranne
self
.
footer_content
=
footer_content
...
...
@@ -245,11 +246,13 @@ class ScoDocPageTemplate(PageTemplate):
margins
=
(
0
,
0
,
0
,
0
),
# additional margins in mm (left,top,right, bottom)
server_name
=
""
,
footer_template
=
DEFAULT_PDF_FOOTER_TEMPLATE
,
filigranne
=
None
,
filigranne
:
str
|
dict
[
int
,
str
]
|
None
=
None
,
preferences
=
None
,
# dictionnary with preferences, required
with_page_numbers
=
False
,
):
"""
Initialise our page template.
"""
"""
Initialise our page template.
- filigranne: chaine ou dict { page_no : str } ou None
"""
# defered import (solve circular dependency ->sco_logo ->scodoc, ->sco_pdf
from
app.scodoc.sco_logos
import
find_logo
...
...
@@ -378,10 +381,12 @@ class ScoDocPageTemplate(PageTemplate):
self
.
draw_footer
(
canv
,
foot_content
or
self
.
footer_string
())
# ---- Filigranne (texte en diagonal en haut a gauche de chaque page)
filigranne
=
None
filigranne_created_by_debutbulletin
=
False
if
hasattr
(
doc
,
"
filigranne
"
):
# filigranne crée par DebutBulletin
filigranne
=
doc
.
filigranne
if
not
filigranne
and
self
.
filigranne
:
filigranne_created_by_debutbulletin
=
True
if
filigranne
is
None
and
self
.
filigranne
:
if
isinstance
(
self
.
filigranne
,
str
):
filigranne
=
self
.
filigranne
# same for all pages
else
:
...
...
@@ -394,6 +399,7 @@ class ScoDocPageTemplate(PageTemplate):
canv
.
setFillColorRGB
(
1.0
,
0.65
,
0.65
,
alpha
=
0.6
)
canv
.
drawCentredString
(
0
,
0
,
SU
(
filigranne
))
canv
.
restoreState
()
if
not
filigranne_created_by_debutbulletin
:
doc
.
filigranne
=
None
# Increment page number
self
.
page_number
+=
1
...
...
@@ -420,7 +426,8 @@ class BulletinDocTemplate(BaseDocTemplate):
self
.
canv
.
addOutlineEntry
(
SU
(
flowable
.
bookmark
),
flowable
.
bookmark
,
level
=
0
,
closed
=
None
)
if
flowable
.
filigranne
:
log
(
f
"
filigranne:
{
flowable
.
filigranne
}
set in
{
self
}
"
)
# XXX
if
flowable
.
filigranne
is
not
None
:
self
.
filigranne
=
flowable
.
filigranne
...
...
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