Show pdf footer logo. Fixed layout.

This commit is contained in:
Emanuel Schütze 2017-04-27 12:47:04 +02:00
parent fb45d30a34
commit 7c8bc935f8
5 changed files with 18 additions and 17 deletions

View File

@ -36,7 +36,8 @@ Users:
Core: Core:
- No reload on logoff. OpenSlides is now a full single page - No reload on logoff. OpenSlides is now a full single page
application [#3172]. application [#3172].
- Adding support for choosing image files as logos [#3184, #3207]. - Adding support for choosing image files as logos for projector and
pdf [#3184, #3207, #3208].
- Fixing error when clearing empty chat [#3199]. - Fixing error when clearing empty chat [#3199].
General: General:

View File

@ -254,7 +254,7 @@ def get_config_variables():
yield ConfigVariable( yield ConfigVariable(
name='logo_pdf_header', name='logo_pdf_header',
default_value={ default_value={
'display_name': 'Header PDF logo', 'display_name': 'PDF header logo',
'path': ''}, 'path': ''},
input_type='logo', input_type='logo',
weight=310, weight=310,
@ -264,7 +264,7 @@ def get_config_variables():
yield ConfigVariable( yield ConfigVariable(
name='logo_pdf_footer', name='logo_pdf_footer',
default_value={ default_value={
'display_name': 'Footer PDF logo', 'display_name': 'PDF footer logo',
'path': ''}, 'path': ''},
input_type='logo', input_type='logo',
weight=311, weight=311,

View File

@ -96,20 +96,16 @@ self.addEventListener('message', function(e) {
// see https://github.com/bpampuch/pdfmake/issues/38 // see https://github.com/bpampuch/pdfmake/issues/38
if (data.footerTpl) { if (data.footerTpl) {
data.footer = function (currentPage, pageCount) { data.footer = function (currentPage, pageCount) {
var footerText = '';
for(var i = 0; i < data.footerTpl.columns.length; i++) { for(var i = 0; i < data.footerTpl.columns.length; i++) {
if (data.footerTpl.columns[i].text) { if (data.footerTpl.columns[i].text) {
footerText = data.footerTpl.columns[i].text data.footerTpl.columns[i].text = data.footerTpl.columns[i].text
.replace('{{currentPage}}', currentPage) .replace('{{currentPage}}', currentPage)
.replace('{{pageCount}}', pageCount); .replace('{{pageCount}}', pageCount);
} }
} }
return { return {
text: footerText, columns: data.footerTpl.columns,
alignment: data.footerTpl.alignment,
margin: data.footerTpl.margin, margin: data.footerTpl.margin,
fontSize: data.footerTpl.fontSize,
color: data.footerTpl.color
}; };
}; };
} }

View File

@ -161,6 +161,7 @@ angular.module('OpenSlidesApp.core.pdf', [])
columns.push({ columns.push({
image: imageMap[logoHeaderUrl], image: imageMap[logoHeaderUrl],
fit: [180, 40], fit: [180, 40],
width: '20%'
}); });
} }
@ -176,7 +177,8 @@ angular.module('OpenSlidesApp.core.pdf', [])
columns.push({ columns.push({
text: text, text: text,
fontSize: 10, fontSize: 10,
width: '100%', alignment: 'right',
margin: [0, 10, 0, 0],
}); });
return { return {
color: '#555', color: '#555',
@ -194,22 +196,22 @@ angular.module('OpenSlidesApp.core.pdf', [])
var getFooter = function() { var getFooter = function() {
var columns = []; var columns = [];
// TODO: This does't work. The image does not get rendered.
if (logoFooterUrl) { if (logoFooterUrl) {
columns.push({ columns.push({
image: imageMap[logoFooterUrl], image: imageMap[logoFooterUrl],
fit: [180,40], fit: [400,50],
width: '80%'
}); });
} }
columns.push({ columns.push({
text: '{{currentPage}} / {{pageCount}}', text: '{{currentPage}} / {{pageCount}}',
width: '100%', color: '#555',
fontSize: 9,
alignment: 'right',
margin: [0, 15, 0, 0],
}); });
return { return {
alignment: 'right', margin: [75, 0, 75, 10],
margin: [0, 15, 75, 0],
fontSize: 9,
color: '#555',
columns: columns, columns: columns,
columnGap: 10, columnGap: 10,
}; };

View File

@ -1714,6 +1714,8 @@ angular.module('OpenSlidesApp.core.site', [
gettext('List of speakers overlay'); gettext('List of speakers overlay');
gettext('Projector logo'); gettext('Projector logo');
gettext('Projector header image'); gettext('Projector header image');
gettext('PDF header logo');
gettext('PDF footer logo');
// Mark the string 'Default projector' here, because it does not appear in the templates. // Mark the string 'Default projector' here, because it does not appear in the templates.
gettext('Default projector'); gettext('Default projector');