Skip to content

Commit bab6bde

Browse files
committed
[FEATURE] Better collective sheet, with html and resized logo. Accept
images
1 parent 10191a0 commit bab6bde

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

collectives/routes/event.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import builtins
1010
from flask import flash, render_template, redirect, url_for, request, send_file
1111
from flask import Blueprint, abort
12-
from markupsafe import Markup, escape
12+
from markupsafe import Markup
1313
from flask_login import current_user
1414
from werkzeug.datastructures import CombinedMultiDict
1515
from sqlalchemy.orm import joinedload, selectinload
@@ -331,11 +331,10 @@ def print_event(event_id):
331331
return redirect(url_for("event.index"))
332332

333333
activity_names = [at.name for at in event.activity_types]
334-
description = escape(event.description)
335334
return render_template(
336335
"event/print_event.html",
337336
event=event,
338-
description=description,
337+
description=event.rendered_description,
339338
activity_names=activity_names,
340339
)
341340

collectives/static/css/print-event.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ div#description pre {
4747
overflow-y: hidden;
4848
white-space: pre-wrap;
4949
word-wrap: break-word;
50-
height:20em;
5150
padding:1em;
5251
border:1px solid black;
5352
font-family: Arial, Helvetica, sans-serif;
5453
font-size:80%;
54+
zoom: 0.8;
5555
}
5656

5757
div#info

collectives/templates/event/print_event.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
</ul>
1515
</div>
1616

17-
<div id="logo"><img src="{{ url_for('static', filename=Configuration.CLUB_LOGO) }}"></div>
17+
<div id="logo"><img
18+
style = "max-width: 200px; max-height: 50px"
19+
src="{{ url_for('static', filename=Configuration.CLUB_LOGO) }}"></div>
1820

1921
<div id="title">
2022
<h2 class="heading-2">
@@ -29,7 +31,7 @@ <h1 class="heading-1">{{event.title}}</h1>
2931

3032
<div id="description">
3133
<pre>
32-
{{description}}
34+
{{description | safe}}
3335
</pre>
3436
</div>
3537

tests/events/test_event.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from bs4 import BeautifulSoup
88
from openpyxl import load_workbook
9-
from markupsafe import escape
109

1110
from collectives.models import db, EventStatus, ActivityType, Event, EventVisibility
1211
from collectives.models import RoleIds, Question, QuestionType
@@ -331,4 +330,4 @@ def test_event_print(leader_client, event1_with_reg, user2):
331330
assert user2.full_name() in response.text
332331
assert user2.license in response.text
333332
assert event1_with_reg.leaders[0].full_name() in response.text
334-
assert escape(event1_with_reg.description) in response.text
333+
assert event1_with_reg.rendered_description in response.text

0 commit comments

Comments
 (0)