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', [
'gettextCatalog',
'Config',
'PDFLayout',
function(gettextCatalog, Config, PDFLayout) {
function(Config, PDFLayout) {
/**
* Provides the global document
* @constructor
@ -783,9 +782,10 @@ angular.module('OpenSlidesApp.core.pdf', [])
.factory('PdfCreate', [
'$timeout',
'gettextCatalog',
'FileSaver',
'Messaging',
function ($timeout, FileSaver, Messaging) {
function ($timeout, gettextCatalog, FileSaver, Messaging) {
var filenameMessageMap = {};
var b64toBlob = function(b64Data) {
var byteCharacters = atob(b64Data);
@ -802,17 +802,17 @@ angular.module('OpenSlidesApp.core.pdf', [])
switch (state) {
case 'info':
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;
case 'success':
text = '<i class="fa fa-check fa-lg spacer-right"></i>' +
'<translate>PDF successfully generated.</translate>';
gettextCatalog.getString('PDF successfully generated.');
timeout = 3000;
break;
case 'error':
text = '<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>' ;
gettextCatalog.getString('Error while generating PDF file') +
' (' + filename + '): <code>' + error + '</code>';
break;
}
$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,
style: 'tableofcontent',
width: 30
width: 70
},
{
text: motion.getTitle(),
@ -495,21 +495,21 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
// function to create the table of catergories (if any)
var createTOCategories = function() {
if (Category.getAll().length > 0) {
if (Category.getAll().length > 1) {
var heading = {
text: gettextCatalog.getString("Categories"),
style: "heading2"
};
var toc = [];
angular.forEach(Category.getAll(), function(cat) {
angular.forEach(Category.filter({orderBy: 'prefix'}) , function(cat) {
toc.push(
{
columns: [
{
text: cat.prefix,
style: 'tableofcontent',
width: 30
width: 50
},
{
text: cat.name,