Minor template fixes

- More column width in all-motions pdf.
  Order categories by prefix.
- Fixed using translations in error messages.
  Removed unused pdf-status template.
This commit is contained in:
Emanuel Schütze 2017-03-08 22:24:03 +01:00
parent 48f7c258df
commit 3717f63d12
3 changed files with 11 additions and 35 deletions

View File

@ -116,10 +116,9 @@ angular.module('OpenSlidesApp.core.pdf', [])
.factory('PdfMakeDocumentProvider', [ .factory('PdfMakeDocumentProvider', [
'gettextCatalog',
'Config', 'Config',
'PDFLayout', 'PDFLayout',
function(gettextCatalog, Config, PDFLayout) { function(Config, PDFLayout) {
/** /**
* Provides the global document * Provides the global document
* @constructor * @constructor
@ -783,9 +782,10 @@ angular.module('OpenSlidesApp.core.pdf', [])
.factory('PdfCreate', [ .factory('PdfCreate', [
'$timeout', '$timeout',
'gettextCatalog',
'FileSaver', 'FileSaver',
'Messaging', 'Messaging',
function ($timeout, FileSaver, Messaging) { function ($timeout, gettextCatalog, FileSaver, Messaging) {
var filenameMessageMap = {}; var filenameMessageMap = {};
var b64toBlob = function(b64Data) { var b64toBlob = function(b64Data) {
var byteCharacters = atob(b64Data); var byteCharacters = atob(b64Data);
@ -802,17 +802,17 @@ angular.module('OpenSlidesApp.core.pdf', [])
switch (state) { switch (state) {
case 'info': case 'info':
text = '<i class="fa fa-spinner fa-pulse fa-lg spacer-right"></i>' + text = '<i class="fa fa-spinner fa-pulse fa-lg spacer-right"></i>' +
'<translate>Generating PDF file ' + filename + ' ...</translate>'; gettextCatalog.getString('Generating PDF file') + ' (' + filename + ') ...';
break; break;
case 'success': case 'success':
text = '<i class="fa fa-check fa-lg spacer-right"></i>' + text = '<i class="fa fa-check fa-lg spacer-right"></i>' +
'<translate>PDF successfully generated.</translate>'; gettextCatalog.getString('PDF successfully generated.');
timeout = 3000; timeout = 3000;
break; break;
case 'error': case 'error':
text = '<i class="fa fa-exclamation-triangle fa-lg spacer-right"></i>' + text = '<i class="fa fa-exclamation-triangle fa-lg spacer-right"></i>' +
'<translate>Error while generating PDF file</translate> ' + filename + ':' + gettextCatalog.getString('Error while generating PDF file') +
'<span ng-if="pdf.errorMessage"><code>{{ pdf.errorMessage | translate }}</code></span>' ; ' (' + filename + '): <code>' + error + '</code>';
break; break;
} }
$timeout(function () { $timeout(function () {

View File

@ -1,24 +0,0 @@
<div id="pdf-status">
<div id="pdf-status-container">
<div ng-repeat="(filename, pdf) in pdfs" ng-class="pdf.state">
<span class="close fa fa-times fa-lg" ng-click="close(filename)"></span>
<span ng-if="pdf.state === 'generating'">
<i class="fa fa-spinner fa-pulse fa-lg spacer-right"></i>
<translate>Generating PDF file {{ filename }} ...</translate>
</span>
<span ng-if="pdf.state === 'finished'">
<i class="fa fa-check fa-lg spacer-right"></i>
<translate>PDF successfully generated.</translate>
</span>
<span ng-if="pdf.state === 'error'">
<i class="fa fa-exclamation-triangle fa-lg spacer-right"></i>
<translate>Error while generating PDF file</translate> {{ filename }}:
<span ng-if="pdf.errorMessage"><code>{{ pdf.errorMessage | translate }}</code></span>
</span>
</div>
</div>
</div>

View File

@ -475,7 +475,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
{ {
text: identifier, text: identifier,
style: 'tableofcontent', style: 'tableofcontent',
width: 30 width: 70
}, },
{ {
text: motion.getTitle(), text: motion.getTitle(),
@ -495,21 +495,21 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
// function to create the table of catergories (if any) // function to create the table of catergories (if any)
var createTOCategories = function() { var createTOCategories = function() {
if (Category.getAll().length > 0) { if (Category.getAll().length > 1) {
var heading = { var heading = {
text: gettextCatalog.getString("Categories"), text: gettextCatalog.getString("Categories"),
style: "heading2" style: "heading2"
}; };
var toc = []; var toc = [];
angular.forEach(Category.getAll(), function(cat) { angular.forEach(Category.filter({orderBy: 'prefix'}) , function(cat) {
toc.push( toc.push(
{ {
columns: [ columns: [
{ {
text: cat.prefix, text: cat.prefix,
style: 'tableofcontent', style: 'tableofcontent',
width: 30 width: 50
}, },
{ {
text: cat.name, text: cat.name,