From 86a335ebda421cc54d8392aae323cede17a65a10 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 25 Oct 2017 11:32:31 +0200 Subject: Add Gentium fonts (for PDF rendering) --- ishtar_common/static/gentium/GentiumPlus-I.ttf | Bin 0 -> 1818280 bytes ishtar_common/static/gentium/GentiumPlus-R.ttf | Bin 0 -> 1918536 bytes ishtar_common/static/gentium/OFL.txt | 94 +++++++++++++++++++++++++ ishtar_common/static/gentium/README.txt | 88 +++++++++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 ishtar_common/static/gentium/GentiumPlus-I.ttf create mode 100644 ishtar_common/static/gentium/GentiumPlus-R.ttf create mode 100644 ishtar_common/static/gentium/OFL.txt create mode 100644 ishtar_common/static/gentium/README.txt (limited to 'ishtar_common/static') diff --git a/ishtar_common/static/gentium/GentiumPlus-I.ttf b/ishtar_common/static/gentium/GentiumPlus-I.ttf new file mode 100644 index 000000000..7bc1b3d8b Binary files /dev/null and b/ishtar_common/static/gentium/GentiumPlus-I.ttf differ diff --git a/ishtar_common/static/gentium/GentiumPlus-R.ttf b/ishtar_common/static/gentium/GentiumPlus-R.ttf new file mode 100644 index 000000000..c1194dd35 Binary files /dev/null and b/ishtar_common/static/gentium/GentiumPlus-R.ttf differ diff --git a/ishtar_common/static/gentium/OFL.txt b/ishtar_common/static/gentium/OFL.txt new file mode 100644 index 000000000..4f7540787 --- /dev/null +++ b/ishtar_common/static/gentium/OFL.txt @@ -0,0 +1,94 @@ +Copyright (c) 2003-2014 SIL International (http://www.sil.org/), +with Reserved Font Names "Gentium" and "SIL". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/ishtar_common/static/gentium/README.txt b/ishtar_common/static/gentium/README.txt new file mode 100644 index 000000000..bc17a8cb7 --- /dev/null +++ b/ishtar_common/static/gentium/README.txt @@ -0,0 +1,88 @@ +README +Gentium Plus +======================== + +Thank you for your interest in the Gentium Plus fonts. +We hope you find them useful! + +Gentium Plus supports a wide range of Latin, Greek and Cyrillic +characters. Documentation for the fonts is available on Gentium website +(http://scripts.sil.org/Gentium), including details on what ranges are +supported. + +Gentium Plus is released under the SIL Open Font License. + +See the OFL and OFL-FAQ for details of the SIL Open Font License. +See the FONTLOG for information on this and previous releases. +See the GENTIUM-FAQ for answers to common questions about the Gentium fonts +See the website (http://scripts.sil.org/Gentium) for further documentation. +See the SIL Unicode Roman FAQ (http://scripts.sil.org/ComplexRomanFontFAQ) +for frequently asked questions and their answers regarding SIL's Roman fonts. + + +TIPS +==== + +As this font is distributed at no cost, we are unable to provide a +commercial level of personal technical support. The font has, however, +been through some testing on various platforms to be sure it works in most +situations. In particular, it has been tested and shown to work on Windows +XP, Windows Vista and Windows 7. Graphite capabilities have been tested +on Graphite-supported platforms. + +If you do find a problem, please do report it to fonts@sil.org. +We can't guarantee any direct response, but will try to fix reported bugs in +future versions. Make sure you read through the +SIL Unicode Roman FAQ (http://scripts.sil.org/ComplexRomanFontFAQ). + +Many problems can be solved, or at least explained, through an understanding +of the encoding and use of the fonts. Here are some basic hints: + +Encoding: +The fonts are encoded according to Unicode, so your application must support +Unicode text in order to access letters other than the standard alphabet. +Most Windows applications provide basic Unicode support. You will, however, +need some way of entering Unicode text into your document. + +Keyboarding: +This font does not include any keyboarding helps or utilities. It uses the +built-in keyboards of the operating system. You will need to install the +appropriate keyboard and input method for the characters of the language you +wish to use. If you want to enter characters that are not supported by any +system keyboard, the Keyman program (www.tavultesoft.com) can be helpful +on Windows systems. Also available for Windows is MSKLC +(http://www.microsoft.com/globaldev/tools/msklc.mspx). +For Linux systems such as Ubuntu, KMFL (http://kmfl.sourceforge.net/) +is available. Ukelele (http://scripts.sil.org/ukelele) is available for +Mac OS X versions 10.2 and later. + +For other platforms, KMFL (http://kmfl.sourceforge.net/), +XKB (http://www.x.org/wiki/XKB) or Ukelele (http://scripts.sil.org/ukelele) +can be helpful. + +If you want to enter characters that are not supported by any system +keyboard, and to access the full Unicode range, we suggest you use +gucharmap, kcharselect on Ubuntu or similar software. + +Another method of entering some symbols is provided by a few applications such +as Adobe InDesign or OpenOffice.org. They can display a glyph palette or input +dialog that shows all the glyphs (symbols) in a font and allow you to enter +them by clicking on the glyph you want. + +Rendering: +This font is designed to work with Graphite or Opentype advanced font +technologies. To take advantage of the advanced typographic +capabilities of this font, you must be using applications that provide an +adequate level of support for Graphite or OpenType. See "Applications +that provide an adequate level of support for SIL Unicode Roman fonts" +(http://scripts.sil.org/Complex_AdLvSup). + + +CONTACT +======== +For more information please visit the Gentium page on SIL International's +Computers and Writing systems website: +http://scripts.sil.org/Gentium + +Support through the website: http://scripts.sil.org/Support + -- cgit v1.2.3 From bbf8847cbb02286358213552a6e4dff3f156ef90 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 25 Oct 2017 13:29:40 +0200 Subject: Switch from pisa to weasyprint --- .../templates/ishtar/sheet_contextrecord_pdf.html | 4 --- .../ishtar/sheet_contextrecordsource_pdf.html | 4 --- .../templates/ishtar/sheet_file_pdf.html | 4 --- .../templates/ishtar/sheet_find_pdf.html | 4 --- .../templates/ishtar/sheet_findbasket_pdf.html | 4 --- .../templates/ishtar/sheet_findsource_pdf.html | 4 --- .../templates/ishtar/sheet_treatment_pdf.html | 4 --- .../templates/ishtar/sheet_treatmentfile_pdf.html | 4 --- .../ishtar/sheet_treatmentfilesource_pdf.html | 4 --- .../ishtar/sheet_treatmentsource_pdf.html | 4 --- .../ishtar/sheet_administrativeact_pdf.html | 4 --- .../templates/ishtar/sheet_operation_pdf.html | 4 --- .../ishtar/sheet_operationsource_pdf.html | 4 --- .../templates/ishtar/sheet_container_pdf.html | 4 --- .../templates/ishtar/sheet_warehouse_pdf.html | 4 --- ishtar_common/static/media/style_basic.css | 35 +++++++++++++++++-- .../templates/ishtar/sheet_organization_pdf.html | 4 --- .../templates/ishtar/sheet_person_pdf.html | 4 --- ishtar_common/views.py | 39 ++++++++++++---------- requirements.txt | 6 ++-- 20 files changed, 56 insertions(+), 92 deletions(-) (limited to 'ishtar_common/static') diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html index a0d0affcf..b91500403 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_contextrecord.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html index 38c5d318e..c03b80a53 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_contextrecordsource.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_files/templates/ishtar/sheet_file_pdf.html b/archaeological_files/templates/ishtar/sheet_file_pdf.html index eaf2a9436..7335eaec7 100644 --- a/archaeological_files/templates/ishtar/sheet_file_pdf.html +++ b/archaeological_files/templates/ishtar/sheet_file_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_file.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_find_pdf.html b/archaeological_finds/templates/ishtar/sheet_find_pdf.html index 262bcdad7..11c39f059 100644 --- a/archaeological_finds/templates/ishtar/sheet_find_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_find_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_find.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html b/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html index 2b55f0f76..47a4d2bd8 100644 --- a/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_findbasket.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html b/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html index 26ef9f2d7..7ca3bd3c1 100644 --- a/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_findsource.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html b/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html index 08df52e97..ccd860ec9 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_treatment.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
- – – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfile_pdf.html b/archaeological_finds/templates/ishtar/sheet_treatmentfile_pdf.html index be64ff7eb..c216556b3 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentfile_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentfile_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_treatmentfile.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
- – – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfilesource_pdf.html b/archaeological_finds/templates/ishtar/sheet_treatmentfilesource_pdf.html index d0a0ec8e7..2ef4d63b5 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentfilesource_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentfilesource_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_treatmentfilesource.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentsource_pdf.html b/archaeological_finds/templates/ishtar/sheet_treatmentsource_pdf.html index c38764559..4b7218a14 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentsource_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentsource_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_treatmentsource.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html b/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html index b6d257cb0..be3e24428 100644 --- a/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_administrativeact.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_operations/templates/ishtar/sheet_operation_pdf.html b/archaeological_operations/templates/ishtar/sheet_operation_pdf.html index dc3c8b46f..7d86bd924 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation_pdf.html +++ b/archaeological_operations/templates/ishtar/sheet_operation_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_operation.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html b/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html index 1b2cd9ff3..68eb7aa2d 100644 --- a/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html +++ b/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_operationsource.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html b/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html index 5e4947cfa..ba0e3164c 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_container.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html index 260834ac6..d95efe58f 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_warehouse.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/ishtar_common/static/media/style_basic.css b/ishtar_common/static/media/style_basic.css index 1d92928dc..d0f5bbe4a 100644 --- a/ishtar_common/static/media/style_basic.css +++ b/ishtar_common/static/media/style_basic.css @@ -1,7 +1,8 @@ @page { size: a4 portrait; - margin: 2.5cm 1cm 2.5cm 1cm; + margin: 2cm 1cm 2.5cm 1cm; background-image: url("images/ishtar-bg.jpg"); + background-repeat: no-repeat; @frame footer { -pdf-frame-content: pdffooter; bottom: 1cm; @@ -16,6 +17,9 @@ margin-right: 1cm; height: 1.5cm; } + @bottom-center { + content: counter(page) "/" counter(pages); + } } label{ @@ -36,6 +40,13 @@ caption, h3{ font-size:1.5em; } +a img { + display: block; + margin-left: auto; + margin-right: auto; + padding:0.5em; +} + th{ text-align:center; border-bottom:2px solid #922; @@ -72,10 +83,21 @@ td{ display:none; } +caption, hr, .tool-left, .tool-right, .display_details, .display_details_inline{ + display: None; + color: transparent; + background-color: transparent; + border-color: transparent; +} + p{ margin:0.2em; } +td{ + background-color: #ddd; +} + #pdffooter, #pdfheader{ text-align:center; } @@ -84,8 +106,15 @@ p{ font-weight:bold; width:100%; border-bottom:1px solid #922; + position: fixed; + top: -0.5cm; } -.display_details, .display_details_inline{ - display: none; +.window-refs{ + text-align:center; + padding:0; + margin:0; + font-size: 0.9em; + width:100%; + display:block; } diff --git a/ishtar_common/templates/ishtar/sheet_organization_pdf.html b/ishtar_common/templates/ishtar/sheet_organization_pdf.html index 887c7ccb2..2276aa4d1 100644 --- a/ishtar_common/templates/ishtar/sheet_organization_pdf.html +++ b/ishtar_common/templates/ishtar/sheet_organization_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_organization.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/ishtar_common/templates/ishtar/sheet_person_pdf.html b/ishtar_common/templates/ishtar/sheet_person_pdf.html index 199892d2f..9dd9e4c50 100644 --- a/ishtar_common/templates/ishtar/sheet_person_pdf.html +++ b/ishtar_common/templates/ishtar/sheet_person_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_person.html" %} {% block header %} - {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -
-– – -
{%endblock%} diff --git a/ishtar_common/views.py b/ishtar_common/views.py index b8350c62a..8d475aff5 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2016 Étienne Loks +# Copyright (C) 2010-2017 Étienne Loks # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,13 +21,7 @@ from tidylib import tidy_document as tidy from copy import copy, deepcopy import csv -import cStringIO as StringIO import datetime - -import reportlab -reportlab.Version = "2.2" # stupid hack for an old library... -import ho.pisa as pisa - import json import logging from markdown import markdown @@ -35,6 +29,8 @@ import optparse import re from tempfile import NamedTemporaryFile import unicodedata +from weasyprint import HTML, CSS +from weasyprint.fonts import FontConfiguration from extra_views import ModelFormSetView @@ -42,6 +38,7 @@ from django.conf import settings from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.contrib.postgres.search import SearchQuery +from django.contrib.staticfiles.templatetags.staticfiles import static from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse, NoReverseMatch from django.db.models import Q, ImageField @@ -1333,19 +1330,25 @@ def show_item(model, name, extra_dct=None): elif doc_type == 'pdf': tpl = loader.get_template('ishtar/sheet_%s_pdf.html' % name) context_instance['output'] = 'PDF' - content = tpl.render(context_instance, request) - result = StringIO.StringIO() - html = content.encode('utf-8') - html = html.replace("