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:
- No reload on logoff. OpenSlides is now a full single page
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].
General:

View File

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

View File

@ -96,20 +96,16 @@ self.addEventListener('message', function(e) {
// see https://github.com/bpampuch/pdfmake/issues/38
if (data.footerTpl) {
data.footer = function (currentPage, pageCount) {
var footerText = '';
for(var i = 0; i < data.footerTpl.columns.length; i++) {
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('{{pageCount}}', pageCount);
}
}
return {
text: footerText,
alignment: data.footerTpl.alignment,
columns: data.footerTpl.columns,
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({
image: imageMap[logoHeaderUrl],
fit: [180, 40],
width: '20%'
});
}
@ -176,7 +177,8 @@ angular.module('OpenSlidesApp.core.pdf', [])
columns.push({
text: text,
fontSize: 10,
width: '100%',
alignment: 'right',
margin: [0, 10, 0, 0],
});
return {
color: '#555',
@ -194,22 +196,22 @@ angular.module('OpenSlidesApp.core.pdf', [])
var getFooter = function() {
var columns = [];
// TODO: This does't work. The image does not get rendered.
if (logoFooterUrl) {
columns.push({
image: imageMap[logoFooterUrl],
fit: [180,40],
fit: [400,50],
width: '80%'
});
}
columns.push({
text: '{{currentPage}} / {{pageCount}}',
width: '100%',
color: '#555',
fontSize: 9,
alignment: 'right',
margin: [0, 15, 0, 0],
});
return {
alignment: 'right',
margin: [0, 15, 75, 0],
fontSize: 9,
color: '#555',
margin: [75, 0, 75, 10],
columns: columns,
columnGap: 10,
};

View File

@ -1714,6 +1714,8 @@ angular.module('OpenSlidesApp.core.site', [
gettext('List of speakers overlay');
gettext('Projector logo');
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.
gettext('Default projector');