Skip to content

Commit cdb6981

Browse files
committed
print voucher code on raffle ticket
1 parent 574ad1b commit cdb6981

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

contactform/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ def index():
138138
)
139139

140140
if config.PRINT_RAFFLE_TICKET:
141-
print_raffle(form=form, config=config, printer_config=printer_config)
141+
print_raffle(
142+
form=form,
143+
voucher_code=voucher_code,
144+
config=config,
145+
printer_config=printer_config,
146+
)
142147

143148
flash("Thanks for submitting", "success")
144149
return redirect(url_for("index"))

contactform/label_raffle.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from brother_ql.backends.network import BrotherQLBackendNetwork
1111

1212

13-
def print_raffle(form, config, printer_config):
13+
def print_raffle(form, voucher_code, config, printer_config):
1414
label_filename = "label_raffle.png"
1515

1616
label_css = """
@@ -26,14 +26,18 @@ def print_raffle(form, config, printer_config):
2626
h1 {
2727
font-size: 70px;
2828
}
29-
p {
29+
.big {
3030
font-size: 35px;
3131
}
32+
.small {
33+
font-size: 25px;
34+
}
3235
"""
3336
label_html = f"""\
3437
<div>
3538
<h1>{form.name.data}</h1>
36-
<p>{config.LABEL_HEADER}</p>
39+
<p class="big">{config.LABEL_HEADER}</p>
40+
<p class="small">{voucher_code}</p>
3741
</div>
3842
"""
3943

0 commit comments

Comments
 (0)