@@ -29,6 +29,30 @@ def create_preivew_badge_pdf(badgeForms):
2929 badgeForms = badgeForms [0 ]
3030 badgeFieldForms = badgeForms ['badgeFields' ]
3131 badgeId = badgeForms ['badgeID' ]
32+ for badge_field in badgeFieldForms :
33+ font_weight = []
34+ font_style = []
35+ text_decoration = []
36+ if badge_field .get ('font_weight' ):
37+ for item in badge_field .get ('font_weight' ):
38+ if item .get ('font_weight' ):
39+ font_weight .append (item .get ('font_weight' ))
40+ if item .get ('font_style' ):
41+ font_style .append (item .get ('font_style' ))
42+ if item .get ('text_decoration' ):
43+ text_decoration .append (item .get ('text_decoration' ))
44+ if not font_weight :
45+ badge_field ['font_weight' ] = 'none'
46+ else :
47+ badge_field ['font_weight' ] = ',' .join (font_weight )
48+ if not font_style :
49+ badge_field ['font_style' ] = 'none'
50+ else :
51+ badge_field ['font_style' ] = ',' .join (font_style )
52+ if not text_decoration :
53+ badge_field ['text_decoration' ] = 'none'
54+ else :
55+ badge_field ['text_decoration' ] = ',' .join (text_decoration )
3256 create_save_pdf (
3357 render_template (
3458 'pdf/badge_forms.html' , badgeForms = badgeForms , badgeFieldForms = badgeFieldForms
@@ -119,6 +143,32 @@ def create_print_badge_pdf(badge_form, ticket_holder, list_field_show):
119143 continue
120144
121145 get_value_from_field_indentifier (field , ticket_holder )
146+
147+ for badge_field in badgeFieldForms :
148+ font_weight = []
149+ font_style = []
150+ text_decoration = []
151+ if badge_field .get ('font_weight' ):
152+ for item in badge_field .get ('font_weight' ):
153+ if item .get ('font_weight' ):
154+ font_weight .append (item .get ('font_weight' ))
155+ if item .get ('font_style' ):
156+ font_style .append (item .get ('font_style' ))
157+ if item .get ('text_decoration' ):
158+ text_decoration .append (item .get ('text_decoration' ))
159+ if not font_weight :
160+ badge_field ['font_weight' ] = 'none'
161+ else :
162+ badge_field ['font_weight' ] = ',' .join (font_weight )
163+ if not font_style :
164+ badge_field ['font_style' ] = 'none'
165+ else :
166+ badge_field ['font_style' ] = ',' .join (font_style )
167+ if not text_decoration :
168+ badge_field ['text_decoration' ] = 'none'
169+ else :
170+ badge_field ['text_decoration' ] = ',' .join (text_decoration )
171+
122172 create_save_pdf (
123173 render_template (
124174 'pdf/badge_forms.html' , badgeForms = badge_form , badgeFieldForms = badgeFieldForms
0 commit comments