Skip to content

Commit

Permalink
Add A6 to list of page sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
pferreir committed Feb 22, 2019
1 parent 0c97dd0 commit abde478
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
19 changes: 11 additions & 8 deletions indico/legacy/pdfinterface/base.py
Expand Up @@ -28,7 +28,7 @@
from reportlab import platypus
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.fonts import addMapping
from reportlab.lib.pagesizes import A0, A1, A2, A3, A4, A5, LETTER, landscape
from reportlab.lib.pagesizes import A0, A1, A2, A3, A4, A5, A6, LETTER, landscape
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm, inch
from reportlab.pdfbase import pdfmetrics
Expand All @@ -52,13 +52,16 @@

class PDFSizes:
def __init__(self):
self.PDFpagesizes = {'Letter': LETTER,
'A0': A3,
'A1': A3,
'A2': A3,
'A3': A3,
'A4': A4,
'A5': A5}
self.PDFpagesizes = {
'Letter': LETTER,
'A0': A3,
'A1': A3,
'A2': A3,
'A3': A3,
'A4': A4,
'A5': A5,
'A6': A6
}


def escape(text):
Expand Down
3 changes: 2 additions & 1 deletion indico/modules/designer/__init__.py
Expand Up @@ -38,14 +38,15 @@ class PageOrientation(RichIntEnum):


class PageSize(RichIntEnum):
__titles__ = [None, 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'Letter']
__titles__ = [None, 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'Letter', 'A6']
A0 = 1
A1 = 2
A2 = 3
A3 = 4
A4 = 5
A5 = 6
letter = 7
A6 = 8


class PageLayout(RichIntEnum):
Expand Down
2 changes: 1 addition & 1 deletion indico/modules/events/management/forms.py
Expand Up @@ -284,7 +284,7 @@ class PosterPrintingForm(IndicoForm):
template = SelectField(_('Template'))
margin_horizontal = FloatField(_('Horizontal margins'), [InputRequired()], default=0)
margin_vertical = FloatField(_('Vertical margins'), [InputRequired()], default=0)
page_size = IndicoEnumSelectField(_('Page size'), enum=PageSize, default=PageSize.A4)
page_size = IndicoEnumSelectField(_('Page size'), enum=PageSize, default=PageSize.A4, sorted=True)

def __init__(self, event, **kwargs):
all_templates = set(event.designer_templates) | get_inherited_templates(event)
Expand Down
2 changes: 1 addition & 1 deletion indico/modules/events/registration/forms.py
Expand Up @@ -373,7 +373,7 @@ class BadgeSettingsForm(IndicoForm):
description=_("Save these values in the event settings"))
dashed_border = BooleanField(_("Dashed border around each badge"), widget=SwitchWidget(),
description=_("Display a dashed border around each badge"))
page_size = IndicoEnumSelectField(_('Page size'), enum=PageSize)
page_size = IndicoEnumSelectField(_('Page size'), enum=PageSize, sorted=True)
page_orientation = IndicoEnumSelectField(_('Page orientation'), enum=PageOrientation)
page_layout = IndicoEnumSelectField(_('Page layout'), enum=PageLayout,
description=_('The single sided (foldable) option is only available if the '
Expand Down

0 comments on commit abde478

Please sign in to comment.