Motion formatting and sort fixes

- Adapt font size of outside linenumbers in motion pdf, depending on
  selected standard font size.
- Enlarge width of first column in of meta table of motion pdf.
- Fixed order issue in motion list: Sort always by identifier (also
  after selecting a custom sort parameter).
This commit is contained in:
Emanuel Schütze 2017-07-28 14:19:47 +02:00
parent c5c15d26b5
commit 96be75fc0d
3 changed files with 8 additions and 4 deletions

View File

@ -391,7 +391,8 @@ angular.module('OpenSlidesApp.core.pdf', [])
.factory('PdfMakeConverter', [ .factory('PdfMakeConverter', [
'HTMLValidizer', 'HTMLValidizer',
function(HTMLValidizer) { 'Config',
function(HTMLValidizer, Config) {
/** /**
* Converter component for HTML->JSON for pdfMake * Converter component for HTML->JSON for pdfMake
* @constructor * @constructor
@ -906,19 +907,20 @@ angular.module('OpenSlidesApp.core.pdf', [])
}, },
/* Returns the object to push first into every column, that represents the given line. */ /* Returns the object to push first into every column, that represents the given line. */
getLineNumberObject = function (line) { getLineNumberObject = function (line) {
var standardFontsize = Config.get('general_export_pdf_fontsize').value;
return { return {
width: 20, width: 20,
text: [ text: [
{ {
text: ' ', // Add a blank with the normal font size here, so in rare cases the text text: ' ', // Add a blank with the normal font size here, so in rare cases the text
// is rendered on the next page and the linenumber on the previous page. // is rendered on the next page and the linenumber on the previous page.
fontSize: 10, fontSize: standardFontsize,
decoration: '', decoration: '',
}, },
{ {
text: line, text: line,
color: "gray", color: "gray",
fontSize: 8, fontSize: standardFontsize - 2,
decoration: '', decoration: '',
}, },
], ],

View File

@ -248,7 +248,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
// if pdfmake has fixed this. // if pdfmake has fixed this.
var metaTableJsonString = { var metaTableJsonString = {
table: { table: {
widths: ['30%','70%'], widths: ['35%','65%'],
body: metaTableBody, body: metaTableBody,
}, },
margin: [0, 0, 0, 20], margin: [0, 0, 0, 20],

View File

@ -896,6 +896,8 @@ angular.module('OpenSlidesApp.motions.site', [
return Motion.lastModified(); return Motion.lastModified();
}, function () { }, function () {
$scope.motions = Motion.getAll(); $scope.motions = Motion.getAll();
// always order by identifier (after custom ordering)
$scope.motions = _.orderBy($scope.motions, ['identifier']);
_.forEach($scope.motions, function (motion) { _.forEach($scope.motions, function (motion) {
motion.personalNote = PersonalNoteManager.getNote(motion); motion.personalNote = PersonalNoteManager.getNote(motion);
// For filtering, we cannot filter for .personalNote.star // For filtering, we cannot filter for .personalNote.star