Skip to content
Snippets Groups Projects
Verified Commit f3dcab9e authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Make images work.

parent 1845b05f
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,9 @@ class TeckidsLdapMixin(object):
return self.get_image_path(attr[:-6])
elif attr.endswith('__rel'):
return self.get_image_rel(attr[:-5])
elif attr.endswith('__rel_latex'):
# FIXME Find a real solution for this
return '{%s}' % self.get_image_rel(attr[:-5])[:-4]
class TeckidsGroup(ldapdb.models.Model, TeckidsLdapMixin):
class Meta:
......
......@@ -15,7 +15,7 @@
\hline\rowfont\bfseries Foto & Nachname & Vorname & Geburts\-datum & Benutzer & Handynummer \\\hline
\endhead
{% for person in persons %}
\parbox[c][3cm]{2.25cm}{\includegraphics[width=2.24cm,height=2.99cm,keepaspectratio=true,valign=c]{ {{ person.jpeg_photo__rel }} }} & \nohyphens{ {{ person.sn }} } & \nohyphens{ {{ person.given_name }} } & \nohyphens{ {{ person.date_of_birth }} } & \texttt{ {{ person.uid }} } & \nohyphens{ {{ person.mobile }} } \\\hline
\parbox[c][3cm]{2.25cm}{\includegraphics[width=2.24cm,height=2.99cm,keepaspectratio=true,valign=c]{{ person.jpeg_photo__rel_latex }}} & \nohyphens{ {{ person.sn }} } & \nohyphens{ {{ person.given_name }} } & \nohyphens{ {{ person.date_of_birth }} } & \texttt{ {{ person.uid }} } & \nohyphens{ {{ person.mobile }} } \\\hline
{% endfor %}
\end{longtabu}
\end{document}
......
......@@ -111,7 +111,7 @@ def persons(request, group=None):
if format == 'pdf':
# Generate TEXINPUTS correctly
texinputs = [settings.MEDIA_ROOT, os.path.abspath(os.path.dirname(__file__)), '']
texinputs = settings.TEXINPUTS + [settings.MEDIA_ROOT, os.path.abspath(os.path.dirname(__file__)), '']
# Turn LaTeX string into file object
with BytesIO(latex_str) as latex_file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment